From 04fe60e4e2e3b4e52aaf0e15c92ff896c20785cd Mon Sep 17 00:00:00 2001 From: lucassus Date: Thu, 26 Feb 2026 14:18:34 +0000 Subject: [PATCH] Automated commit message --- LICENSE | 2 +- README.md | 101 +- advancedbilling/__init__.py | 18 +- advancedbilling/advanced_billing_client.py | 245 +- advancedbilling/api_helper.py | 13 +- advancedbilling/configuration.py | 149 +- advancedbilling/controllers/__init__.py | 69 +- .../controllers/advance_invoice_controller.py | 191 +- .../controllers/api_exports_controller.py | 450 ++-- .../controllers/base_controller.py | 32 +- .../controllers/billing_portal_controller.py | 279 ++- .../component_price_points_controller.py | 858 ++++--- .../controllers/components_controller.py | 922 ++++--- .../controllers/coupons_controller.py | 1028 ++++---- .../controllers/custom_fields_controller.py | 814 +++--- .../controllers/customers_controller.py | 429 ++-- ...vents_based_billing_segments_controller.py | 482 ++-- .../controllers/events_controller.py | 454 ++-- .../controllers/insights_controller.py | 317 +-- .../controllers/invoices_controller.py | 1493 +++++------ .../controllers/offers_controller.py | 259 +- .../payment_profiles_controller.py | 858 +++---- .../product_families_controller.py | 384 +-- .../product_price_points_controller.py | 795 +++--- .../controllers/products_controller.py | 385 +-- .../proforma_invoices_controller.py | 717 +++--- .../controllers/reason_codes_controller.py | 281 ++- .../controllers/referral_codes_controller.py | 77 +- .../sales_commissions_controller.py | 395 ++- .../controllers/sites_controller.py | 170 +- .../subscription_components_controller.py | 1601 ++++++------ ...iption_group_invoice_account_controller.py | 277 +- .../subscription_group_status_controller.py | 252 +- .../subscription_groups_controller.py | 510 ++-- ...subscription_invoice_account_controller.py | 467 ++-- .../subscription_notes_controller.py | 300 +-- .../subscription_products_controller.py | 275 +- .../subscription_renewals_controller.py | 614 +++++ .../subscription_status_controller.py | 671 ++--- .../controllers/subscriptions_controller.py | 1115 ++++----- .../controllers/webhooks_controller.py | 340 +-- advancedbilling/exceptions/__init__.py | 50 +- advancedbilling/exceptions/api_exception.py | 15 +- .../component_allocation_error_exception.py | 44 +- .../component_price_point_error_exception.py | 44 +- .../customer_error_response_exception.py | 40 +- .../error_array_map_response_exception.py | 38 +- .../error_list_response_exception.py | 34 +- .../error_string_map_response_exception.py | 38 +- ..._billing_list_segments_errors_exception.py | 42 +- ..._based_billing_segment_errors_exception.py | 38 +- .../event_based_billing_segment_exception.py | 38 +- ...ct_price_point_error_response_exception.py | 38 +- ...ma_bad_request_error_response_exception.py | 46 +- ...epayment_base_errors_response_exception.py | 46 +- .../single_error_response_exception.py | 34 +- .../single_string_error_response_exception.py | 38 +- ...subscription_add_coupon_error_exception.py | 74 +- ...on_component_allocation_error_exception.py | 47 +- ...n_group_create_error_response_exception.py | 39 +- ...n_group_signup_error_response_exception.py | 41 +- ...n_group_update_error_response_exception.py | 46 +- ...cription_remove_coupon_errors_exception.py | 34 +- .../subscription_response_error_exception.py | 43 +- ...scriptions_mrr_error_response_exception.py | 38 +- ...anagement_link_requests_error_exception.py | 41 +- advancedbilling/http/__init__.py | 16 +- advancedbilling/http/auth/__init__.py | 4 +- advancedbilling/http/auth/basic_auth.py | 88 +- advancedbilling/http/http_call_back.py | 11 +- advancedbilling/http/http_client_provider.py | 6 +- advancedbilling/http/http_method_enum.py | 13 +- advancedbilling/http/http_request.py | 43 +- advancedbilling/http/http_response.py | 36 +- advancedbilling/http/proxy_settings.py | 35 +- advancedbilling/models/__init__.py | 1180 ++++----- advancedbilling/models/account_balance.py | 131 +- advancedbilling/models/account_balances.py | 202 +- advancedbilling/models/ach_agreement.py | 177 +- .../models/activate_event_based_component.py | 149 +- .../models/activate_subscription_request.py | 84 +- advancedbilling/models/add_coupons_request.py | 73 +- .../models/add_subscription_to_a_group.py | 78 +- advancedbilling/models/address_change.py | 84 +- .../models/agreement_acceptance.py | 217 +- advancedbilling/models/all_vaults.py | 96 +- advancedbilling/models/allocate_components.py | 293 ++- advancedbilling/models/allocation.py | 817 ++++-- .../models/allocation_expiration_date.py | 75 +- advancedbilling/models/allocation_preview.py | 421 +++- .../models/allocation_preview_direction.py | 17 +- .../models/allocation_preview_item.py | 578 +++-- .../models/allocation_preview_line_item.py | 297 ++- .../allocation_preview_line_item_kind.py | 21 +- .../models/allocation_preview_response.py | 67 +- advancedbilling/models/allocation_response.py | 78 +- advancedbilling/models/allocation_settings.py | 141 +- .../models/apple_pay_payment_profile.py | 604 +++-- advancedbilling/models/apple_pay_vault.py | 21 +- .../models/applied_credit_note_data.py | 103 +- .../models/apply_credit_note_event.py | 227 +- .../models/apply_credit_note_event_data.py | 397 ++- .../models/apply_debit_note_event.py | 227 +- .../models/apply_debit_note_event_data.py | 266 +- advancedbilling/models/apply_payment_event.py | 231 +- .../models/apply_payment_event_data.py | 429 +++- advancedbilling/models/attribute_error.py | 63 +- advancedbilling/models/auto_invite.py | 13 +- advancedbilling/models/auto_resume.py | 83 +- advancedbilling/models/available_actions.py | 107 + .../models/backport_invoice_event.py | 223 +- .../models/bank_account_attributes.py | 405 ++- .../models/bank_account_holder_type.py | 23 +- .../models/bank_account_payment_profile.py | 794 ++++-- .../models/bank_account_response.py | 71 +- advancedbilling/models/bank_account_type.py | 23 +- advancedbilling/models/bank_account_vault.py | 40 +- .../models/bank_account_verification.py | 100 +- .../bank_account_verification_request.py | 71 +- advancedbilling/models/base_refund_error.py | 73 +- advancedbilling/models/base_string_error.py | 73 +- advancedbilling/models/basic_date_field.py | 17 +- advancedbilling/models/batch_job.py | 197 +- advancedbilling/models/batch_job_response.py | 67 +- advancedbilling/models/billing_manifest.py | 311 ++- .../models/billing_manifest_item.py | 428 +++- .../models/billing_manifest_line_item_kind.py | 25 +- advancedbilling/models/billing_schedule.py | 89 +- advancedbilling/models/breakouts.py | 154 +- .../bulk_components_price_point_assignment.py | 83 +- ...ulk_create_product_price_points_request.py | 73 +- ...lk_create_product_price_points_response.py | 79 +- .../models/bulk_create_segments.py | 79 +- .../models/bulk_update_segments.py | 79 +- .../models/bulk_update_segments_item.py | 111 +- advancedbilling/models/calendar_billing.py | 120 +- .../cancel_grouped_subscriptions_request.py | 73 +- advancedbilling/models/cancellation_method.py | 32 +- .../models/cancellation_options.py | 197 +- .../models/cancellation_request.py | 67 +- advancedbilling/models/card_type.py | 96 +- .../models/change_chargeback_status_event.py | 227 +- .../change_chargeback_status_event_data.py | 82 +- .../change_invoice_collection_method_event.py | 231 +- ...ge_invoice_collection_method_event_data.py | 122 +- .../models/change_invoice_status_event.py | 227 +- .../change_invoice_status_event_data.py | 216 +- advancedbilling/models/chargeback_status.py | 27 +- advancedbilling/models/chargify_ebb.py | 248 +- advancedbilling/models/cleanup_scope.py | 24 +- .../models/clone_component_price_point.py | 116 + .../clone_component_price_point_request.py | 93 + advancedbilling/models/collection_method.py | 33 +- advancedbilling/models/component.py | 1148 ++++++--- .../models/component_allocation_change.py | 295 ++- .../models/component_allocation_error_item.py | 154 +- advancedbilling/models/component_cost_data.py | 254 +- .../models/component_cost_data_rate_tier.py | 186 +- .../models/component_currency_price.py | 208 +- .../component_currency_prices_response.py | 73 +- .../models/component_custom_price.py | 398 ++- advancedbilling/models/component_kind.py | 30 +- advancedbilling/models/component_price.py | 266 +- .../models/component_price_point.py | 790 ++++-- .../component_price_point_assignment.py | 108 +- ...t_price_point_currency_overage_response.py | 93 + .../component_price_point_error_item.py | 127 +- .../models/component_price_point_item.py | 235 +- .../models/component_price_point_response.py | 67 +- .../models/component_price_points_response.py | 114 +- advancedbilling/models/component_response.py | 67 +- .../models/compounding_strategy.py | 32 +- .../models/consolidated_invoice.py | 75 +- advancedbilling/models/contract.py | 182 ++ advancedbilling/models/count_response.py | 73 +- advancedbilling/models/coupon.py | 970 +++++-- advancedbilling/models/coupon_currency.py | 158 +- .../models/coupon_currency_request.py | 73 +- .../models/coupon_currency_response.py | 79 +- advancedbilling/models/coupon_payload.py | 486 ++-- advancedbilling/models/coupon_request.py | 144 +- advancedbilling/models/coupon_response.py | 74 +- advancedbilling/models/coupon_restriction.py | 186 +- advancedbilling/models/coupon_subcodes.py | 73 +- .../models/coupon_subcodes_response.py | 127 +- advancedbilling/models/coupon_usage.py | 252 +- advancedbilling/models/create_allocation.py | 526 +++- .../models/create_allocation_request.py | 70 +- .../models/create_component_price_point.py | 327 ++- .../create_component_price_point_request.py | 80 +- .../create_component_price_points_request.py | 85 +- .../models/create_credit_note_event.py | 230 +- .../models/create_currency_price.py | 127 +- .../models/create_currency_prices_request.py | 73 +- advancedbilling/models/create_customer.py | 537 ++-- .../models/create_customer_request.py | 67 +- .../models/create_debit_note_event.py | 227 +- .../models/create_ebb_component.py | 70 +- advancedbilling/models/create_invoice.py | 347 ++- .../models/create_invoice_address.py | 289 ++- .../models/create_invoice_coupon.py | 264 +- advancedbilling/models/create_invoice_item.py | 421 +++- .../models/create_invoice_payment.py | 237 +- .../create_invoice_payment_application.py | 126 +- .../models/create_invoice_payment_request.py | 98 +- .../models/create_invoice_request.py | 67 +- .../models/create_invoice_status.py | 17 +- advancedbilling/models/create_metadata.py | 100 +- .../models/create_metadata_request.py | 69 +- advancedbilling/models/create_metafield.py | 176 +- .../models/create_metafields_request.py | 84 +- .../models/create_metered_component.py | 67 +- .../models/create_multi_invoice_payment.py | 251 +- .../create_multi_invoice_payment_request.py | 67 +- advancedbilling/models/create_offer.py | 211 +- .../models/create_offer_component.py | 127 +- .../models/create_offer_request.py | 67 +- .../models/create_on_off_component.py | 70 +- .../models/create_or_update_endpoint.py | 84 +- .../create_or_update_endpoint_request.py | 67 +- .../models/create_or_update_product.py | 489 ++-- .../create_or_update_product_request.py | 67 +- .../models/create_or_update_segment_price.py | 138 +- advancedbilling/models/create_payment.py | 118 +- .../models/create_payment_profile.py | 1059 +++++--- .../models/create_payment_profile_request.py | 67 +- .../models/create_prepaid_component.py | 71 +- ...ate_prepaid_usage_component_price_point.py | 395 ++- advancedbilling/models/create_prepayment.py | 149 +- .../models/create_prepayment_method.py | 37 +- .../models/create_prepayment_request.py | 70 +- .../models/create_prepayment_response.py | 70 +- .../models/create_product_currency_price.py | 97 +- .../create_product_currency_prices_request.py | 73 +- .../models/create_product_family.py | 121 +- .../models/create_product_family_request.py | 67 +- .../models/create_product_price_point.py | 443 ++-- .../create_product_price_point_request.py | 67 +- .../models/create_quantity_based_component.py | 71 +- advancedbilling/models/create_reason_code.py | 107 +- .../models/create_reason_code_request.py | 70 +- advancedbilling/models/create_segment.py | 251 +- .../models/create_segment_request.py | 67 +- .../create_signup_proforma_preview_include.py | 15 +- advancedbilling/models/create_subscription.py | 1752 +++++++++---- .../models/create_subscription_component.py | 266 +- .../models/create_subscription_group.py | 90 +- .../create_subscription_group_request.py | 71 +- .../models/create_subscription_request.py | 67 +- advancedbilling/models/create_usage.py | 203 +- .../models/create_usage_request.py | 67 +- advancedbilling/models/created_prepayment.py | 237 +- .../models/credit_account_balance_changed.py | 236 +- .../models/credit_card_attributes.py | 130 +- .../models/credit_card_payment_profile.py | 784 ++++-- advancedbilling/models/credit_card_vault.py | 94 +- advancedbilling/models/credit_note.py | 932 +++++-- .../models/credit_note_application.py | 186 +- .../models/credit_note_line_item.py | 631 +++-- advancedbilling/models/credit_note_status.py | 23 +- advancedbilling/models/credit_scheme.py | 19 +- .../models/credit_scheme_request.py | 63 +- advancedbilling/models/credit_type.py | 30 +- .../models/currency_overage_prices.py | 710 ++++++ advancedbilling/models/currency_price.py | 262 +- advancedbilling/models/currency_price_role.py | 19 +- .../models/currency_prices_response.py | 69 +- advancedbilling/models/custom_field_owner.py | 23 +- .../models/custom_field_value_change.py | 306 ++- advancedbilling/models/customer.py | 992 +++++--- advancedbilling/models/customer_attributes.py | 672 +++-- advancedbilling/models/customer_change.py | 191 +- .../customer_changes_preview_response.py | 67 +- .../models/customer_custom_fields_change.py | 88 +- advancedbilling/models/customer_error.py | 76 +- .../models/customer_payer_change.py | 90 +- advancedbilling/models/customer_response.py | 67 +- advancedbilling/models/debit_note.py | 762 ++++-- advancedbilling/models/debit_note_role.py | 23 +- advancedbilling/models/debit_note_status.py | 27 +- .../models/deduct_service_credit.py | 107 +- .../models/deduct_service_credit_request.py | 67 +- .../models/delayed_cancellation_response.py | 73 +- .../delete_subscription_group_response.py | 100 +- .../deliver_proforma_invoice_request.py | 149 ++ advancedbilling/models/direction.py | 17 +- advancedbilling/models/discount_type.py | 17 +- .../models/downgrade_credit_credit_type.py | 69 + advancedbilling/models/dunner_data.py | 263 +- advancedbilling/models/dunning_step_data.py | 311 ++- .../models/dunning_step_reached.py | 162 +- advancedbilling/models/ebb_component.py | 487 ++-- advancedbilling/models/ebb_event.py | 78 +- .../models/enable_webhooks_request.py | 63 +- .../models/enable_webhooks_response.py | 73 +- advancedbilling/models/endpoint.py | 184 +- advancedbilling/models/endpoint_response.py | 78 +- advancedbilling/models/errors.py | 100 +- advancedbilling/models/event.py | 371 ++- .../event_based_billing_segment_error.py | 72 +- advancedbilling/models/event_key.py | 232 +- advancedbilling/models/event_response.py | 63 +- .../models/expiration_interval_unit.py | 25 +- .../models/failed_payment_action.py | 43 +- .../models/failed_payment_event.py | 231 +- .../models/failed_payment_event_data.py | 222 +- advancedbilling/models/first_charge_type.py | 25 +- .../full_subscription_group_response.py | 511 ++-- .../get_one_time_token_payment_profile.py | 465 ++-- .../models/get_one_time_token_request.py | 71 +- advancedbilling/models/group_billing.py | 153 +- advancedbilling/models/group_settings.py | 126 +- advancedbilling/models/group_target.py | 118 +- advancedbilling/models/group_target_type.py | 29 +- advancedbilling/models/group_type.py | 17 +- advancedbilling/models/historic_usage.py | 141 +- advancedbilling/models/include_not_null.py | 15 +- .../models/include_null_or_not_null.py | 17 +- advancedbilling/models/include_option.py | 23 +- advancedbilling/models/interval_unit.py | 23 +- advancedbilling/models/invoice.py | 1797 +++++++++---- advancedbilling/models/invoice_address.py | 223 +- .../models/invoice_avatax_details.py | 204 +- .../models/invoice_balance_item.py | 130 +- .../models/invoice_consolidation_level.py | 40 +- advancedbilling/models/invoice_credit.py | 240 +- .../models/invoice_custom_field.py | 187 +- advancedbilling/models/invoice_customer.py | 246 +- advancedbilling/models/invoice_date_field.py | 23 +- advancedbilling/models/invoice_debit.py | 267 +- advancedbilling/models/invoice_discount.py | 385 ++- .../models/invoice_discount_breakout.py | 130 +- .../models/invoice_discount_source_type.py | 25 +- .../models/invoice_discount_type.py | 25 +- .../models/invoice_display_settings.py | 103 +- .../models/invoice_event_payment_method.py | 30 +- advancedbilling/models/invoice_event_type.py | 53 +- advancedbilling/models/invoice_issued.py | 598 +++-- advancedbilling/models/invoice_line_item.py | 819 ++++-- .../invoice_line_item_component_cost_data.py | 82 +- .../models/invoice_line_item_event_data.py | 615 +++-- .../invoice_line_item_pricing_detail.py | 103 +- advancedbilling/models/invoice_payer.py | 215 +- .../models/invoice_payer_change.py | 154 +- advancedbilling/models/invoice_payment.py | 397 ++- .../models/invoice_payment_application.py | 135 +- .../models/invoice_payment_method.py | 267 +- .../models/invoice_payment_method_type.py | 32 +- .../models/invoice_payment_type.py | 21 +- advancedbilling/models/invoice_pre_payment.py | 135 +- .../models/invoice_previous_balance.py | 111 +- advancedbilling/models/invoice_refund.py | 302 ++- advancedbilling/models/invoice_response.py | 63 +- advancedbilling/models/invoice_role.py | 41 +- advancedbilling/models/invoice_seller.py | 167 +- advancedbilling/models/invoice_sort_field.py | 29 +- advancedbilling/models/invoice_status.py | 38 +- advancedbilling/models/invoice_tax.py | 445 +++- .../models/invoice_tax_breakout.py | 157 +- .../models/invoice_tax_component_breakout.py | 427 +++- .../models/issue_advance_invoice_request.py | 73 +- advancedbilling/models/issue_invoice_event.py | 231 +- .../models/issue_invoice_event_data.py | 247 +- .../models/issue_invoice_request.py | 100 +- .../models/issue_service_credit.py | 107 +- .../models/issue_service_credit_request.py | 67 +- advancedbilling/models/item_category.py | 27 +- .../models/item_price_point_changed.py | 259 +- .../models/item_price_point_data.py | 130 +- advancedbilling/models/line_item_kind.py | 33 +- .../models/line_item_transaction_type.py | 27 +- .../models/list_components_filter.py | 107 +- .../list_components_price_points_include.py | 15 +- .../list_components_price_points_response.py | 69 +- advancedbilling/models/list_coupons_filter.py | 354 ++- .../models/list_credit_notes_response.py | 72 +- .../models/list_events_date_field.py | 15 +- .../models/list_invoice_events_response.py | 185 +- .../models/list_invoices_response.py | 65 +- .../models/list_metafields_response.py | 190 +- advancedbilling/models/list_mrr_filter.py | 77 +- advancedbilling/models/list_mrr_response.py | 70 +- .../models/list_mrr_response_result.py | 241 +- .../models/list_offers_response.py | 75 +- .../models/list_prepayment_date_field.py | 17 +- .../models/list_prepayments_filter.py | 149 +- .../models/list_price_points_filter.py | 315 ++- .../list_product_price_points_response.py | 69 +- .../models/list_products_filter.py | 152 +- .../models/list_products_include.py | 15 +- .../list_products_price_points_include.py | 15 +- .../models/list_proforma_invoices_meta.py | 154 +- .../models/list_proforma_invoices_response.py | 111 +- .../models/list_public_keys_meta.py | 154 +- .../models/list_public_keys_response.py | 114 +- advancedbilling/models/list_sale_rep_item.py | 190 +- .../models/list_segments_filter.py | 183 +- .../models/list_segments_response.py | 75 +- .../models/list_service_credits_response.py | 79 +- .../list_subcription_group_prepayment_item.py | 294 ++- .../list_subscription_components_filter.py | 110 +- ...subscription_components_for_site_filter.py | 146 +- .../list_subscription_components_include.py | 17 +- .../list_subscription_components_response.py | 73 +- .../list_subscription_components_sort.py | 17 +- .../list_subscription_group_prepayment.py | 71 +- ..._subscription_group_prepayment_response.py | 73 +- .../models/list_subscription_groups_item.py | 354 ++- .../models/list_subscription_groups_meta.py | 100 +- .../list_subscription_groups_response.py | 115 +- advancedbilling/models/metadata.py | 223 +- advancedbilling/models/metafield.py | 240 +- advancedbilling/models/metafield_input.py | 29 +- advancedbilling/models/metafield_scope.py | 270 +- advancedbilling/models/metered_component.py | 554 ++-- advancedbilling/models/metered_usage.py | 259 +- advancedbilling/models/movement.py | 302 ++- advancedbilling/models/movement_line_item.py | 305 ++- advancedbilling/models/mrr.py | 215 +- advancedbilling/models/mrr_movement.py | 154 +- advancedbilling/models/mrr_response.py | 63 +- .../models/multi_invoice_payment.py | 164 +- .../models/multi_invoice_payment_response.py | 70 +- .../models/nested_subscription_group.py | 165 +- advancedbilling/models/net_terms.py | 188 +- advancedbilling/models/offer.py | 593 +++-- advancedbilling/models/offer_discount.py | 127 +- advancedbilling/models/offer_item.py | 336 ++- advancedbilling/models/offer_response.py | 74 +- advancedbilling/models/offer_signup_page.py | 208 +- advancedbilling/models/ok_response.py | 73 +- advancedbilling/models/on_off_component.py | 547 ++-- .../models/organization_address.py | 278 +- advancedbilling/models/origin_invoice.py | 103 +- advancedbilling/models/overage_pricing.py | 119 +- .../models/override_subscription.py | 231 +- .../models/override_subscription_request.py | 67 +- advancedbilling/models/paginated_metadata.py | 187 +- advancedbilling/models/paid_invoice.py | 165 +- advancedbilling/models/pause_request.py | 78 +- advancedbilling/models/pay_pal_vault.py | 27 +- advancedbilling/models/payer_attributes.py | 542 ++-- advancedbilling/models/payer_error.py | 127 +- .../payment_collection_method_changed.py | 119 +- .../models/payment_for_allocation.py | 157 +- .../models/payment_method_apple_pay.py | 82 +- .../models/payment_method_bank_account.py | 152 +- .../models/payment_method_credit_card.py | 208 +- .../models/payment_method_external.py | 199 +- .../models/payment_method_paypal.py | 117 +- .../models/payment_profile_attributes.py | 862 +++++-- .../models/payment_profile_response.py | 87 +- .../models/payment_related_events.py | 119 +- advancedbilling/models/payment_type.py | 28 +- .../models/paypal_payment_profile.py | 630 +++-- .../models/pending_cancellation_change.py | 121 +- .../models/portal_management_link.py | 221 +- .../models/prepaid_configuration.py | 188 +- .../models/prepaid_configuration_response.py | 71 +- .../prepaid_product_price_point_filter.py | 59 +- .../prepaid_subscription_balance_changed.py | 193 +- advancedbilling/models/prepaid_usage.py | 411 ++- .../models/prepaid_usage_allocation_detail.py | 130 +- .../models/prepaid_usage_component.py | 697 ++++-- advancedbilling/models/prepayment.py | 248 +- .../prepayment_account_balance_changed.py | 196 +- advancedbilling/models/prepayment_method.py | 27 +- advancedbilling/models/prepayment_response.py | 67 +- .../models/prepayments_response.py | 82 +- .../models/preview_allocations_request.py | 169 +- advancedbilling/models/price.py | 146 +- advancedbilling/models/price_point_type.py | 33 +- advancedbilling/models/pricing_scheme.py | 31 +- advancedbilling/models/product.py | 1200 ++++++--- advancedbilling/models/product_family.py | 277 +- .../models/product_family_response.py | 81 +- advancedbilling/models/product_price_point.py | 807 ++++-- .../models/product_price_point_errors.py | 208 +- .../models/product_price_point_response.py | 70 +- advancedbilling/models/product_response.py | 63 +- advancedbilling/models/proforma_error.py | 82 +- advancedbilling/models/proforma_invoice.py | 1153 ++++++--- .../models/proforma_invoice_credit.py | 154 +- .../models/proforma_invoice_discount.py | 276 +- .../proforma_invoice_discount_source_type.py | 17 +- .../models/proforma_invoice_issued.py | 450 +++- .../models/proforma_invoice_payment.py | 154 +- .../models/proforma_invoice_role.py | 24 +- .../models/proforma_invoice_status.py | 19 +- .../models/proforma_invoice_tax.py | 245 +- .../proforma_invoice_tax_source_type.py | 23 +- advancedbilling/models/proration.py | 77 +- advancedbilling/models/public_key.py | 129 +- advancedbilling/models/public_signup_page.py | 165 +- .../models/quantity_based_component.py | 649 +++-- .../reactivate_subscription_group_request.py | 100 +- .../reactivate_subscription_group_response.py | 291 ++- .../models/reactivate_subscription_request.py | 250 +- .../models/reactivation_billing.py | 90 +- advancedbilling/models/reactivation_charge.py | 36 +- advancedbilling/models/reason_code.py | 239 +- .../models/reason_code_response.py | 67 +- .../models/record_payment_request.py | 67 +- .../models/record_payment_response.py | 117 +- advancedbilling/models/recurring_scheme.py | 19 +- advancedbilling/models/referral_code.py | 154 +- .../models/referral_validation_response.py | 78 +- .../models/refund_consolidated_invoice.py | 247 +- advancedbilling/models/refund_invoice.py | 251 +- .../models/refund_invoice_event.py | 231 +- .../models/refund_invoice_event_data.py | 372 ++- .../models/refund_invoice_request.py | 84 +- advancedbilling/models/refund_prepayment.py | 197 +- .../refund_prepayment_base_refund_error.py | 78 +- .../models/refund_prepayment_request.py | 67 +- advancedbilling/models/refund_success.py | 154 +- advancedbilling/models/register.py | 173 ++ .../models/remove_payment_event.py | 231 +- .../models/remove_payment_event_data.py | 300 ++- advancedbilling/models/renewal_preview.py | 335 ++- .../models/renewal_preview_component.py | 153 +- .../models/renewal_preview_line_item.py | 424 +++- .../models/renewal_preview_request.py | 90 +- .../models/renewal_preview_response.py | 70 +- .../models/replay_webhooks_request.py | 63 +- .../models/replay_webhooks_response.py | 73 +- advancedbilling/models/resent_invitation.py | 215 +- advancedbilling/models/resource_type.py | 17 +- advancedbilling/models/restriction_type.py | 17 +- advancedbilling/models/resume_options.py | 115 +- advancedbilling/models/resumption_charge.py | 29 +- advancedbilling/models/revoked_invitation.py | 127 +- advancedbilling/models/sale_rep.py | 187 +- advancedbilling/models/sale_rep_item_mrr.py | 127 +- advancedbilling/models/sale_rep_settings.py | 235 +- .../models/sale_rep_subscription.py | 318 ++- ...cheduled_renewal_component_custom_price.py | 177 ++ .../models/scheduled_renewal_configuration.py | 333 +++ .../scheduled_renewal_configuration_item.py | 337 +++ ...uled_renewal_configuration_item_request.py | 126 + ...led_renewal_configuration_item_response.py | 109 + ...scheduled_renewal_configuration_request.py | 93 + ...uled_renewal_configuration_request_body.py | 203 ++ ...cheduled_renewal_configuration_response.py | 108 + ...heduled_renewal_configurations_response.py | 111 + ...led_renewal_item_request_body_component.py | 221 ++ ...duled_renewal_item_request_body_product.py | 221 ++ .../scheduled_renewal_lock_in_request.py | 89 + .../scheduled_renewal_product_price_point.py | 321 +++ .../scheduled_renewal_update_request.py | 126 + advancedbilling/models/segment.py | 402 ++- advancedbilling/models/segment_price.py | 267 +- advancedbilling/models/segment_response.py | 74 +- advancedbilling/models/send_email.py | 100 + .../models/send_invoice_request.py | 151 +- advancedbilling/models/service_credit.py | 181 +- advancedbilling/models/service_credit_1.py | 270 +- .../models/service_credit_response.py | 70 +- advancedbilling/models/service_credit_type.py | 17 +- .../models/signup_proforma_preview.py | 106 +- .../signup_proforma_preview_response.py | 71 +- advancedbilling/models/site.py | 538 ++-- advancedbilling/models/site_response.py | 63 +- advancedbilling/models/site_statistics.py | 343 ++- advancedbilling/models/site_summary.py | 186 +- advancedbilling/models/snap_day.py | 21 +- advancedbilling/models/sorting_direction.py | 17 +- advancedbilling/models/status.py | 58 + advancedbilling/models/subscription.py | 2227 ++++++++++++----- .../models/subscription_component.py | 1001 +++++--- ...ription_component_allocation_error_item.py | 100 +- .../models/subscription_component_response.py | 78 +- .../subscription_component_subscription.py | 234 +- .../models/subscription_custom_price.py | 474 ++-- .../models/subscription_date_field.py | 31 +- advancedbilling/models/subscription_filter.py | 276 +- advancedbilling/models/subscription_group.py | 226 +- .../models/subscription_group_balances.py | 174 +- .../models/subscription_group_bank_account.py | 507 ++-- ...bscription_group_component_custom_price.py | 154 +- .../models/subscription_group_credit_card.py | 611 +++-- .../models/subscription_group_customer.py | 181 +- .../models/subscription_group_include.py | 15 +- .../models/subscription_group_item.py | 322 ++- .../subscription_group_members_array_error.py | 84 +- .../subscription_group_payment_profile.py | 154 +- .../models/subscription_group_prepayment.py | 114 +- .../subscription_group_prepayment_method.py | 25 +- .../subscription_group_prepayment_request.py | 67 +- .../subscription_group_prepayment_response.py | 186 +- .../models/subscription_group_response.py | 67 +- .../models/subscription_group_signup.py | 294 ++- .../subscription_group_signup_component.py | 211 +- .../models/subscription_group_signup_error.py | 224 +- .../subscription_group_signup_event_data.py | 133 +- .../subscription_group_signup_failure_data.py | 298 ++- .../models/subscription_group_signup_item.py | 471 ++-- .../subscription_group_signup_request.py | 71 +- .../subscription_group_signup_response.py | 489 ++-- .../models/subscription_group_single_error.py | 84 +- .../subscription_group_subscription_error.py | 274 +- .../models/subscription_group_update_error.py | 73 +- .../subscription_groups_list_include.py | 15 +- .../models/subscription_include.py | 17 +- .../models/subscription_included_coupon.py | 244 +- .../models/subscription_list_date_field.py | 15 +- .../models/subscription_list_include.py | 15 +- .../models/subscription_migration_preview.py | 173 +- .../subscription_migration_preview_options.py | 382 ++- .../subscription_migration_preview_request.py | 71 +- ...subscription_migration_preview_response.py | 67 +- advancedbilling/models/subscription_mrr.py | 112 +- .../models/subscription_mrr_breakout.py | 80 +- .../models/subscription_mrr_response.py | 69 +- advancedbilling/models/subscription_note.py | 212 +- .../models/subscription_note_response.py | 67 +- .../models/subscription_preview.py | 106 +- .../models/subscription_preview_response.py | 67 +- .../models/subscription_product_change.py | 119 +- .../models/subscription_product_migration.py | 349 ++- .../subscription_product_migration_request.py | 67 +- .../models/subscription_purge_type.py | 17 +- .../models/subscription_response.py | 78 +- advancedbilling/models/subscription_sort.py | 37 +- advancedbilling/models/subscription_state.py | 172 +- .../models/subscription_state_change.py | 119 +- .../models/subscription_state_filter.py | 37 +- advancedbilling/models/tax_configuration.py | 143 +- .../models/tax_configuration_kind.py | 21 +- .../models/tax_destination_address.py | 21 +- .../too_many_management_link_requests.py | 82 +- advancedbilling/models/trial_type.py | 34 +- .../update_allocation_expiration_date.py | 78 +- advancedbilling/models/update_component.py | 318 ++- .../models/update_component_price_point.py | 299 ++- .../update_component_price_point_request.py | 78 +- .../models/update_component_request.py | 70 +- .../models/update_coupon_currency.py | 80 +- .../models/update_currency_price.py | 80 +- .../models/update_currency_prices_request.py | 73 +- advancedbilling/models/update_customer.py | 596 +++-- .../models/update_customer_request.py | 67 +- advancedbilling/models/update_metadata.py | 127 +- .../models/update_metadata_request.py | 78 +- advancedbilling/models/update_metafield.py | 199 +- .../models/update_metafields_request.py | 78 +- .../models/update_payment_profile.py | 456 +++- .../models/update_payment_profile_request.py | 67 +- advancedbilling/models/update_price.py | 198 +- .../models/update_product_price_point.py | 100 +- .../update_product_price_point_request.py | 67 +- advancedbilling/models/update_reason_code.py | 127 +- .../models/update_reason_code_request.py | 70 +- advancedbilling/models/update_segment.py | 104 +- .../models/update_segment_request.py | 67 +- advancedbilling/models/update_subscription.py | 762 ++++-- .../models/update_subscription_component.py | 112 +- .../models/update_subscription_group.py | 73 +- .../update_subscription_group_request.py | 71 +- .../models/update_subscription_note.py | 80 +- .../update_subscription_note_request.py | 67 +- .../models/update_subscription_request.py | 67 +- .../models/upgrade_charge_credit_type.py | 69 + .../models/upsert_prepaid_configuration.py | 161 +- .../upsert_prepaid_configuration_request.py | 71 +- advancedbilling/models/usage.py | 301 ++- advancedbilling/models/usage_response.py | 63 +- advancedbilling/models/void_invoice.py | 63 +- advancedbilling/models/void_invoice_event.py | 230 +- .../models/void_invoice_event_data.py | 294 ++- .../models/void_invoice_request.py | 67 +- .../models/void_remainder_event.py | 231 +- .../models/void_remainder_event_data.py | 200 +- advancedbilling/models/webhook.py | 426 +++- advancedbilling/models/webhook_order.py | 17 +- advancedbilling/models/webhook_response.py | 74 +- advancedbilling/models/webhook_status.py | 21 +- .../models/webhook_subscription.py | 90 +- advancedbilling/utilities/__init__.py | 6 +- advancedbilling/utilities/file_wrapper.py | 40 +- .../utilities/union_type_lookup.py | 1171 +++++---- doc/client.md | 7 +- doc/controllers/advance-invoice.md | 6 +- doc/controllers/component-price-points.md | 135 +- doc/controllers/events.md | 8 +- doc/controllers/invoices.md | 16 +- doc/controllers/payment-profiles.md | 10 +- doc/controllers/product-families.md | 9 +- doc/controllers/proforma-invoices.md | 67 +- doc/controllers/sales-commissions.md | 8 +- doc/controllers/sites.md | 4 +- doc/controllers/subscription-components.md | 135 +- doc/controllers/subscription-groups.md | 9 +- .../subscription-invoice-account.md | 14 +- doc/controllers/subscription-notes.md | 12 +- doc/controllers/subscription-products.md | 4 +- doc/controllers/subscription-renewals.md | 910 +++++++ doc/controllers/subscription-status.md | 39 +- doc/controllers/subscriptions.md | 22 +- doc/models/activate-event-based-component.md | 4 +- doc/models/allocate-components.md | 20 +- doc/models/allocation-preview-item.md | 4 +- doc/models/allocation-settings.md | 4 +- doc/models/allocation.md | 4 +- doc/models/apple-pay-payment-profile.md | 2 +- doc/models/apply-credit-note-event.md | 2 +- doc/models/apply-debit-note-event.md | 2 +- doc/models/apply-payment-event.md | 2 +- doc/models/available-actions.md | 24 + doc/models/backport-invoice-event.md | 2 +- doc/models/bank-account-payment-profile.md | 2 +- doc/models/cancellation-options.md | 12 +- doc/models/cancellation-request.md | 5 +- doc/models/change-chargeback-status-event.md | 2 +- .../change-invoice-collection-method-event.md | 2 +- doc/models/change-invoice-status-event.md | 2 +- .../clone-component-price-point-request.md | 24 + doc/models/clone-component-price-point.md | 23 + doc/models/component-custom-price.md | 6 +- ...t-price-point-currency-overage-response.md | 27 + doc/models/component-price-point.md | 2 +- doc/models/component.md | 4 +- ...lone-component-price-point-component-id.md | 14 + ...ne-component-price-point-price-point-id.md | 14 + ...item-request-renewal-configuration-item.md | 14 + ...ed-renewal-product-price-point-interval.md | 14 + ...ewal-product-price-point-price-in-cents.md | 14 + ...date-request-renewal-configuration-item.md | 14 + doc/models/contract.md | 34 + doc/models/create-allocation-request.md | 8 +- doc/models/create-allocation.md | 22 +- doc/models/create-credit-note-event.md | 2 +- doc/models/create-debit-note-event.md | 2 +- doc/models/create-invoice.md | 2 +- doc/models/create-subscription.md | 2 +- doc/models/create-usage-request.md | 4 +- doc/models/create-usage.md | 4 +- doc/models/credit-card-payment-profile.md | 2 +- doc/models/credit-type.md | 1 - doc/models/currency-overage-prices.md | 50 + .../deliver-proforma-invoice-request.md | 33 + doc/models/downgrade-credit-credit-type.md | 23 + doc/models/failed-payment-event.md | 2 +- doc/models/issue-invoice-event.md | 2 +- doc/models/issue-invoice-request.md | 2 +- doc/models/on-off-component.md | 4 +- doc/models/paypal-payment-profile.md | 2 +- .../prepaid-product-price-point-filter.md | 2 +- doc/models/prepaid-usage-component.md | 4 +- doc/models/preview-allocations-request.md | 12 +- doc/models/product-family.md | 1 + doc/models/proforma-invoice.md | 1 + doc/models/quantity-based-component.md | 4 +- doc/models/reactivate-subscription-request.md | 2 +- doc/models/reactivation-billing.md | 2 +- doc/models/refund-invoice-event.md | 2 +- doc/models/register.md | 27 + doc/models/remove-payment-event.md | 2 +- ...cheduled-renewal-component-custom-price.md | 33 + ...uled-renewal-configuration-item-request.md | 42 + ...led-renewal-configuration-item-response.md | 27 + .../scheduled-renewal-configuration-item.md | 35 + ...uled-renewal-configuration-request-body.md | 29 + ...scheduled-renewal-configuration-request.md | 27 + ...cheduled-renewal-configuration-response.md | 27 + doc/models/scheduled-renewal-configuration.md | 34 + ...heduled-renewal-configurations-response.md | 43 + ...led-renewal-item-request-body-component.md | 44 + ...duled-renewal-item-request-body-product.md | 38 + .../scheduled-renewal-lock-in-request.md | 21 + .../scheduled-renewal-product-price-point.md | 38 + .../scheduled-renewal-update-request.md | 42 + doc/models/send-email.md | 23 + doc/models/send-invoice-request.md | 5 + doc/models/status.md | 18 + doc/models/subscription-component.md | 4 +- doc/models/subscription-custom-price.md | 2 +- ...bscription-group-component-custom-price.md | 4 +- doc/models/subscription-group-response.md | 4 +- .../subscription-group-signup-component.md | 12 +- doc/models/subscription-group-signup-item.md | 2 +- doc/models/subscription-group.md | 5 +- doc/models/subscription-sort.md | 4 + doc/models/subscription.md | 4 +- doc/models/tax-configuration.md | 2 +- doc/models/update-component.md | 2 +- doc/models/update-subscription-component.md | 4 +- doc/models/update-subscription.md | 2 +- doc/models/upgrade-charge-credit-type.md | 23 + doc/models/void-invoice-event.md | 2 +- doc/models/void-remainder-event.md | 2 +- pyproject.toml | 2 +- ruff.toml | 109 + 793 files changed, 93057 insertions(+), 45103 deletions(-) create mode 100644 advancedbilling/controllers/subscription_renewals_controller.py create mode 100644 advancedbilling/models/available_actions.py create mode 100644 advancedbilling/models/clone_component_price_point.py create mode 100644 advancedbilling/models/clone_component_price_point_request.py create mode 100644 advancedbilling/models/component_price_point_currency_overage_response.py create mode 100644 advancedbilling/models/contract.py create mode 100644 advancedbilling/models/currency_overage_prices.py create mode 100644 advancedbilling/models/deliver_proforma_invoice_request.py create mode 100644 advancedbilling/models/downgrade_credit_credit_type.py create mode 100644 advancedbilling/models/register.py create mode 100644 advancedbilling/models/scheduled_renewal_component_custom_price.py create mode 100644 advancedbilling/models/scheduled_renewal_configuration.py create mode 100644 advancedbilling/models/scheduled_renewal_configuration_item.py create mode 100644 advancedbilling/models/scheduled_renewal_configuration_item_request.py create mode 100644 advancedbilling/models/scheduled_renewal_configuration_item_response.py create mode 100644 advancedbilling/models/scheduled_renewal_configuration_request.py create mode 100644 advancedbilling/models/scheduled_renewal_configuration_request_body.py create mode 100644 advancedbilling/models/scheduled_renewal_configuration_response.py create mode 100644 advancedbilling/models/scheduled_renewal_configurations_response.py create mode 100644 advancedbilling/models/scheduled_renewal_item_request_body_component.py create mode 100644 advancedbilling/models/scheduled_renewal_item_request_body_product.py create mode 100644 advancedbilling/models/scheduled_renewal_lock_in_request.py create mode 100644 advancedbilling/models/scheduled_renewal_product_price_point.py create mode 100644 advancedbilling/models/scheduled_renewal_update_request.py create mode 100644 advancedbilling/models/send_email.py create mode 100644 advancedbilling/models/status.py create mode 100644 advancedbilling/models/upgrade_charge_credit_type.py create mode 100644 doc/controllers/subscription-renewals.md create mode 100644 doc/models/available-actions.md create mode 100644 doc/models/clone-component-price-point-request.md create mode 100644 doc/models/clone-component-price-point.md create mode 100644 doc/models/component-price-point-currency-overage-response.md create mode 100644 doc/models/containers/clone-component-price-point-component-id.md create mode 100644 doc/models/containers/clone-component-price-point-price-point-id.md create mode 100644 doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md create mode 100644 doc/models/containers/scheduled-renewal-product-price-point-interval.md create mode 100644 doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md create mode 100644 doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md create mode 100644 doc/models/contract.md create mode 100644 doc/models/currency-overage-prices.md create mode 100644 doc/models/deliver-proforma-invoice-request.md create mode 100644 doc/models/downgrade-credit-credit-type.md create mode 100644 doc/models/register.md create mode 100644 doc/models/scheduled-renewal-component-custom-price.md create mode 100644 doc/models/scheduled-renewal-configuration-item-request.md create mode 100644 doc/models/scheduled-renewal-configuration-item-response.md create mode 100644 doc/models/scheduled-renewal-configuration-item.md create mode 100644 doc/models/scheduled-renewal-configuration-request-body.md create mode 100644 doc/models/scheduled-renewal-configuration-request.md create mode 100644 doc/models/scheduled-renewal-configuration-response.md create mode 100644 doc/models/scheduled-renewal-configuration.md create mode 100644 doc/models/scheduled-renewal-configurations-response.md create mode 100644 doc/models/scheduled-renewal-item-request-body-component.md create mode 100644 doc/models/scheduled-renewal-item-request-body-product.md create mode 100644 doc/models/scheduled-renewal-lock-in-request.md create mode 100644 doc/models/scheduled-renewal-product-price-point.md create mode 100644 doc/models/scheduled-renewal-update-request.md create mode 100644 doc/models/send-email.md create mode 100644 doc/models/status.md create mode 100644 doc/models/upgrade-charge-credit-type.md create mode 100644 ruff.toml diff --git a/LICENSE b/LICENSE index b85cedd2..4771c25c 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ License: The MIT License (MIT) http://opensource.org/licenses/MIT -Copyright (c) 2014 - 2025 APIMATIC Limited +Copyright (c) 2014 - 2026 APIMATIC Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2cd26e6a..229b4721 100644 --- a/README.md +++ b/README.md @@ -30,22 +30,22 @@ The package is compatible with Python versions `3.7+`. Install the package from PyPi using the following pip command: ```bash -pip install maxio-advanced-billing-sdk==8.0.0 +pip install maxio-advanced-billing-sdk==9.0.0 ``` You can also view the package at: -https://pypi.python.org/pypi/maxio-advanced-billing-sdk/8.0.0 +https://pypi.python.org/pypi/maxio-advanced-billing-sdk/9.0.0 ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| site | `str` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| environment | `Environment` | The API environment.
**Default: `Environment.US`** | +| site | `str` | The subdomain for your Advanced Billing site.
*Default*: `"subdomain"` | +| environment | [`Environment`](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | | http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests | | override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user | | http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint | @@ -53,9 +53,9 @@ The following parameters are configurable for the API Client: | max_retries | `int` | The number of times to retry an endpoint call if it fails.
**Default: 0** | | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**Default: 2** | | retry_statuses | `Array of int` | The http statuses on which retry is to be done.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | -| retry_methods | `Array of string` | The http methods on which retry is to be done.
**Default: ['GET', 'PUT']** | -| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | -| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | +| retry_methods | `Array of string` | The http methods on which retry is to be done.
**Default: ["GET", "PUT"]** | +| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -85,7 +85,7 @@ from advancedbilling.advanced_billing_client import AdvancedBillingClient client = AdvancedBillingClient.from_environment(dotenv_path='/path/to/.env') ``` -See the [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/environment-based-client-initialization.md) section for details. +See the [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -102,59 +102,60 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-products.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-products.md) +* [Subscription Renewals](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-renewals.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [ProxySettings](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/proxy-settings.md) -* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/environment-based-client-initialization.md) +* [ProxySettings](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/proxy-settings.md) +* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/environment-based-client-initialization.md) ### HTTP -* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/http-request.md) ### Utilities -* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/api-helper.md) -* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/http-date-time.md) -* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/rfc3339-date-time.md) -* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/8.0.0/doc/unix-date-time.md) +* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/api-helper.md) +* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/http-date-time.md) +* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/rfc3339-date-time.md) +* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/9.0.0/doc/unix-date-time.md) diff --git a/advancedbilling/__init__.py b/advancedbilling/__init__.py index 195fc7af..aec38da6 100644 --- a/advancedbilling/__init__.py +++ b/advancedbilling/__init__.py @@ -1,10 +1,12 @@ +# ruff: noqa: D104 | Missing docstring in public package +# ruff: noqa: RUF022 | `__all__` is not sorted __all__ = [ - 'advanced_billing_client', - 'api_helper', - 'configuration', - 'controllers', - 'exceptions', - 'http', - 'models', - 'utilities', + "advanced_billing_client", + "api_helper", + "configuration", + "controllers", + "exceptions", + "http", + "models", + "utilities", ] diff --git a/advancedbilling/advanced_billing_client.py b/advancedbilling/advanced_billing_client.py index fa32b03f..13fbbf55 100644 --- a/advancedbilling/advanced_billing_client.py +++ b/advancedbilling/advanced_billing_client.py @@ -1,211 +1,305 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from apimatic_core.configurations.global_configuration import GlobalConfiguration -from apimatic_core.decorators.lazy_property import LazyProperty -from advancedbilling.configuration import Configuration -from advancedbilling.controllers.base_controller import BaseController -from advancedbilling.configuration import Environment -from advancedbilling.http.auth.basic_auth import BasicAuth -from advancedbilling.controllers.api_exports_controller\ - import APIExportsController -from advancedbilling.controllers.advance_invoice_controller\ - import AdvanceInvoiceController -from advancedbilling.controllers.billing_portal_controller\ - import BillingPortalController -from advancedbilling.controllers.coupons_controller import CouponsController -from advancedbilling.controllers.components_controller\ - import ComponentsController -from advancedbilling.controllers.component_price_points_controller\ - import ComponentPricePointsController -from advancedbilling.controllers.customers_controller\ - import CustomersController -from advancedbilling.controllers.custom_fields_controller\ - import CustomFieldsController -from advancedbilling.controllers.events_controller import EventsController -from advancedbilling.controllers.events_based_billing_segments_controller\ - import EventsBasedBillingSegmentsController -from advancedbilling.controllers.insights_controller import InsightsController -from advancedbilling.controllers.invoices_controller import InvoicesController -from advancedbilling.controllers.offers_controller import OffersController -from advancedbilling.controllers.payment_profiles_controller\ - import PaymentProfilesController -from advancedbilling.controllers.product_families_controller\ - import ProductFamiliesController -from advancedbilling.controllers.products_controller import ProductsController -from advancedbilling.controllers.product_price_points_controller\ - import ProductPricePointsController -from advancedbilling.controllers.proforma_invoices_controller\ - import ProformaInvoicesController -from advancedbilling.controllers.reason_codes_controller\ - import ReasonCodesController -from advancedbilling.controllers.referral_codes_controller\ - import ReferralCodesController -from advancedbilling.controllers.sales_commissions_controller\ - import SalesCommissionsController -from advancedbilling.controllers.sites_controller import SitesController -from advancedbilling.controllers.subscriptions_controller\ - import SubscriptionsController -from advancedbilling.controllers.subscription_components_controller\ - import SubscriptionComponentsController -from advancedbilling.controllers.subscription_groups_controller\ - import SubscriptionGroupsController -from advancedbilling.controllers.subscription_group_invoice_account_controller\ - import SubscriptionGroupInvoiceAccountController -from advancedbilling.controllers.subscription_group_status_controller\ - import SubscriptionGroupStatusController -from advancedbilling.controllers.subscription_invoice_account_controller\ - import SubscriptionInvoiceAccountController -from advancedbilling.controllers.subscription_notes_controller\ - import SubscriptionNotesController -from advancedbilling.controllers.subscription_products_controller\ - import SubscriptionProductsController -from advancedbilling.controllers.subscription_status_controller\ - import SubscriptionStatusController -from advancedbilling.controllers.webhooks_controller import WebhooksController +# ruff: noqa: E501 +from apimatic_core.configurations.global_configuration import ( + GlobalConfiguration, +) +from apimatic_core.decorators.lazy_property import ( + LazyProperty, +) + +from advancedbilling.configuration import ( + Configuration, + Environment, +) +from advancedbilling.controllers.advance_invoice_controller import ( + AdvanceInvoiceController, +) +from advancedbilling.controllers.api_exports_controller import ( + APIExportsController, +) +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.controllers.billing_portal_controller import ( + BillingPortalController, +) +from advancedbilling.controllers.component_price_points_controller import ( + ComponentPricePointsController, +) +from advancedbilling.controllers.components_controller import ( + ComponentsController, +) +from advancedbilling.controllers.coupons_controller import ( + CouponsController, +) +from advancedbilling.controllers.custom_fields_controller import ( + CustomFieldsController, +) +from advancedbilling.controllers.customers_controller import ( + CustomersController, +) +from advancedbilling.controllers.events_based_billing_segments_controller import ( + EventsBasedBillingSegmentsController, +) +from advancedbilling.controllers.events_controller import ( + EventsController, +) +from advancedbilling.controllers.insights_controller import ( + InsightsController, +) +from advancedbilling.controllers.invoices_controller import ( + InvoicesController, +) +from advancedbilling.controllers.offers_controller import ( + OffersController, +) +from advancedbilling.controllers.payment_profiles_controller import ( + PaymentProfilesController, +) +from advancedbilling.controllers.product_families_controller import ( + ProductFamiliesController, +) +from advancedbilling.controllers.product_price_points_controller import ( + ProductPricePointsController, +) +from advancedbilling.controllers.products_controller import ( + ProductsController, +) +from advancedbilling.controllers.proforma_invoices_controller import ( + ProformaInvoicesController, +) +from advancedbilling.controllers.reason_codes_controller import ( + ReasonCodesController, +) +from advancedbilling.controllers.referral_codes_controller import ( + ReferralCodesController, +) +from advancedbilling.controllers.sales_commissions_controller import ( + SalesCommissionsController, +) +from advancedbilling.controllers.sites_controller import ( + SitesController, +) +from advancedbilling.controllers.subscription_components_controller import ( + SubscriptionComponentsController, +) +from advancedbilling.controllers.subscription_group_invoice_account_controller import ( + SubscriptionGroupInvoiceAccountController, +) +from advancedbilling.controllers.subscription_group_status_controller import ( + SubscriptionGroupStatusController, +) +from advancedbilling.controllers.subscription_groups_controller import ( + SubscriptionGroupsController, +) +from advancedbilling.controllers.subscription_invoice_account_controller import ( + SubscriptionInvoiceAccountController, +) +from advancedbilling.controllers.subscription_notes_controller import ( + SubscriptionNotesController, +) +from advancedbilling.controllers.subscription_products_controller import ( + SubscriptionProductsController, +) +from advancedbilling.controllers.subscription_renewals_controller import ( + SubscriptionRenewalsController, +) +from advancedbilling.controllers.subscription_status_controller import ( + SubscriptionStatusController, +) +from advancedbilling.controllers.subscriptions_controller import ( + SubscriptionsController, +) +from advancedbilling.controllers.webhooks_controller import ( + WebhooksController, +) +from advancedbilling.http.auth.basic_auth import ( + BasicAuth, +) class AdvancedBillingClient(object): + """Client that provide access to the AdvancedBillingClient APIs.""" + @LazyProperty def api_exports(self): + """Provide access to the APIExportsController endpoints.""" return APIExportsController(self.global_configuration) @LazyProperty def advance_invoice(self): + """Provide access to the AdvanceInvoiceController endpoints.""" return AdvanceInvoiceController(self.global_configuration) @LazyProperty def billing_portal(self): + """Provide access to the BillingPortalController endpoints.""" return BillingPortalController(self.global_configuration) @LazyProperty def coupons(self): + """Provide access to the CouponsController endpoints.""" return CouponsController(self.global_configuration) @LazyProperty def components(self): + """Provide access to the ComponentsController endpoints.""" return ComponentsController(self.global_configuration) @LazyProperty def component_price_points(self): + """Provide access to the ComponentPricePointsController endpoints.""" return ComponentPricePointsController(self.global_configuration) @LazyProperty def customers(self): + """Provide access to the CustomersController endpoints.""" return CustomersController(self.global_configuration) @LazyProperty def custom_fields(self): + """Provide access to the CustomFieldsController endpoints.""" return CustomFieldsController(self.global_configuration) @LazyProperty def events(self): + """Provide access to the EventsController endpoints.""" return EventsController(self.global_configuration) @LazyProperty def events_based_billing_segments(self): + """Provide access to the EventsBasedBillingSegmentsController endpoints.""" return EventsBasedBillingSegmentsController(self.global_configuration) @LazyProperty def insights(self): + """Provide access to the InsightsController endpoints.""" return InsightsController(self.global_configuration) @LazyProperty def invoices(self): + """Provide access to the InvoicesController endpoints.""" return InvoicesController(self.global_configuration) @LazyProperty def offers(self): + """Provide access to the OffersController endpoints.""" return OffersController(self.global_configuration) @LazyProperty def payment_profiles(self): + """Provide access to the PaymentProfilesController endpoints.""" return PaymentProfilesController(self.global_configuration) @LazyProperty def product_families(self): + """Provide access to the ProductFamiliesController endpoints.""" return ProductFamiliesController(self.global_configuration) @LazyProperty def products(self): + """Provide access to the ProductsController endpoints.""" return ProductsController(self.global_configuration) @LazyProperty def product_price_points(self): + """Provide access to the ProductPricePointsController endpoints.""" return ProductPricePointsController(self.global_configuration) @LazyProperty def proforma_invoices(self): + """Provide access to the ProformaInvoicesController endpoints.""" return ProformaInvoicesController(self.global_configuration) @LazyProperty def reason_codes(self): + """Provide access to the ReasonCodesController endpoints.""" return ReasonCodesController(self.global_configuration) @LazyProperty def referral_codes(self): + """Provide access to the ReferralCodesController endpoints.""" return ReferralCodesController(self.global_configuration) @LazyProperty def sales_commissions(self): + """Provide access to the SalesCommissionsController endpoints.""" return SalesCommissionsController(self.global_configuration) @LazyProperty def sites(self): + """Provide access to the SitesController endpoints.""" return SitesController(self.global_configuration) @LazyProperty def subscriptions(self): + """Provide access to the SubscriptionsController endpoints.""" return SubscriptionsController(self.global_configuration) @LazyProperty def subscription_components(self): + """Provide access to the SubscriptionComponentsController endpoints.""" return SubscriptionComponentsController(self.global_configuration) @LazyProperty def subscription_groups(self): + """Provide access to the SubscriptionGroupsController endpoints.""" return SubscriptionGroupsController(self.global_configuration) @LazyProperty def subscription_group_invoice_account(self): + """Provide access to the + SubscriptionGroupInvoiceAccountController endpoints. + """ return SubscriptionGroupInvoiceAccountController(self.global_configuration) @LazyProperty def subscription_group_status(self): + """Provide access to the SubscriptionGroupStatusController endpoints.""" return SubscriptionGroupStatusController(self.global_configuration) @LazyProperty def subscription_invoice_account(self): + """Provide access to the SubscriptionInvoiceAccountController endpoints.""" return SubscriptionInvoiceAccountController(self.global_configuration) @LazyProperty def subscription_notes(self): + """Provide access to the SubscriptionNotesController endpoints.""" return SubscriptionNotesController(self.global_configuration) @LazyProperty def subscription_products(self): + """Provide access to the SubscriptionProductsController endpoints.""" return SubscriptionProductsController(self.global_configuration) + @LazyProperty + def subscription_renewals(self): + """Provide access to the SubscriptionRenewalsController endpoints.""" + return SubscriptionRenewalsController(self.global_configuration) + @LazyProperty def subscription_status(self): + """Provide access to the SubscriptionStatusController endpoints.""" return SubscriptionStatusController(self.global_configuration) @LazyProperty def webhooks(self): + """Provide access to the WebhooksController endpoints.""" return WebhooksController(self.global_configuration) def __init__(self, http_client_instance=None, override_http_client_configuration=False, http_call_back=None, timeout=120, max_retries=0, backoff_factor=2, retry_statuses=None, retry_methods=None, proxy_settings=None, - environment=Environment.US, site='subdomain', + environment=Environment.US, site="subdomain", basic_auth_credentials=None, config=None): + """Initialize a new instance of AdvancedBillingClient.""" self.config = config or Configuration( http_client_instance=http_client_instance, override_http_client_configuration=override_http_client_configuration, @@ -218,13 +312,22 @@ def __init__(self, http_client_instance=None, self.global_configuration = GlobalConfiguration(self.config)\ .global_errors(BaseController.global_errors())\ .base_uri_executor(self.config.get_base_uri)\ - .user_agent(BaseController.user_agent(), BaseController.user_agent_parameters()) + .user_agent(BaseController.user_agent(), + BaseController.user_agent_parameters()) self.auth_managers = { - 'BasicAuth': BasicAuth(self.config.basic_auth_credentials) + "BasicAuth": BasicAuth(self.config.basic_auth_credentials), } - self.global_configuration = self.global_configuration.auth_managers(self.auth_managers) + self.global_configuration =\ + self.global_configuration.auth_managers(self.auth_managers) @classmethod def from_environment(cls, dotenv_path=None, **overrides): - return cls(config=Configuration.from_environment(dotenv_path=dotenv_path, **overrides)) + """Create a client instance using environment variables. + + Returns: + AdvancedBillingClient instance. + + """ + return cls(config=Configuration + .from_environment(dotenv_path=dotenv_path, **overrides)) diff --git a/advancedbilling/api_helper.py b/advancedbilling/api_helper.py index 969ce519..f225978c 100644 --- a/advancedbilling/api_helper.py +++ b/advancedbilling/api_helper.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """ advanced_billing @@ -7,16 +5,15 @@ https://www.apimatic.io ). """ -from apimatic_core.utilities.api_helper import ApiHelper - +from apimatic_core.utilities.api_helper import ApiHelper as CoreApiHelper -class APIHelper(ApiHelper): - """A Helper Class for various functions associated with API Calls. +class APIHelper(CoreApiHelper): + """ + A Helper Class for various functions associated with API Calls. This class contains static methods for operations that need to be performed during API requests. All of the methods inside this class are static methods, there is no need to ever initialise an instance of this class. - - """ \ No newline at end of file + """ diff --git a/advancedbilling/configuration.py b/advancedbilling/configuration.py index 841307b9..ea7ff2ab 100644 --- a/advancedbilling/configuration.py +++ b/advancedbilling/configuration.py @@ -1,32 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 import os -from dotenv import load_dotenv -from advancedbilling.http.proxy_settings import ProxySettings from enum import Enum + +from apimatic_core.http.configurations.http_client_configuration import ( + HttpClientConfiguration, +) +from apimatic_requests_client_adapter.requests_client import ( + RequestsClient, +) +from dotenv import load_dotenv + from advancedbilling.api_helper import APIHelper -from apimatic_core.http.configurations.http_client_configuration import HttpClientConfiguration -from apimatic_requests_client_adapter.requests_client import RequestsClient +from advancedbilling.http.proxy_settings import ( + ProxySettings, +) class Environment(Enum): - """An enum for SDK environments""" - # Default Advanced Billing environment hosted in US. Valid for the majority of our customers. + """An enum for SDK environments.""" + + # Default Advanced Billing environment hosted in US. Valid for the majority + # of our customers. US = 0 - # Advanced Billing environment hosted in EU. Use only when you requested EU hosting for your AB account. + # Advanced Billing environment hosted in EU. Use only when you requested EU + # hosting for your AB account. EU = 1 @classmethod def from_value(cls, value, default=None): - """ - Convert a value (string or int) to an Environment enum member. + """Convert a value (string or int) to an Environment enum member. Args: value (Union[str, int]): The value to convert. @@ -34,6 +42,7 @@ def from_value(cls, value, default=None): Returns: Environment: Matching enum member or fallback if invalid. + """ if value is None: return default @@ -44,7 +53,8 @@ def from_value(cls, value, default=None): # Handle integer or string conversion for member in cls: - if str(member.value).lower() == str(value).lower() or member.name.lower() == str(value).lower(): + if (str(member.value).lower() == str(value).lower() + or member.name.lower() == str(value).lower()): return member # Fallback to provided default @@ -52,14 +62,14 @@ def from_value(cls, value, default=None): class Server(Enum): - """An enum for API servers""" + """An enum for API servers.""" + PRODUCTION = 0 EBB = 1 @classmethod def from_value(cls, value, default=None): - """ - Convert a value (string or int) to an Server enum member. + """Convert a value (string or int) to a Server enum member. Args: value (Union[str, int]): The value to convert. @@ -67,6 +77,7 @@ def from_value(cls, value, default=None): Returns: Server: Matching enum member or fallback if invalid. + """ if value is None: return default @@ -77,7 +88,8 @@ def from_value(cls, value, default=None): # Handle integer or string conversion for member in cls: - if str(member.value).lower() == str(value).lower() or member.name.lower() == str(value).lower(): + if (str(member.value).lower() == str(value).lower() + or member.name.lower() == str(value).lower()): return member # Fallback to provided default @@ -85,32 +97,35 @@ def from_value(cls, value, default=None): class Configuration(HttpClientConfiguration): - """A class used for configuring the SDK by a user. - """ + """A class used for configuring the SDK by a user.""" @property def environment(self): + """Return current environment.""" return self._environment @property def site(self): + """Return current site.""" return self._site @property def basic_auth_credentials(self): + """Return BasicAuthCredentials.""" return self._basic_auth_credentials def __init__(self, http_client_instance=None, override_http_client_configuration=False, http_call_back=None, - timeout=120, max_retries=0, backoff_factor=2, - retry_statuses=None, retry_methods=None, proxy_settings=None, - environment=Environment.US, site='subdomain', - basic_auth_credentials=None): + timeout=120, max_retries=0, backoff_factor=2, retry_statuses=None, + retry_methods=None, proxy_settings=None, environment=Environment.US, + site="subdomain", basic_auth_credentials=None): + """Initialize Configuration object.""" if retry_methods is None: - retry_methods = ['GET', 'PUT'] + retry_methods = ["GET", "PUT"] if retry_statuses is None: - retry_statuses = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524] + retry_statuses = [408, 413, 429, 500, 502, 503, 504, 521, + 522, 524] super().__init__( http_client_instance=http_client_instance, @@ -118,7 +133,7 @@ def __init__(self, http_client_instance=None, http_call_back=http_call_back, timeout=timeout, max_retries=max_retries, backoff_factor=backoff_factor, retry_statuses=retry_statuses, retry_methods=retry_methods, - proxy_settings=proxy_settings + proxy_settings=proxy_settings, ) # Current API environment @@ -137,8 +152,11 @@ def clone_with(self, http_client_instance=None, timeout=None, max_retries=None, backoff_factor=None, retry_statuses=None, retry_methods=None, proxy_settings=None, environment=None, site=None, basic_auth_credentials=None): + """Clone configuration with overrides.""" http_client_instance = http_client_instance or self.http_client_instance - override_http_client_configuration = override_http_client_configuration or self.override_http_client_configuration + override_http_client_configuration =\ + (override_http_client_configuration + or self.override_http_client_configuration) http_call_back = http_call_back or self.http_callback timeout = timeout or self.timeout max_retries = max_retries or self.max_retries @@ -152,14 +170,15 @@ def clone_with(self, http_client_instance=None, return Configuration( http_client_instance=http_client_instance, override_http_client_configuration=override_http_client_configuration, - http_call_back=http_call_back, timeout=timeout, - max_retries=max_retries, backoff_factor=backoff_factor, - retry_statuses=retry_statuses, retry_methods=retry_methods, - proxy_settings=proxy_settings, environment=environment, site=site, - basic_auth_credentials=basic_auth_credentials + http_call_back=http_call_back, timeout=timeout, max_retries=max_retries, + backoff_factor=backoff_factor, retry_statuses=retry_statuses, + retry_methods=retry_methods, proxy_settings=proxy_settings, + environment=environment, site=site, + basic_auth_credentials=basic_auth_credentials, ) def create_http_client(self): + """Create the HTTP client instance.""" return RequestsClient( timeout=self.timeout, max_retries=self.max_retries, backoff_factor=self.backoff_factor, retry_statuses=self.retry_statuses, @@ -167,24 +186,23 @@ def create_http_client(self): http_client_instance=self.http_client_instance, override_http_client_configuration=self.override_http_client_configuration, response_factory=self.http_response_factory, - proxies=self.proxy_settings.to_proxies() if self.proxy_settings else None + proxies=self.proxy_settings.to_proxies() if self.proxy_settings else None, ) # All the environments the SDK can run in environments = { Environment.US: { - Server.PRODUCTION: 'https://{site}.chargify.com', - Server.EBB: 'https://events.chargify.com/{site}' + Server.PRODUCTION: "https://{site}.chargify.com", + Server.EBB: "https://events.chargify.com/{site}", }, Environment.EU: { - Server.PRODUCTION: 'https://{site}.ebilling.maxio.com', - Server.EBB: 'https://events.chargify.com/{site}' - } + Server.PRODUCTION: "https://{site}.ebilling.maxio.com", + Server.EBB: "https://events.chargify.com/{site}", + }, } def get_base_uri(self, server=Server.PRODUCTION): - """Generates the appropriate base URI for the environment and the - server. + """Generate the appropriate base URI for the environment and the server. Args: server (Configuration.Server): The server enum for which the base @@ -195,41 +213,48 @@ def get_base_uri(self, server=Server.PRODUCTION): """ parameters = { - "site": {'value': self.site, 'encode': False}, + "site": {"value": self.site, "encode": False}, } return APIHelper.append_url_with_template_parameters( - self.environments[self.environment][server], parameters + self.environments[self.environment][server], parameters, ) @classmethod def from_environment(cls, dotenv_path=None, **overrides): - """ - Creates a Configuration object using values from a .env file, environment variables, and optional overrides. + """Create Configuration object from .env and environment variables. Args: - dotenv_path (str, optional): Path to the .env file to load. If None, the default .env file is used. - **overrides: Additional configuration values to override those loaded from the .env file and environment variables. + dotenv_path (str, optional): Path to the .env file to load. + If None, the default .env file is used. + **overrides: Optional values overriding setting from environment variables. Returns: Configuration: A configuration object populated with the resolved values. - """ + """ # load .env automatically load_dotenv(dotenv_path or None, override=True) - override_http_client_configuration = os.getenv('OVERRIDE_HTTP_CLIENT_CONFIGURATION', 'false').lower() == 'true' - timeout = int(os.getenv('TIMEOUT', '120')) - max_retries = int(os.getenv('MAX_RETRIES', '0')) - backoff_factor = float(os.getenv('BACKOFF_FACTOR', '2')) - statuses = os.getenv('RETRY_STATUSES', None) - retry_statuses = [int(v.strip()) for v in statuses.split(',') if v.strip().isdigit()] if statuses else None - methods = os.getenv('RETRY_METHODS', None) - retry_methods = [v.strip() for v in methods.split(',') if v.strip()] if methods else None - environment = Environment.from_value(os.getenv('ENVIRONMENT'), Environment.US) - site = os.getenv('SITE', 'subdomain') - - from advancedbilling.http.auth.basic_auth import BasicAuthCredentials + override_http_client_configuration = os.getenv( + "OVERRIDE_HTTP_CLIENT_CONFIGURATION", "false").lower() == "true" + timeout = int(os.getenv("TIMEOUT", "120")) + max_retries = int(os.getenv("MAX_RETRIES", "0")) + backoff_factor = float(os.getenv("BACKOFF_FACTOR", "2")) + statuses = os.getenv("RETRY_STATUSES", None) + retry_statuses = [int(v.strip()) for v in statuses.split(",") + if v.strip().isdigit()] if statuses else None + methods = os.getenv("RETRY_METHODS", None) + retry_methods = [v.strip() for v in methods.split(",") if v.strip()]\ + if methods else None + environment = Environment.from_value( + os.getenv("ENVIRONMENT"), Environment.US) + site = os.getenv("SITE", "subdomain") + + from advancedbilling.http.auth.basic_auth import ( + BasicAuthCredentials, + ) + # Preparing default configuration default_config = cls( override_http_client_configuration=override_http_client_configuration, @@ -241,7 +266,7 @@ def from_environment(cls, dotenv_path=None, **overrides): environment=environment, site=site, proxy_settings=ProxySettings.from_environment(), - basic_auth_credentials=BasicAuthCredentials.from_environment() + basic_auth_credentials=BasicAuthCredentials.from_environment(), ) - return default_config.clone_with(**overrides) \ No newline at end of file + return default_config.clone_with(**overrides) diff --git a/advancedbilling/controllers/__init__.py b/advancedbilling/controllers/__init__.py index c33830e5..d1a53071 100644 --- a/advancedbilling/controllers/__init__.py +++ b/advancedbilling/controllers/__init__.py @@ -1,35 +1,38 @@ +# ruff: noqa: D104 | Missing docstring in public package +# ruff: noqa: RUF022 | `__all__` is not sorted __all__ = [ - 'base_controller', - 'api_exports_controller', - 'advance_invoice_controller', - 'billing_portal_controller', - 'coupons_controller', - 'components_controller', - 'component_price_points_controller', - 'customers_controller', - 'custom_fields_controller', - 'events_controller', - 'events_based_billing_segments_controller', - 'insights_controller', - 'invoices_controller', - 'offers_controller', - 'payment_profiles_controller', - 'product_families_controller', - 'products_controller', - 'product_price_points_controller', - 'proforma_invoices_controller', - 'reason_codes_controller', - 'referral_codes_controller', - 'sales_commissions_controller', - 'sites_controller', - 'subscriptions_controller', - 'subscription_components_controller', - 'subscription_groups_controller', - 'subscription_group_invoice_account_controller', - 'subscription_group_status_controller', - 'subscription_invoice_account_controller', - 'subscription_notes_controller', - 'subscription_products_controller', - 'subscription_status_controller', - 'webhooks_controller', + "advance_invoice_controller", + "api_exports_controller", + "base_controller", + "billing_portal_controller", + "component_price_points_controller", + "components_controller", + "coupons_controller", + "custom_fields_controller", + "customers_controller", + "events_based_billing_segments_controller", + "events_controller", + "insights_controller", + "invoices_controller", + "offers_controller", + "payment_profiles_controller", + "product_families_controller", + "product_price_points_controller", + "products_controller", + "proforma_invoices_controller", + "reason_codes_controller", + "referral_codes_controller", + "sales_commissions_controller", + "sites_controller", + "subscription_components_controller", + "subscription_group_invoice_account_controller", + "subscription_group_status_controller", + "subscription_groups_controller", + "subscription_invoice_account_controller", + "subscription_notes_controller", + "subscription_products_controller", + "subscription_renewals_controller", + "subscription_status_controller", + "subscriptions_controller", + "webhooks_controller", ] diff --git a/advancedbilling/controllers/advance_invoice_controller.py b/advancedbilling/controllers/advance_invoice_controller.py index d41c9353..3fa6a593 100644 --- a/advancedbilling/controllers/advance_invoice_controller.py +++ b/advancedbilling/controllers/advance_invoice_controller.py @@ -1,188 +1,195 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException class AdvanceInvoiceController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize AdvanceInvoiceController object.""" super(AdvanceInvoiceController, self).__init__(config) def issue_advance_invoice(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/advance_invoice/issue.json. - - Generate an invoice in advance for a subscription's next renewal date. - [See our - docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue- - Invoice-In-Advance) for more information on advance invoices, - including eligibility on generating one; for the most part, they - function like any other invoice, except they are issued early and have - special behavior upon being voided. + """Perform a POST request to + /subscriptions/{subscription_id}/advance_invoice/issue.json. + + Generate an invoice in advance for a subscription's next renewal date. [See + our + docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice + -In-Advance) for more information on advance invoices, including eligibility + on generating one; for the most part, they function like any other invoice, + except they are issued early and have special behavior upon being voided. A subscription may only have one advance invoice per billing period. - Attempting to issue an advance invoice when one already exists will - return an error. - That said, regeneration of the invoice may be forced with the params - `force: true`, which will void an advance invoice if one exists and - generate a new one. If no advance invoice exists, a new one will be - generated. + Attempting to issue an advance invoice when one already exists will return an + error. + That said, regeneration of the invoice may be forced with the params `force: + true`, which will void an advance invoice if one exists and generate a new + one. If no advance invoice exists, a new one will be generated. We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. Args: - subscription_id (int): The Chargify id of the subscription - body (IssueAdvanceInvoiceRequest, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (IssueAdvanceInvoiceRequest, optional): The request body parameter. Returns: Invoice: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/advance_invoice/issue.json') + .path("/subscriptions/{subscription_id}/advance_invoice/issue.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_advance_invoice(self, subscription_id): - """Does a GET request to /subscriptions/{subscription_id}/advance_invoice.json. + """Perform a GET request to + /subscriptions/{subscription_id}/advance_invoice.json. - Once an advance invoice has been generated for a subscription's - upcoming renewal, it can be viewed through this endpoint. There can - only be one advance invoice per subscription per billing cycle. + Once an advance invoice has been generated for a subscription's upcoming + renewal, it can be viewed through this endpoint. There can only be one + advance invoice per subscription per billing cycle. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/advance_invoice.json') + .path("/subscriptions/{subscription_id}/advance_invoice.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def void_advance_invoice(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/advance_invoice/void.json. + """Perform a POST request to + /subscriptions/{subscription_id}/advance_invoice/void.json. - Void a subscription's existing advance invoice. Once voided, it can - later be regenerated if desired. - A `reason` is required in order to void, and the invoice must have an - open status. Voiding will cause any prepayments and credits that were - applied to the invoice to be returned to the subscription. For a full - overview of the impact of voiding, [see our help docs]($m/Invoice). + Void a subscription's existing advance invoice. Once voided, it can later be + regenerated if desired. + A `reason` is required in order to void, and the invoice must have an open + status. Voiding will cause any prepayments and credits that were applied to + the invoice to be returned to the subscription. For a full overview of the + impact of voiding, [see our help docs]($m/Invoice). Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (VoidInvoiceRequest, optional): The request body parameter. Returns: Invoice: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/advance_invoice/void.json') + .path("/subscriptions/{subscription_id}/advance_invoice/void.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() diff --git a/advancedbilling/controllers/api_exports_controller.py b/advancedbilling/controllers/api_exports_controller.py index e8168dc0..fe5bf423 100644 --- a/advancedbilling/controllers/api_exports_controller.py +++ b/advancedbilling/controllers/api_exports_controller.py @@ -1,280 +1,285 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.proforma_invoice import ProformaInvoice + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.single_error_response_exception import ( + SingleErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.batch_job_response import ( + BatchJobResponse, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.subscription import Subscription -from advancedbilling.models.batch_job_response import BatchJobResponse -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.single_error_response_exception import SingleErrorResponseException +from advancedbilling.models.proforma_invoice import ( + ProformaInvoice, +) +from advancedbilling.models.subscription import ( + Subscription, +) class APIExportsController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize APIExportsController object.""" super(APIExportsController, self).__init__(config) def list_exported_proforma_invoices(self, options=dict()): - """Does a GET request to /api_exports/proforma_invoices/{batch_id}/rows.json. + """Perform a GET request to + /api_exports/proforma_invoices/{batch_id}/rows.json. This API returns an array of exported proforma invoices for a provided - `batch_id`. Pay close attention to pagination in order to control - responses from the server. + `batch_id`. Pay close attention to pagination in order to control responses + from the server. Example: `GET - https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows - ?per_page=10000&page=1`. + https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_pa + ge=10000&page=1`. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: batch_id -- str -- Id of a Batch Job. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is - 100. The maximum allowed values is 10000; any - per_page value over 10000 will be changed to 10000. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 100. The maximum + allowed values is 10000; any per_page value over 10000 will + be changed to 10000. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. Returns: List[ProformaInvoice]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/proforma_invoices/{batch_id}/rows.json') + .path("/api_exports/proforma_invoices/{batch_id}/rows.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('batch_id') - .value(options.get('batch_id', None)) - .is_required(True) - .should_encode(True)) + .key("batch_id") + .value(options.get("batch_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProformaInvoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def list_exported_invoices(self, options=dict()): - """Does a GET request to /api_exports/invoices/{batch_id}/rows.json. + """Perform a GET request to /api_exports/invoices/{batch_id}/rows.json. - This API returns an array of exported invoices for a provided - `batch_id`. Pay close attention to pagination in order to control - responses from the server. + This API returns an array of exported invoices for a provided `batch_id`. Pay + close attention to pagination in order to control responses from the server. Example: `GET - https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page - =10000&page=1`. + https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000& + page=1`. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: batch_id -- str -- Id of a Batch Job. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is - 100. The maximum allowed values is 10000; any - per_page value over 10000 will be changed to 10000. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 100. The maximum + allowed values is 10000; any per_page value over 10000 will + be changed to 10000. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. Returns: List[Invoice]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/invoices/{batch_id}/rows.json') + .path("/api_exports/invoices/{batch_id}/rows.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('batch_id') - .value(options.get('batch_id', None)) - .is_required(True) - .should_encode(True)) + .key("batch_id") + .value(options.get("batch_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def list_exported_subscriptions(self, options=dict()): - """Does a GET request to /api_exports/subscriptions/{batch_id}/rows.json. + """Perform a GET request to + /api_exports/subscriptions/{batch_id}/rows.json. This API returns an array of exported subscriptions for a provided - `batch_id`. Pay close attention to pagination in order to control - responses from the server. + `batch_id`. Pay close attention to pagination in order to control responses + from the server. Example: `GET - https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per - _page=200&page=1`. + https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=2 + 00&page=1`. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: batch_id -- str -- Id of a Batch Job. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is - 100. The maximum allowed values is 10000; any - per_page value over 10000 will be changed to 10000. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 100. The maximum + allowed values is 10000; any per_page value over 10000 will + be changed to 10000. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. Returns: List[Subscription]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/subscriptions/{batch_id}/rows.json') + .path("/api_exports/subscriptions/{batch_id}/rows.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('batch_id') - .value(options.get('batch_id', None)) - .is_required(True) - .should_encode(True)) + .key("batch_id") + .value(options.get("batch_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Subscription.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def export_proforma_invoices(self): - """Does a POST request to /api_exports/proforma_invoices.json. + """Perform a POST request to /api_exports/proforma_invoices.json. - This API creates a proforma invoices export and returns a batchjob - object. + This API creates a proforma invoices export and returns a batchjob object. It is only available for Relationship Invoicing architecture. Returns: BatchJobResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/proforma_invoices.json') + .path("/api_exports/proforma_invoices.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('409', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SingleErrorResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("409", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SingleErrorResponseException), ).execute() def export_invoices(self): - """Does a POST request to /api_exports/invoices.json. + """Perform a POST request to /api_exports/invoices.json. This API creates an invoices export and returns a batchjob object. @@ -282,31 +287,32 @@ def export_invoices(self): BatchJobResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/invoices.json') + .path("/api_exports/invoices.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('409', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SingleErrorResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("409", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SingleErrorResponseException), ).execute() def export_subscriptions(self): - """Does a POST request to /api_exports/subscriptions.json. + """Perform a POST request to /api_exports/subscriptions.json. This API creates a subscriptions export and returns a batchjob object. @@ -314,31 +320,33 @@ def export_subscriptions(self): BatchJobResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/subscriptions.json') + .path("/api_exports/subscriptions.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) - .local_error_template('409', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SingleErrorResponseException) + .local_error_template("409", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SingleErrorResponseException), ).execute() def read_proforma_invoices_export(self, batch_id): - """Does a GET request to /api_exports/proforma_invoices/{batch_id}.json. + """Perform a GET request to + /api_exports/proforma_invoices/{batch_id}.json. This API returns a batchjob object for proforma invoices export. @@ -349,36 +357,34 @@ def read_proforma_invoices_export(self, BatchJobResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/proforma_invoices/{batch_id}.json') + .path("/api_exports/proforma_invoices/{batch_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('batch_id') - .value(batch_id) - .is_required(True) - .should_encode(True)) + .key("batch_id") + .value(batch_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def read_invoices_export(self, batch_id): - """Does a GET request to /api_exports/invoices/{batch_id}.json. + """Perform a GET request to /api_exports/invoices/{batch_id}.json. This API returns a batchjob object for invoices export. @@ -389,36 +395,34 @@ def read_invoices_export(self, BatchJobResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/invoices/{batch_id}.json') + .path("/api_exports/invoices/{batch_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('batch_id') - .value(batch_id) - .is_required(True) - .should_encode(True)) + .key("batch_id") + .value(batch_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def read_subscriptions_export(self, batch_id): - """Does a GET request to /api_exports/subscriptions/{batch_id}.json. + """Perform a GET request to /api_exports/subscriptions/{batch_id}.json. This API returns a batchjob object for subscriptions export. @@ -429,29 +433,27 @@ def read_subscriptions_export(self, BatchJobResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/api_exports/subscriptions/{batch_id}.json') + .path("/api_exports/subscriptions/{batch_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('batch_id') - .value(batch_id) - .is_required(True) - .should_encode(True)) + .key("batch_id") + .value(batch_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() diff --git a/advancedbilling/controllers/base_controller.py b/advancedbilling/controllers/base_controller.py index c53ca396..687ce273 100644 --- a/advancedbilling/controllers/base_controller.py +++ b/advancedbilling/controllers/base_controller.py @@ -1,20 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ import platform + from apimatic_core.api_call import ApiCall from apimatic_core.types.error_case import ErrorCase -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) -class BaseController(object): +class BaseController(object): """All controllers inherit from this base class. Attributes: @@ -30,34 +30,46 @@ class BaseController(object): @staticmethod def user_agent(): - return 'AB SDK Python:8.0.0 on OS {os-info}' + """Return UserAgent value.""" + return "AB SDK Python:9.0.0 on OS {os-info}" @staticmethod def user_agent_parameters(): + """Return UserAgentParameters value.""" return { - 'os-info': {'value': platform.system(), 'encode': False}, + "os-info": {"value": platform.system(), "encode": False}, } @staticmethod def global_errors(): + """Return GlobalErrors value.""" return { - 'default': ErrorCase().error_message_template('HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.').exception_type(APIException), - '404': ErrorCase().error_message_template('Not Found:\'{$response.body}\'').exception_type(APIException), + "default": ErrorCase().error_message_template( + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.") + .exception_type(APIException), + "404": ErrorCase().error_message_template( + "Not Found:'{$response.body}'") + .exception_type(APIException), } def __init__(self, config): + """Initialize BaseController object.""" self._config = config.get_http_client_configuration() self._http_call_back = self.config.http_callback self.api_call = ApiCall(config) @property def config(self): + """Return Configuration object.""" return self._config @property def http_call_back(self): + """Return HttpCallBack object.""" return self._http_call_back @property def new_api_call_builder(self): + """Return New ApiCallBuilder object.""" return self.api_call.new_builder diff --git a/advancedbilling/controllers/billing_portal_controller.py b/advancedbilling/controllers/billing_portal_controller.py index eb2dea83..7e2b41aa 100644 --- a/advancedbilling/controllers/billing_portal_controller.py +++ b/advancedbilling/controllers/billing_portal_controller.py @@ -1,124 +1,144 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.customer_response import CustomerResponse -from advancedbilling.models.portal_management_link import PortalManagementLink -from advancedbilling.models.resent_invitation import ResentInvitation -from advancedbilling.models.revoked_invitation import RevokedInvitation -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.too_many_management_link_requests_error_exception import TooManyManagementLinkRequestsErrorException -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.exceptions.too_many_management_link_requests_error_exception import ( # noqa: E501 + TooManyManagementLinkRequestsErrorException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.customer_response import ( + CustomerResponse, +) +from advancedbilling.models.portal_management_link import ( + PortalManagementLink, +) +from advancedbilling.models.resent_invitation import ( + ResentInvitation, +) +from advancedbilling.models.revoked_invitation import ( + RevokedInvitation, +) -class BillingPortalController(BaseController): +class BillingPortalController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize BillingPortalController object.""" super(BillingPortalController, self).__init__(config) def enable_billing_portal_for_customer(self, customer_id, auto_invite=None): - """Does a POST request to /portal/customers/{customer_id}/enable.json. + """Perform a POST request to + /portal/customers/{customer_id}/enable.json. ## Billing Portal Documentation - Full documentation on how the Billing Portal operates within the - Advanced Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billi - ng-Portal-Overview). - This documentation is focused on how the to configure the Billing - Portal Settings, as well as Subscriber Interaction and Merchant - Management of the Billing Portal. - You can use this endpoint to enable Billing Portal access for a - Customer, with the option of sending the Customer an Invitation email - at the same time. + Full documentation on how the Billing Portal operates within the Advanced + Billing UI can be located + [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Port + al-Overview). + This documentation is focused on how the to configure the Billing Portal + Settings, as well as Subscriber Interaction and Merchant Management of the + Billing Portal. + You can use this endpoint to enable Billing Portal access for a Customer, + with the option of sending the Customer an Invitation email at the same time. ## Billing Portal Security - If your customer has been invited to the Billing Portal, then they - will receive a link to manage their subscription (the “Management - URL”) automatically at the bottom of their statements, invoices, and - receipts. **This link changes periodically for security and is only - valid for 65 days.** - If you need to provide your customer their Management URL through - other means, you can retrieve it via the API. Because the URL is - cryptographically signed with a timestamp, it is not possible for - merchants to generate the URL without requesting it from Advanced - Billing. - In order to prevent abuse & overuse, we ask that you request a new URL - only when absolutely necessary. Management URLs are good for 65 days, - so you should re-use a previously generated one as much as possible. - If you use the URL frequently (such as to display on your website), - **do not** make an API request to Advanced Billing every time. + If your customer has been invited to the Billing Portal, then they will + receive a link to manage their subscription (the “Management URL”) + automatically at the bottom of their statements, invoices, and receipts. + **This link changes periodically for security and is only valid for 65 days.** + If you need to provide your customer their Management URL through other + means, you can retrieve it via the API. Because the URL is cryptographically + signed with a timestamp, it is not possible for merchants to generate the URL + without requesting it from Advanced Billing. + In order to prevent abuse & overuse, we ask that you request a new URL only + when absolutely necessary. Management URLs are good for 65 days, so you + should re-use a previously generated one as much as possible. If you use the + URL frequently (such as to display on your website), **do not** make an API + request to Advanced Billing every time. Args: customer_id (int): The Chargify id of the customer - auto_invite (AutoInvite, optional): When set to 1, an Invitation - email will be sent to the Customer. When set to 0, or not - sent, an email will not be sent. Use in query: `auto_invite=1`. + auto_invite (AutoInvite, optional): When set to 1, an Invitation email + will be sent to the Customer. When set to 0, or not sent, an email + will not be sent. Use in query: `auto_invite=1`. Returns: CustomerResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/portal/customers/{customer_id}/enable.json') + .path("/portal/customers/{customer_id}/enable.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('customer_id') - .value(customer_id) - .is_required(True) - .should_encode(True)) + .key("customer_id") + .value(customer_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('auto_invite') - .value(auto_invite)) + .key("auto_invite") + .value(auto_invite)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CustomerResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_billing_portal_link(self, customer_id): - """Does a GET request to /portal/customers/{customer_id}/management_link.json. + """Perform a GET request to + /portal/customers/{customer_id}/management_link.json. This method will provide to the API user the exact URL required for a subscriber to access the Billing Portal. ## Rules for Management Link API - + When retrieving a management URL, multiple requests for the same - customer in a short period will return the **same** URL + + When retrieving a management URL, multiple requests for the same customer + in a short period will return the **same** URL + We will not generate a new URL for 15 days - + You must cache and remember this URL if you are going to need it - again within 15 days + + You must cache and remember this URL if you are going to need it again + within 15 days + Only request a new URL after the `new_link_available_at` date - + You are limited to 15 requests for the same URL. If you make more - than 15 requests before `new_link_available_at`, you will be blocked - from further Management URL requests (with a response code `429`) + + You are limited to 15 requests for the same URL. If you make more than 15 + requests before `new_link_available_at`, you will be blocked from further + Management URL requests (with a response code `429`) Args: customer_id (int): The Chargify id of the customer @@ -127,49 +147,52 @@ def read_billing_portal_link(self, PortalManagementLink: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/portal/customers/{customer_id}/management_link.json') + .path("/portal/customers/{customer_id}/management_link.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('customer_id') - .value(customer_id) - .is_required(True) - .should_encode(True)) + .key("customer_id") + .value(customer_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PortalManagementLink.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) - .local_error_template('429', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', TooManyManagementLinkRequestsErrorException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException) + .local_error_template("429", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + TooManyManagementLinkRequestsErrorException), ).execute() def resend_billing_portal_invitation(self, customer_id): - """Does a POST request to /portal/customers/{customer_id}/invitations/invite.json. + """Perform a POST request to + /portal/customers/{customer_id}/invitations/invite.json. You can resend a customer's Billing Portal invitation. - If you attempt to resend an invitation 5 times within 30 minutes, you - will receive a `422` response with `error` message in the body. - If you attempt to resend an invitation when the Billing Portal is - already disabled for a Customer, you will receive a `422` error - response. - If you attempt to resend an invitation when the Billing Portal is - already disabled for a Customer, you will receive a `422` error - response. - If you attempt to resend an invitation when the Customer does not - exist a Customer, you will receive a `404` error response. + If you attempt to resend an invitation 5 times within 30 minutes, you will + receive a `422` response with `error` message in the body. + If you attempt to resend an invitation when the Billing Portal is already + disabled for a Customer, you will receive a `422` error response. + If you attempt to resend an invitation when the Billing Portal is already + disabled for a Customer, you will receive a `422` error response. + If you attempt to resend an invitation when the Customer does not exist a + Customer, you will receive a `404` error response. ## Limitations This endpoint will only return a JSON response. @@ -180,41 +203,43 @@ def resend_billing_portal_invitation(self, ResentInvitation: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/portal/customers/{customer_id}/invitations/invite.json') + .path("/portal/customers/{customer_id}/invitations/invite.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('customer_id') - .value(customer_id) - .is_required(True) - .should_encode(True)) + .key("customer_id") + .value(customer_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ResentInvitation.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def revoke_billing_portal_access(self, customer_id): - """Does a DELETE request to /portal/customers/{customer_id}/invitations/revoke.json. + """Perform a DELETE request to + /portal/customers/{customer_id}/invitations/revoke.json. You can revoke a customer's Billing Portal invitation. - If you attempt to revoke an invitation when the Billing Portal is - already disabled for a Customer, you will receive a 422 error response. + If you attempt to revoke an invitation when the Billing Portal is already + disabled for a Customer, you will receive a 422 error response. ## Limitations This endpoint will only return a JSON response. @@ -225,28 +250,26 @@ def revoke_billing_portal_access(self, RevokedInvitation: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/portal/customers/{customer_id}/invitations/revoke.json') + .path("/portal/customers/{customer_id}/invitations/revoke.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('customer_id') - .value(customer_id) - .is_required(True) - .should_encode(True)) + .key("customer_id") + .value(customer_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(RevokedInvitation.from_dictionary) + .deserialize_into(RevokedInvitation.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/component_price_points_controller.py b/advancedbilling/controllers/component_price_points_controller.py index b72b0b2d..f3910d6d 100644 --- a/advancedbilling/controllers/component_price_points_controller.py +++ b/advancedbilling/controllers/component_price_points_controller.py @@ -1,182 +1,209 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController -from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.component_response import ComponentResponse -from advancedbilling.models.component_price_point_response import ComponentPricePointResponse -from advancedbilling.models.component_price_points_response import ComponentPricePointsResponse -from advancedbilling.models.component_currency_prices_response import ComponentCurrencyPricesResponse -from advancedbilling.models.list_components_price_points_response import ListComponentsPricePointsResponse -from advancedbilling.exceptions.error_array_map_response_exception import ErrorArrayMapResponseException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_array_map_response_exception import ( + ErrorArrayMapResponseException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.component_currency_prices_response import ( + ComponentCurrencyPricesResponse, +) +from advancedbilling.models.component_price_point_currency_overage_response import ( + ComponentPricePointCurrencyOverageResponse, +) +from advancedbilling.models.component_price_point_response import ( + ComponentPricePointResponse, +) +from advancedbilling.models.component_price_points_response import ( + ComponentPricePointsResponse, +) +from advancedbilling.models.component_response import ( + ComponentResponse, +) +from advancedbilling.models.list_components_price_points_response import ( + ListComponentsPricePointsResponse, +) +from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, +) -class ComponentPricePointsController(BaseController): +class ComponentPricePointsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ComponentPricePointsController object.""" super(ComponentPricePointsController, self).__init__(config) def promote_component_price_point_to_default(self, component_id, price_point_id): - """Does a PUT request to /components/{component_id}/price_points/{price_point_id}/default.json. + """Perform a PUT request to + /components/{component_id}/price_points/{price_point_id}/default.json. - Sets a new default price point for the component. This new default - will apply to all new subscriptions going forward - existing - subscriptions will remain on their current price point. + Sets a new default price point for the component. This new default will apply + to all new subscriptions going forward - existing subscriptions will remain + on their current price point. See [Price Points - Documentation](https://maxio.zendesk.com/hc/en-us/articles/242611917371 - 01-Price-Points-Components) for more information on price points and - moving subscriptions between price points. + Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261191737101-Pric + e-Points-Components) for more information on price points and moving + subscriptions between price points. Note: Custom price points are not able to be set as the default for a component. Args: - component_id (int): The Advanced Billing id of the component to - which the price point belongs + component_id (int): The Advanced Billing id of the component to which the + price point belongs price_point_id (int): The Advanced Billing id of the price point Returns: ComponentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/default.json') + .path("/components/{component_id}/price_points/{price_point_id}/default.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentResponse.from_dictionary) + .deserialize_into(ComponentResponse.from_dictionary), ).execute() def create_component_price_point(self, component_id, body=None): - """Does a POST request to /components/{component_id}/price_points.json. + """Perform a POST request to + /components/{component_id}/price_points.json. Creates a price point for an existing component. Args: component_id (int): The Advanced Billing id of the component - body (CreateComponentPricePointRequest, optional): The request - body parameter. + body (CreateComponentPricePointRequest, optional): The request body + parameter. Returns: ComponentPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points.json') + .path("/components/{component_id}/price_points.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentPricePointResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def list_component_price_points(self, options=dict()): - """Does a GET request to /components/{component_id}/price_points.json. + """Perform a GET request to + /components/{component_id}/price_points.json. - Use this endpoint to read current price points that are associated - with a component. + Use this endpoint to read current price points that are associated with a + component. You may specify the component by using either the numeric id or the `handle:gold` syntax. When fetching a component's price points, if you have defined multiple currencies at the site level, you can optionally pass the - `?currency_prices=true` query param to include an array of currency - price data in the response. - If the price point is set to `use_site_exchange_rate: true`, it will - return pricing based on the current exchange rate. If the flag is set - to false, it will return all of the defined prices for each currency. + `?currency_prices=true` query param to include an array of currency price + data in the response. + If the price point is set to `use_site_exchange_rate: true`, it will return + pricing based on the current exchange rate. If the flag is set to false, it + will return all of the defined prices for each currency. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - component_id -- int -- The Advanced Billing id of the - component - currency_prices -- bool -- Include an array of currency - price data - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + component_id -- int -- The Advanced Billing id of the component + currency_prices -- bool -- Include an array of currency price data + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. filter_type -- List[PricePointType] -- Use in query: `filter[type]=catalog,default`. @@ -184,476 +211,548 @@ def list_component_price_points(self, ComponentPricePointsResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points.json') + .path("/components/{component_id}/price_points.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('component_id') - .value(options.get('component_id', None)) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(options.get("component_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('currency_prices') - .value(options.get('currency_prices', None))) + .key("currency_prices") + .value(options.get("currency_prices", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter[type]') - .value(options.get('filter_type', None))) + .key("filter[type]") + .value(options.get("filter_type", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentPricePointsResponse.from_dictionary) + .deserialize_into(ComponentPricePointsResponse.from_dictionary), ).execute() def bulk_create_component_price_points(self, component_id, body=None): - """Does a POST request to /components/{component_id}/price_points/bulk.json. + """Perform a POST request to + /components/{component_id}/price_points/bulk.json. - Use this endpoint to create multiple component price points in one - request. + Use this endpoint to create multiple component price points in one request. Args: - component_id (str): The Advanced Billing id of the component for - which you want to fetch price points. - body (CreateComponentPricePointsRequest, optional): The request - body parameter. + component_id (str): The Advanced Billing id of the component for which + you want to fetch price points. + body (CreateComponentPricePointsRequest, optional): The request body + parameter. Returns: ComponentPricePointsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/bulk.json') + .path("/components/{component_id}/price_points/bulk.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentPricePointsResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), + ).execute() + + def clone_component_price_point(self, + component_id, + price_point_id, + body=None): + """Perform a POST request to + /components/{component_id}/price_points/{price_point_id}/clone.json. + + Clones a component price point. Custom price points (tied to a specific + subscription) cannot be cloned. The following attributes are copied from the + source price point: + - Pricing scheme + - All price tiers (with starting/ending quantities and unit prices) + - Tax included setting + - Currency prices (if definitive pricing is set) + - Overage pricing (for prepaid usage components) + - Interval settings (if multi-frequency is enabled) + - Event-based billing segments (if applicable) + + Args: + component_id (int | str): The id or handle of the component. When using + the handle, it must be prefixed with `handle:`. Example: `123` for an + integer ID, or `handle:example-product-handle` for a string handle. + price_point_id (int | str): The id or handle of the price point. When + using the handle, it must be prefixed with `handle:`. Example: `123` + for an integer ID, or `handle:example-price_point-handle` for a + string handle. + body (CloneComponentPricePointRequest, optional): The request body + parameter. + + Returns: + ComponentPricePointCurrencyOverageResponse: Response from the API. Created + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/components/{component_id}/price_points/{price_point_id}/clone.json") + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("CloneComponentPricePointComponentId").validate(value))) + .template_param(Parameter() + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("CloneComponentPricePointPricePointId").validate(value))) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ComponentPricePointCurrencyOverageResponse.from_dictionary) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def update_component_price_point(self, component_id, price_point_id, body=None): - """Does a PUT request to /components/{component_id}/price_points/{price_point_id}.json. - - When updating a price point, prices can be updated as well by creating - new prices or editing / removing existing ones. - Passing in a price bracket without an `id` will attempt to create a - new price. - Including an `id` will update the corresponding price, and including - the `_destroy` flag set to true along with the `id` will remove that - price. - Note: Custom price points cannot be updated directly. They must be - edited through the Subscription. + """Perform a PUT request to + /components/{component_id}/price_points/{price_point_id}.json. + + When updating a price point, prices can be updated as well by creating new + prices or editing / removing existing ones. + Passing in a price bracket without an `id` will attempt to create a new price. + Including an `id` will update the corresponding price, and including the + `_destroy` flag set to true along with the `id` will remove that price. + Note: Custom price points cannot be updated directly. They must be edited + through the Subscription. Args: - component_id (int | str): The id or handle of the component. When - using the handle, it must be prefixed with `handle:`. Example: - `123` for an integer ID, or `handle:example-product-handle` - for a string handle. - price_point_id (int | str): The id or handle of the price point. - When using the handle, it must be prefixed with `handle:`. - Example: `123` for an integer ID, or - `handle:example-price_point-handle` for a string handle. - body (UpdateComponentPricePointRequest, optional): The request - body parameter. + component_id (int | str): The id or handle of the component. When using + the handle, it must be prefixed with `handle:`. Example: `123` for an + integer ID, or `handle:example-product-handle` for a string handle. + price_point_id (int | str): The id or handle of the price point. When + using the handle, it must be prefixed with `handle:`. Example: `123` + for an integer ID, or `handle:example-price_point-handle` for a + string handle. + body (UpdateComponentPricePointRequest, optional): The request body + parameter. Returns: ComponentPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}.json') + .path("/components/{component_id}/price_points/{price_point_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('UpdateComponentPricePointComponentId').validate(value))) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("UpdateComponentPricePointComponentId").validate(value))) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('UpdateComponentPricePointPricePointId').validate(value))) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("UpdateComponentPricePointPricePointId").validate(value))) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentPricePointResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def read_component_price_point(self, component_id, price_point_id, currency_prices=None): - """Does a GET request to /components/{component_id}/price_points/{price_point_id}.json. + """Perform a GET request to + /components/{component_id}/price_points/{price_point_id}.json. - Use this endpoint to retrieve details for a specific component price - point. You can achieve this by using either the component price point - ID or handle. + Use this endpoint to retrieve details for a specific component price point. + You can achieve this by using either the component price point ID or handle. Args: - component_id (int | str): The id or handle of the component. When - using the handle, it must be prefixed with `handle:`. Example: - `123` for an integer ID, or `handle:example-product-handle` - for a string handle. - price_point_id (int | str): The id or handle of the price point. - When using the handle, it must be prefixed with `handle:`. - Example: `123` for an integer ID, or - `handle:example-price_point-handle` for a string handle. - currency_prices (bool, optional): Include an array of currency - price data + component_id (int | str): The id or handle of the component. When using + the handle, it must be prefixed with `handle:`. Example: `123` for an + integer ID, or `handle:example-product-handle` for a string handle. + price_point_id (int | str): The id or handle of the price point. When + using the handle, it must be prefixed with `handle:`. Example: `123` + for an integer ID, or `handle:example-price_point-handle` for a + string handle. + currency_prices (bool, optional): Include an array of currency price data Returns: - ComponentPricePointResponse: Response from the API. OK + ComponentPricePointCurrencyOverageResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}.json') + .path("/components/{component_id}/price_points/{price_point_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ReadComponentPricePointComponentId').validate(value))) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ReadComponentPricePointComponentId").validate(value))) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ReadComponentPricePointPricePointId').validate(value))) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ReadComponentPricePointPricePointId").validate(value))) .query_param(Parameter() - .key('currency_prices') - .value(currency_prices)) + .key("currency_prices") + .value(currency_prices)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentPricePointResponse.from_dictionary) + .deserialize_into(ComponentPricePointCurrencyOverageResponse.from_dictionary), ).execute() def archive_component_price_point(self, component_id, price_point_id): - """Does a DELETE request to /components/{component_id}/price_points/{price_point_id}.json. + """Perform a DELETE request to + /components/{component_id}/price_points/{price_point_id}.json. - A price point can be archived at any time. Subscriptions using a price - point that has been archived will continue using it until they're - moved to another price point. + A price point can be archived at any time. Subscriptions using a price point + that has been archived will continue using it until they're moved to another + price point. Args: - component_id (int | str): The id or handle of the component. When - using the handle, it must be prefixed with `handle:`. Example: - `123` for an integer ID, or `handle:example-product-handle` - for a string handle. - price_point_id (int | str): The id or handle of the price point. - When using the handle, it must be prefixed with `handle:`. - Example: `123` for an integer ID, or - `handle:example-price_point-handle` for a string handle. + component_id (int | str): The id or handle of the component. When using + the handle, it must be prefixed with `handle:`. Example: `123` for an + integer ID, or `handle:example-product-handle` for a string handle. + price_point_id (int | str): The id or handle of the price point. When + using the handle, it must be prefixed with `handle:`. Example: `123` + for an integer ID, or `handle:example-price_point-handle` for a + string handle. Returns: ComponentPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}.json') + .path("/components/{component_id}/price_points/{price_point_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ArchiveComponentPricePointComponentId').validate(value))) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ArchiveComponentPricePointComponentId").validate(value))) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ArchiveComponentPricePointPricePointId').validate(value))) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ArchiveComponentPricePointPricePointId").validate(value))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentPricePointResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def unarchive_component_price_point(self, component_id, price_point_id): - """Does a PUT request to /components/{component_id}/price_points/{price_point_id}/unarchive.json. + """Perform a PUT request to + /components/{component_id}/price_points/{price_point_id}/unarchive.json. Use this endpoint to unarchive a component price point. Args: - component_id (int): The Advanced Billing id of the component to - which the price point belongs + component_id (int): The Advanced Billing id of the component to which the + price point belongs price_point_id (int): The Advanced Billing id of the price point Returns: ComponentPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/unarchive.json') + .path("/components/{component_id}/price_points/{price_point_id}/unarchive.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentPricePointResponse.from_dictionary) + .deserialize_into(ComponentPricePointResponse.from_dictionary), ).execute() def create_currency_prices(self, price_point_id, body=None): - """Does a POST request to /price_points/{price_point_id}/currency_prices.json. + """Perform a POST request to + /price_points/{price_point_id}/currency_prices.json. - This endpoint allows you to create currency prices for a given - currency that has been defined on the site level in your settings. - When creating currency prices, they need to mirror the structure of - your primary pricing. For each price level defined on the component - price point, there should be a matching price level created in the - given currency. - Note: Currency Prices are not able to be created for custom price - points. + This endpoint allows you to create currency prices for a given currency that + has been defined on the site level in your settings. + When creating currency prices, they need to mirror the structure of your + primary pricing. For each price level defined on the component price point, + there should be a matching price level created in the given currency. + Note: Currency Prices are not able to be created for custom price points. Args: price_point_id (int): The Advanced Billing id of the price point - body (CreateCurrencyPricesRequest, optional): The request body - parameter. + body (CreateCurrencyPricesRequest, optional): The request body parameter. Returns: ComponentCurrencyPricesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/price_points/{price_point_id}/currency_prices.json') + .path("/price_points/{price_point_id}/currency_prices.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentCurrencyPricesResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def update_currency_prices(self, price_point_id, body=None): - """Does a PUT request to /price_points/{price_point_id}/currency_prices.json. + """Perform a PUT request to + /price_points/{price_point_id}/currency_prices.json. - This endpoint allows you to update currency prices for a given - currency that has been defined on the site level in your settings. - Note: Currency Prices are not able to be updated for custom price - points. + This endpoint allows you to update currency prices for a given currency that + has been defined on the site level in your settings. + Note: Currency Prices are not able to be updated for custom price points. Args: price_point_id (int): The Advanced Billing id of the price point - body (UpdateCurrencyPricesRequest, optional): The request body - parameter. + body (UpdateCurrencyPricesRequest, optional): The request body parameter. Returns: ComponentCurrencyPricesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/price_points/{price_point_id}/currency_prices.json') + .path("/price_points/{price_point_id}/currency_prices.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentCurrencyPricesResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def list_all_component_price_points(self, options=dict()): - """Does a GET request to /components_price_points.json. + """Perform a GET request to /components_price_points.json. - This method allows to retrieve a list of Components Price Points - belonging to a Site. + This method allows to retrieve a list of Components Price Points belonging to + a Site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - include -- ListComponentsPricePointsInclude -- Allows - including additional data in the response. Use in - query: `include=currency_prices`. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + include -- ListComponentsPricePointsInclude -- Allows including + additional data in the response. Use in query: + `include=currency_prices`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. filter -- ListPricePointsFilter -- Filter to use for List PricePoints operations @@ -661,40 +760,41 @@ def list_all_component_price_points(self, ListComponentsPricePointsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components_price_points.json') + .path("/components_price_points.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListComponentsPricePointsResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/controllers/components_controller.py b/advancedbilling/controllers/components_controller.py index bbc1d824..6093988f 100644 --- a/advancedbilling/controllers/components_controller.py +++ b/advancedbilling/controllers/components_controller.py @@ -1,358 +1,377 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.component_response import ComponentResponse -from advancedbilling.models.component import Component -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.component import ( + Component, +) +from advancedbilling.models.component_response import ( + ComponentResponse, +) -class ComponentsController(BaseController): +class ComponentsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ComponentsController object.""" super(ComponentsController, self).__init__(config) def create_metered_component(self, product_family_id, body=None): - """Does a POST request to /product_families/{product_family_id}/metered_components.json. - - This request will create a component definition of kind - **metered_component** under the specified product family. Metered - component can then be added and “allocated” for a subscription. - Metered components are used to bill for any type of unit that resets - to 0 at the end of the billing period (think daily Google Adwords - clicks or monthly cell phone minutes). This is most commonly - associated with usage-based billing and many other pricing schemes. - Note that this is different from recurring quantity-based components, - which DO NOT reset to zero at the start of every billing period. If - you want to bill for a quantity of something that does not change - unless you change it, then you want quantity components, instead. + """Perform a POST request to + /product_families/{product_family_id}/metered_components.json. + + This request will create a component definition of kind **metered_component** + under the specified product family. Metered component can then be added and + “allocated” for a subscription. + Metered components are used to bill for any type of unit that resets to 0 at + the end of the billing period (think daily Google Adwords clicks or monthly + cell phone minutes). This is most commonly associated with usage-based + billing and many other pricing schemes. + Note that this is different from recurring quantity-based components, which + DO NOT reset to zero at the start of every billing period. If you want to + bill for a quantity of something that does not change unless you change it, + then you want quantity components, instead. For more information on components, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo - nents-Overview). + [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O + verview). Args: - product_family_id (str): Either the product family's id or its - handle prefixed with `handle:` - body (CreateMeteredComponent, optional): The request body - parameter. + product_family_id (str): Either the product family's id or its handle + prefixed with `handle:` + body (CreateMeteredComponent, optional): The request body parameter. Returns: ComponentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/metered_components.json') + .path("/product_families/{product_family_id}/metered_components.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def create_quantity_based_component(self, product_family_id, body=None): - """Does a POST request to /product_families/{product_family_id}/quantity_based_components.json. + """Perform a POST request to + /product_families/{product_family_id}/quantity_based_components.json. This request will create a component definition of kind - **quantity_based_component** under the specified product family. - Quantity Based component can then be added and “allocated” for a - subscription. + **quantity_based_component** under the specified product family. Quantity + Based component can then be added and “allocated” for a subscription. When defining Quantity Based component, You can choose one of 2 types: #### Recurring - Recurring quantity-based components are used to bill for the number of - some unit (think monthly software user licenses or the number of pairs - of socks in a box-a-month club). This is most commonly associated with - billing for user licenses, number of users, number of employees, etc. + Recurring quantity-based components are used to bill for the number of some + unit (think monthly software user licenses or the number of pairs of socks in + a box-a-month club). This is most commonly associated with billing for user + licenses, number of users, number of employees, etc. #### One-time - One-time quantity-based components are used to create ad hoc usage - charges that do not recur. For example, at the time of signup, you - might want to charge your customer a one-time fee for onboarding or - other services. - The allocated quantity for one-time quantity-based components - immediately gets reset back to zero after the allocation is made. + One-time quantity-based components are used to create ad hoc usage charges + that do not recur. For example, at the time of signup, you might want to + charge your customer a one-time fee for onboarding or other services. + The allocated quantity for one-time quantity-based components immediately + gets reset back to zero after the allocation is made. For more information on components, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo - nents-Overview). + [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O + verview). Args: - product_family_id (str): Either the product family's id or its - handle prefixed with `handle:` - body (CreateQuantityBasedComponent, optional): The request body - parameter. + product_family_id (str): Either the product family's id or its handle + prefixed with `handle:` + body (CreateQuantityBasedComponent, optional): The request body parameter. Returns: ComponentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/quantity_based_components.json') + .path("/product_families/{product_family_id}/quantity_based_components.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def create_on_off_component(self, product_family_id, body=None): - """Does a POST request to /product_families/{product_family_id}/on_off_components.json. + """Perform a POST request to + /product_families/{product_family_id}/on_off_components.json. - This request will create a component definition of kind - **on_off_component** under the specified product family. On/Off - component can then be added and “allocated” for a subscription. + This request will create a component definition of kind **on_off_component** + under the specified product family. On/Off component can then be added and + “allocated” for a subscription. On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a flat add on shipping fee). For more information on components, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo - nents-Overview). + [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O + verview). Args: - product_family_id (str): Either the product family's id or its - handle prefixed with `handle:` + product_family_id (str): Either the product family's id or its handle + prefixed with `handle:` body (CreateOnOffComponent, optional): The request body parameter. Returns: ComponentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/on_off_components.json') + .path("/product_families/{product_family_id}/on_off_components.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def create_prepaid_usage_component(self, product_family_id, body=None): - """Does a POST request to /product_families/{product_family_id}/prepaid_usage_components.json. + """Perform a POST request to + /product_families/{product_family_id}/prepaid_usage_components.json. This request will create a component definition of kind - **prepaid_usage_component** under the specified product family. - Prepaid component can then be added and “allocated” for a subscription. - Prepaid components allow customers to pre-purchase units that can be - used up over time on their subscription. In a sense, they are the - mirror image of metered components; while metered components charge at - the end of the period for the amount of units used, prepaid components - are charged for at the time of purchase, and we subsequently keep - track of the usage against the amount purchased. + **prepaid_usage_component** under the specified product family. Prepaid + component can then be added and “allocated” for a subscription. + Prepaid components allow customers to pre-purchase units that can be used up + over time on their subscription. In a sense, they are the mirror image of + metered components; while metered components charge at the end of the period + for the amount of units used, prepaid components are charged for at the time + of purchase, and we subsequently keep track of the usage against the amount + purchased. For more information on components, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo - nents-Overview). + [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O + verview). Args: - product_family_id (str): Either the product family's id or its - handle prefixed with `handle:` - body (CreatePrepaidComponent, optional): The request body - parameter. + product_family_id (str): Either the product family's id or its handle + prefixed with `handle:` + body (CreatePrepaidComponent, optional): The request body parameter. Returns: ComponentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/prepaid_usage_components.json') + .path("/product_families/{product_family_id}/prepaid_usage_components.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def create_event_based_component(self, product_family_id, body=None): - """Does a POST request to /product_families/{product_family_id}/event_based_components.json. + """Perform a POST request to + /product_families/{product_family_id}/event_based_components.json. This request will create a component definition of kind - **event_based_component** under the specified product family. - Event-based component can then be added and “allocated” for a - subscription. - Event-based components are similar to other component types, in that - you define the component parameters (such as name and taxability) and - the pricing. A key difference for the event-based component is that it - must be attached to a metric. This is because the metric provides the - component with the actual quantity used in computing what and how much - will be billed each period for each subscription. - So, instead of reporting usage directly for each component (as you - would with metered components), the usage is derived from analysis of - your events. + **event_based_component** under the specified product family. Event-based + component can then be added and “allocated” for a subscription. + Event-based components are similar to other component types, in that you + define the component parameters (such as name and taxability) and the + pricing. A key difference for the event-based component is that it must be + attached to a metric. This is because the metric provides the component with + the actual quantity used in computing what and how much will be billed each + period for each subscription. + So, instead of reporting usage directly for each component (as you would with + metered components), the usage is derived from analysis of your events. For more information on components, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo - nents-Overview). + [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O + verview). Args: - product_family_id (str): Either the product family's id or its - handle prefixed with `handle:` + product_family_id (str): Either the product family's id or its handle + prefixed with `handle:` body (CreateEBBComponent, optional): The request body parameter. Returns: ComponentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/event_based_components.json') + .path("/product_families/{product_family_id}/event_based_components.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def find_component(self, handle): - """Does a GET request to /components/lookup.json. + """Perform a GET request to /components/lookup.json. - This request will return information regarding a component having the - handle you provide. You can identify your components with a handle so - you don't have to save or reference the IDs we generate. + This request will return information regarding a component having the handle + you provide. You can identify your components with a handle so you don't have + to save or reference the IDs we generate. Args: handle (str): The handle of the component to find @@ -361,249 +380,239 @@ def find_component(self, ComponentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/lookup.json') + .path("/components/lookup.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('handle') - .value(handle) - .is_required(True)) + .key("handle") + .value(handle) + .is_required(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentResponse.from_dictionary) + .deserialize_into(ComponentResponse.from_dictionary), ).execute() def read_component(self, product_family_id, component_id): - """Does a GET request to /product_families/{product_family_id}/components/{component_id}.json. + """Perform a GET request to + /product_families/{product_family_id}/components/{component_id}.json. - Returns information regarding a component from a specific product - family. - You can read the component by either the component's id or handle. - When using the handle, it must be prefixed with `handle:`. + Returns information regarding a component from a specific product family. + You can read the component by either the component's id or handle. When using + the handle, it must be prefixed with `handle:`. Args: - product_family_id (int): The Advanced Billing id of the product - family to which the component belongs - component_id (str): Either the Advanced Billing id of the - component or the handle for the component prefixed with - `handle:` + product_family_id (int): The Advanced Billing id of the product family to + which the component belongs + component_id (str): Either the Advanced Billing id of the component or + the handle for the component prefixed with `handle:` Returns: ComponentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/components/{component_id}.json') + .path("/product_families/{product_family_id}/components/{component_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentResponse.from_dictionary) + .deserialize_into(ComponentResponse.from_dictionary), ).execute() def update_product_family_component(self, product_family_id, component_id, body=None): - """Does a PUT request to /product_families/{product_family_id}/components/{component_id}.json. + """Perform a PUT request to + /product_families/{product_family_id}/components/{component_id}.json. This request will update a component from a specific product family. - You may read the component by either the component's id or handle. - When using the handle, it must be prefixed with `handle:`. + You may read the component by either the component's id or handle. When using + the handle, it must be prefixed with `handle:`. Args: - product_family_id (int): The Advanced Billing id of the product - family to which the component belongs - component_id (str): Either the Advanced Billing id of the - component or the handle for the component prefixed with - `handle:` - body (UpdateComponentRequest, optional): The request body - parameter. + product_family_id (int): The Advanced Billing id of the product family to + which the component belongs + component_id (str): Either the Advanced Billing id of the component or + the handle for the component prefixed with `handle:` + body (UpdateComponentRequest, optional): The request body parameter. Returns: ComponentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/components/{component_id}.json') + .path("/product_families/{product_family_id}/components/{component_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def archive_component(self, product_family_id, component_id): - """Does a DELETE request to /product_families/{product_family_id}/components/{component_id}.json. + """Perform a DELETE request to + /product_families/{product_family_id}/components/{component_id}.json. - Sending a DELETE request to this endpoint will archive the component. - All current subscribers will be unffected; their subscription/purchase - will continue to be charged as usual. + Sending a DELETE request to this endpoint will archive the component. All + current subscribers will be unffected; their subscription/purchase will + continue to be charged as usual. Args: - product_family_id (int): The Advanced Billing id of the product - family to which the component belongs - component_id (str): Either the Advanced Billing id of the - component or the handle for the component prefixed with - `handle:` + product_family_id (int): The Advanced Billing id of the product family to + which the component belongs + component_id (str): Either the Advanced Billing id of the component or + the handle for the component prefixed with `handle:` Returns: Component: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/components/{component_id}.json') + .path("/product_families/{product_family_id}/components/{component_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Component.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_components(self, options=dict()): - """Does a GET request to /components.json. + """Perform a GET request to /components.json. This request will return a list of components for a site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - date_field -- BasicDateField -- The type of filter you - would like to apply to your search. - start_date -- str -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns - components with a timestamp at or after midnight - (12:00:00 AM) in your site’s time zone on the date - specified. - end_date -- str -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns components - with a timestamp up to and including 11:59:59PM in - your site’s time zone on the date specified. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + date_field -- BasicDateField -- The type of filter you would like + to apply to your search. + start_date -- str -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns components with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + end_date -- str -- The end date (format YYYY-MM-DD) with which to + filter the date_field. Returns components with a timestamp up + to and including 11:59:59PM in your site’s time zone on the + date specified. start_datetime -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. - end_datetime -- str -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of end_date. optional + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns components with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. + end_datetime -- str -- The end date and time (format YYYY-MM-DD + HH:MM:SS) with which to filter the date_field. Returns + components with a timestamp at or before exact time provided + in query. You can specify timezone in query - otherwise your + site's time zone will be used. If provided, this parameter + will be used instead of end_date. optional include_archived -- bool -- Include archived items - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. filter -- ListComponentsFilter -- Filter to use for List Components operations @@ -611,220 +620,209 @@ def list_components(self, List[ComponentResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components.json') + .path("/components.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(options.get('start_datetime', None))) + .key("start_datetime") + .value(options.get("start_datetime", None))) .query_param(Parameter() - .key('end_datetime') - .value(options.get('end_datetime', None))) + .key("end_datetime") + .value(options.get("end_datetime", None))) .query_param(Parameter() - .key('include_archived') - .value(options.get('include_archived', None))) + .key("include_archived") + .value(options.get("include_archived", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentResponse.from_dictionary) + .deserialize_into(ComponentResponse.from_dictionary), ).execute() def update_component(self, component_id, body=None): - """Does a PUT request to /components/{component_id}.json. + """Perform a PUT request to /components/{component_id}.json. This request will update a component. - You may read the component by either the component's id or handle. - When using the handle, it must be prefixed with `handle:`. + You may read the component by either the component's id or handle. When using + the handle, it must be prefixed with `handle:`. Args: component_id (str): The id or handle of the component - body (UpdateComponentRequest, optional): The request body - parameter. + body (UpdateComponentRequest, optional): The request body parameter. Returns: ComponentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}.json') + .path("/components/{component_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_components_for_product_family(self, options=dict()): - """Does a GET request to /product_families/{product_family_id}/components.json. + """Perform a GET request to + /product_families/{product_family_id}/components.json. - This request will return a list of components for a particular product - family. + This request will return a list of components for a particular product family. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: product_family_id -- int -- The Advanced Billing id of the product family include_archived -- bool -- Include archived items. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. filter -- ListComponentsFilter -- Filter to use for List Components operations - date_field -- BasicDateField -- The type of filter you - would like to apply to your search. Use in query - `date_field=created_at`. - end_date -- str -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns components - with a timestamp up to and including 11:59:59PM in - your site’s time zone on the date specified. - end_datetime -- str -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of end_date. optional. - start_date -- str -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns - components with a timestamp at or after midnight - (12:00:00 AM) in your site’s time zone on the date - specified. + date_field -- BasicDateField -- The type of filter you would like + to apply to your search. Use in query `date_field=created_at`. + end_date -- str -- The end date (format YYYY-MM-DD) with which to + filter the date_field. Returns components with a timestamp up + to and including 11:59:59PM in your site’s time zone on the + date specified. + end_datetime -- str -- The end date and time (format YYYY-MM-DD + HH:MM:SS) with which to filter the date_field. Returns + components with a timestamp at or before exact time provided + in query. You can specify timezone in query - otherwise your + site's time zone will be used. If provided, this parameter + will be used instead of end_date. optional. + start_date -- str -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns components with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. start_datetime -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns components with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. Returns: List[ComponentResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/components.json') + .path("/product_families/{product_family_id}/components.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_family_id') - .value(options.get('product_family_id', None)) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(options.get("product_family_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('include_archived') - .value(options.get('include_archived', None))) + .key("include_archived") + .value(options.get("include_archived", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('end_datetime') - .value(options.get('end_datetime', None))) + .key("end_datetime") + .value(options.get("end_datetime", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(options.get('start_datetime', None))) + .key("start_datetime") + .value(options.get("start_datetime", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ComponentResponse.from_dictionary) + .deserialize_into(ComponentResponse.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/coupons_controller.py b/advancedbilling/controllers/coupons_controller.py index 747767bd..5c86e912 100644 --- a/advancedbilling/controllers/coupons_controller.py +++ b/advancedbilling/controllers/coupons_controller.py @@ -1,322 +1,341 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController -from apimatic_core.request_builder import RequestBuilder -from apimatic_core.response_handler import ResponseHandler -from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.coupon_response import CouponResponse -from advancedbilling.models.coupon_usage import CouponUsage -from advancedbilling.models.coupon_currency_response import CouponCurrencyResponse -from advancedbilling.models.coupon_subcodes_response import CouponSubcodesResponse -from advancedbilling.models.coupon_subcodes import CouponSubcodes -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.single_string_error_response_exception import SingleStringErrorResponseException -from advancedbilling.exceptions.error_string_map_response_exception import ErrorStringMapResponseException -from advancedbilling.exceptions.api_exception import APIException - - -class CouponsController(BaseController): - - """A Controller to access Endpoints in the advancedbilling API.""" - def __init__(self, config): - super(CouponsController, self).__init__(config) +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) +from apimatic_core.request_builder import RequestBuilder +from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) +from apimatic_core.types.parameter import Parameter + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.exceptions.error_string_map_response_exception import ( + ErrorStringMapResponseException, +) +from advancedbilling.exceptions.single_string_error_response_exception import ( + SingleStringErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.coupon_currency_response import ( + CouponCurrencyResponse, +) +from advancedbilling.models.coupon_response import ( + CouponResponse, +) +from advancedbilling.models.coupon_subcodes import ( + CouponSubcodes, +) +from advancedbilling.models.coupon_subcodes_response import ( + CouponSubcodesResponse, +) +from advancedbilling.models.coupon_usage import ( + CouponUsage, +) + + +class CouponsController(BaseController): + """A Controller to access Endpoints in the advancedbilling API.""" + + def __init__(self, config): + """Initialize CouponsController object.""" + super(CouponsController, self).__init__(config) def create_coupon(self, product_family_id, - body=None): - """Does a POST request to /product_families/{product_family_id}/coupons.json. + body=None): + """Perform a POST request to + /product_families/{product_family_id}/coupons.json. ## Coupons Documentation - Coupons can be administered in the Advanced Billing application or - created via API. View our section on [creating - coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Cre - ating-Editing-Deleting-Coupons) for more information. - Additionally, for documentation on how to apply a coupon to a - subscription within the Advanced Billing UI, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupo - ns-and-Subscriptions). + Coupons can be administered in the Advanced Billing application or created + via API. View our section on [creating + coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-E + diting-Deleting-Coupons) for more information. + Additionally, for documentation on how to apply a coupon to a subscription + within the Advanced Billing UI, see our documentation + [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and- + Subscriptions). ## Create Coupon This request will create a coupon, based on the provided information. - You can create either a flat amount coupon, by specyfing - `amount_in_cents`, or percentage coupon by specyfing `percentage`. - You can restrict a coupon to only apply to specific products / - components by optionally passing in `restricted_products` and/or - `restricted_components` objects in the format: + You can create either a flat amount coupon, by specyfing `amount_in_cents`, + or percentage coupon by specyfing `percentage`. + You can restrict a coupon to only apply to specific products / components by + optionally passing in `restricted_products` and/or `restricted_components` + objects in the format: `{ "": boolean_value }` Args: - product_family_id (int): The Advanced Billing id of the product - family to which the coupon belongs + product_family_id (int): The Advanced Billing id of the product family to + which the coupon belongs body (CouponRequest, optional): The request body parameter. Returns: CouponResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/coupons.json') + .path("/product_families/{product_family_id}/coupons.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CouponResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_coupons_for_product_family(self, - options=dict()): - """Does a GET request to /product_families/{product_family_id}/coupons.json. + options=dict()): + """Perform a GET request to + /product_families/{product_family_id}/coupons.json. List coupons for a specific Product Family in a Site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: product_family_id -- int -- The Advanced Billing id of the product family to which the coupon belongs - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 30. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - filter -- ListCouponsFilter -- Filter to use for List - Coupons operations - currency_prices -- bool -- When fetching coupons, if you - have defined multiple currencies at the site level, - you can optionally pass the `?currency_prices=true` - query param to include an array of currency price data - in the response. Use in query `currency_prices=true`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 30. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + filter -- ListCouponsFilter -- Filter to use for List Coupons + operations + currency_prices -- bool -- When fetching coupons, if you have + defined multiple currencies at the site level, you can + optionally pass the `?currency_prices=true` query param to + include an array of currency price data in the response. Use + in query `currency_prices=true`. Returns: List[CouponResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/coupons.json') + .path("/product_families/{product_family_id}/coupons.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_family_id') - .value(options.get('product_family_id', None)) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(options.get("product_family_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('currency_prices') - .value(options.get('currency_prices', None))) + .key("currency_prices") + .value(options.get("currency_prices", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) + .deserialize_into(CouponResponse.from_dictionary), ).execute() def find_coupon(self, product_family_id=None, code=None, - currency_prices=None): - """Does a GET request to /coupons/find.json. + currency_prices=None): + """Perform a GET request to /coupons/find.json. - You can search for a coupon via the API with the find method. By - passing a code parameter, the find will attempt to locate a coupon - that matches that code. If no coupon is found, a 404 is returned. - If you have more than one product family and if the coupon you are - trying to find does not belong to the default product family in your - site, then you will need to specify (either in the url or as a query - string param) the product family id. + You can search for a coupon via the API with the find method. By passing a + code parameter, the find will attempt to locate a coupon that matches that + code. If no coupon is found, a 404 is returned. + If you have more than one product family and if the coupon you are trying to + find does not belong to the default product family in your site, then you + will need to specify (either in the url or as a query string param) the + product family id. Args: - product_family_id (int, optional): The Advanced Billing id of the - product family to which the coupon belongs + product_family_id (int, optional): The Advanced Billing id of the product + family to which the coupon belongs code (str, optional): The code of the coupon - currency_prices (bool, optional): When fetching coupons, if you - have defined multiple currencies at the site level, you can - optionally pass the `?currency_prices=true` query param to - include an array of currency price data in the response. + currency_prices (bool, optional): When fetching coupons, if you have + defined multiple currencies at the site level, you can optionally + pass the `?currency_prices=true` query param to include an array of + currency price data in the response. Returns: CouponResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons/find.json') + .path("/coupons/find.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('product_family_id') - .value(product_family_id)) + .key("product_family_id") + .value(product_family_id)) .query_param(Parameter() - .key('code') - .value(code)) + .key("code") + .value(code)) .query_param(Parameter() - .key('currency_prices') - .value(currency_prices)) + .key("currency_prices") + .value(currency_prices)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) + .deserialize_into(CouponResponse.from_dictionary), ).execute() def read_coupon(self, product_family_id, coupon_id, - currency_prices=None): - """Does a GET request to /product_families/{product_family_id}/coupons/{coupon_id}.json. + currency_prices=None): + """Perform a GET request to + /product_families/{product_family_id}/coupons/{coupon_id}.json. You can retrieve the Coupon via the API with the Show method. You must - identify the Coupon in this call by the ID parameter that Advanced - Billing assigns. - If instead you would like to find a Coupon using a Coupon code, see - the Coupon Find method. - When fetching a coupon, if you have defined multiple currencies at the - site level, you can optionally pass the `?currency_prices=true` query - param to include an array of currency price data in the response. + identify the Coupon in this call by the ID parameter that Advanced Billing + assigns. + If instead you would like to find a Coupon using a Coupon code, see the + Coupon Find method. + When fetching a coupon, if you have defined multiple currencies at the site + level, you can optionally pass the `?currency_prices=true` query param to + include an array of currency price data in the response. If the coupon is set to `use_site_exchange_rate: true`, it will return - pricing based on the current exchange rate. If the flag is set to - false, it will return all of the defined prices for each currency. + pricing based on the current exchange rate. If the flag is set to false, it + will return all of the defined prices for each currency. Args: - product_family_id (int): The Advanced Billing id of the product - family to which the coupon belongs + product_family_id (int): The Advanced Billing id of the product family to + which the coupon belongs coupon_id (int): The Advanced Billing id of the coupon - currency_prices (bool, optional): When fetching coupons, if you - have defined multiple currencies at the site level, you can - optionally pass the `?currency_prices=true` query param to - include an array of currency price data in the response. + currency_prices (bool, optional): When fetching coupons, if you have + defined multiple currencies at the site level, you can optionally + pass the `?currency_prices=true` query param to include an array of + currency price data in the response. Returns: CouponResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/coupons/{coupon_id}.json') + .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('currency_prices') - .value(currency_prices)) + .key("currency_prices") + .value(currency_prices)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) + .deserialize_into(CouponResponse.from_dictionary), ).execute() def update_coupon(self, product_family_id, coupon_id, - body=None): - """Does a PUT request to /product_families/{product_family_id}/coupons/{coupon_id}.json. + body=None): + """Perform a PUT request to + /product_families/{product_family_id}/coupons/{coupon_id}.json. ## Update Coupon You can update a Coupon via the API with a PUT request to the resource endpoint. - You can restrict a coupon to only apply to specific products / - components by optionally passing in hashes of `restricted_products` - and/or `restricted_components` in the format: + You can restrict a coupon to only apply to specific products / components by + optionally passing in hashes of `restricted_products` and/or + `restricted_components` in the format: `{ "": boolean_value }` Args: - product_family_id (int): The Advanced Billing id of the product - family to which the coupon belongs + product_family_id (int): The Advanced Billing id of the product family to + which the coupon belongs coupon_id (int): The Advanced Billing id of the coupon body (CouponRequest, optional): The request body parameter. @@ -324,299 +343,291 @@ def update_coupon(self, CouponResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/coupons/{coupon_id}.json') + .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CouponResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def archive_coupon(self, product_family_id, - coupon_id): - """Does a DELETE request to /product_families/{product_family_id}/coupons/{coupon_id}.json. + coupon_id): + """Perform a DELETE request to + /product_families/{product_family_id}/coupons/{coupon_id}.json. You can archive a Coupon via the API with the archive method. - Archiving makes that Coupon unavailable for future use, but allows it - to remain attached and functional on existing Subscriptions that are - using it. + Archiving makes that Coupon unavailable for future use, but allows it to + remain attached and functional on existing Subscriptions that are using it. The `archived_at` date and time will be assigned. Args: - product_family_id (int): The Advanced Billing id of the product - family to which the coupon belongs + product_family_id (int): The Advanced Billing id of the product family to + which the coupon belongs coupon_id (int): The Advanced Billing id of the coupon Returns: CouponResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/coupons/{coupon_id}.json') + .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) + .deserialize_into(CouponResponse.from_dictionary), ).execute() def list_coupons(self, - options=dict()): - """Does a GET request to /coupons.json. + options=dict()): + """Perform a GET request to /coupons.json. You can retrieve a list of coupons. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 30. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - filter -- ListCouponsFilter -- Filter to use for List - Coupons operations - currency_prices -- bool -- When fetching coupons, if you - have defined multiple currencies at the site level, - you can optionally pass the `?currency_prices=true` - query param to include an array of currency price data - in the response. Use in query `currency_prices=true`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 30. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + filter -- ListCouponsFilter -- Filter to use for List Coupons + operations + currency_prices -- bool -- When fetching coupons, if you have + defined multiple currencies at the site level, you can + optionally pass the `?currency_prices=true` query param to + include an array of currency price data in the response. Use + in query `currency_prices=true`. Returns: List[CouponResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons.json') + .path("/coupons.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('currency_prices') - .value(options.get('currency_prices', None))) + .key("currency_prices") + .value(options.get("currency_prices", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) + .deserialize_into(CouponResponse.from_dictionary), ).execute() def read_coupon_usage(self, product_family_id, - coupon_id): - """Does a GET request to /product_families/{product_family_id}/coupons/{coupon_id}/usage.json. + coupon_id): + """Perform a GET request to + /product_families/{product_family_id}/coupons/{coupon_id}/usage.json. - This request will provide details about the coupon usage as an array - of data hashes, one per product. + This request will provide details about the coupon usage as an array of data + hashes, one per product. Args: - product_family_id (int): The Advanced Billing id of the product - family to which the coupon belongs. + product_family_id (int): The Advanced Billing id of the product family to + which the coupon belongs. coupon_id (int): The Advanced Billing id of the coupon. Returns: List[CouponUsage]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/coupons/{coupon_id}/usage.json') + .path("/product_families/{product_family_id}/coupons/{coupon_id}/usage.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponUsage.from_dictionary) + .deserialize_into(CouponUsage.from_dictionary), ).execute() def validate_coupon(self, code, - product_family_id=None): - """Does a GET request to /coupons/validate.json. + product_family_id=None): + """Perform a GET request to /coupons/validate.json. You can verify if a specific coupon code is valid using the `validate` - method. This method is useful for validating coupon codes that are - entered by a customer. If the coupon is found and is valid, the coupon - will be returned with a 200 status code. - If the coupon is invalid, the status code will be 404 and the response - will say why it is invalid. If the coupon is valid, the status code - will be 200 and the coupon will be returned. The following reasons for - invalidity are supported: + method. This method is useful for validating coupon codes that are entered by + a customer. If the coupon is found and is valid, the coupon will be returned + with a 200 status code. + If the coupon is invalid, the status code will be 404 and the response will + say why it is invalid. If the coupon is valid, the status code will be 200 + and the coupon will be returned. The following reasons for invalidity are + supported: + Coupon not found + Coupon is invalid + Coupon expired - If you have more than one product family and if the coupon you are - validating does not belong to the first product family in your site, - then you will need to specify the product family, either in the url or - as a query string param. This can be done by supplying the id or the - handle in the `handle:my-family` format. + If you have more than one product family and if the coupon you are validating + does not belong to the first product family in your site, then you will need + to specify the product family, either in the url or as a query string param. + This can be done by supplying the id or the handle in the `handle:my-family` + format. Eg. ``` - https://.chargify.com/product_families/handle:/coupons/validate.?code= + https://.chargify.com/product_families/handle:/coupons/validate.?code= ``` Or: ``` - https://.chargify.com/coupons/validate.?code=&product_family_id= + https://.chargify.com/coupons/validate.?code=& + product_family_id= ``` Args: code (str): The code of the coupon - product_family_id (int, optional): The Advanced Billing id of the - product family to which the coupon belongs + product_family_id (int, optional): The Advanced Billing id of the product + family to which the coupon belongs Returns: CouponResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons/validate.json') + .path("/coupons/validate.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('code') - .value(code) - .is_required(True)) + .key("code") + .value(code) + .is_required(True)) .query_param(Parameter() - .key('product_family_id') - .value(product_family_id)) + .key("product_family_id") + .value(product_family_id)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CouponResponse.from_dictionary) - .local_error_template('404', 'Not Found: \'{$response.body}\'', SingleStringErrorResponseException) + .local_error_template("404", + "Not Found: '{$response.body}'", + SingleStringErrorResponseException), ).execute() def create_or_update_coupon_currency_prices(self, coupon_id, - body=None): - """Does a PUT request to /coupons/{coupon_id}/currency_prices.json. - - This endpoint allows you to create and/or update currency prices for - an existing coupon. Multiple prices can be created or updated in a - single request but each of the currencies must be defined on the site - level already and the coupon must be an amount-based coupon, not - percentage. - Currency pricing for coupons must mirror the setup of the primary - coupon pricing - if the primary coupon is percentage based, you will - not be able to define pricing in non-primary currencies. + body=None): + """Perform a PUT request to /coupons/{coupon_id}/currency_prices.json. + + This endpoint allows you to create and/or update currency prices for an + existing coupon. Multiple prices can be created or updated in a single + request but each of the currencies must be defined on the site level already + and the coupon must be an amount-based coupon, not percentage. + Currency pricing for coupons must mirror the setup of the primary coupon + pricing - if the primary coupon is percentage based, you will not be able to + define pricing in non-primary currencies. Args: coupon_id (int): The Advanced Billing id of the coupon @@ -626,47 +637,48 @@ def create_or_update_coupon_currency_prices(self, CouponCurrencyResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons/{coupon_id}/currency_prices.json') + .path("/coupons/{coupon_id}/currency_prices.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CouponCurrencyResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorStringMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorStringMapResponseException), ).execute() def create_coupon_subcodes(self, coupon_id, - body=None): - """Does a POST request to /coupons/{coupon_id}/codes.json. + body=None): + """Perform a POST request to /coupons/{coupon_id}/codes.json. ## Coupon Subcodes Intro - Coupon Subcodes allow you to create a set of unique codes that allow - you to expand the use of one coupon. + Coupon Subcodes allow you to create a set of unique codes that allow you to + expand the use of one coupon. For example: Master Coupon Code: + SPRING2020 @@ -674,34 +686,33 @@ def create_coupon_subcodes(self, + SPRING90210 + DP80302 + SPRINGBALTIMORE - Coupon subcodes can be administered in the Admin Interface or via the - API. - When creating a coupon subcode, you must specify a coupon to attach it - to using the coupon_id. Valid coupon subcodes are all capital letters, - contain only letters and numbers, and do not have any spaces. - Lowercase letters will be capitalized before the subcode is created. + Coupon subcodes can be administered in the Admin Interface or via the API. + When creating a coupon subcode, you must specify a coupon to attach it to + using the coupon_id. Valid coupon subcodes are all capital letters, contain + only letters and numbers, and do not have any spaces. Lowercase letters will + be capitalized before the subcode is created. ## Coupon Subcodes Documentation - Full documentation on how to create coupon subcodes in the Advanced - Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupo - n-Codes). - Additionally, for documentation on how to apply a coupon to a - Subscription within the Advanced Billing UI, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupo - ns-and-Subscriptions). + Full documentation on how to create coupon subcodes in the Advanced Billing + UI can be located + [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes + ). + Additionally, for documentation on how to apply a coupon to a Subscription + within the Advanced Billing UI, see our documentation + [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and- + Subscriptions). ## Create Coupon Subcode - This request allows you to create specific subcodes underneath an - existing coupon code. - *Note*: If you are using any of the allowed special characters ("%", - "@", "+", "-", "_", and "."), you must encode them for use in the URL. + This request allows you to create specific subcodes underneath an existing + coupon code. + *Note*: If you are using any of the allowed special characters ("%", "@", + "+", "-", "_", and "."), you must encode them for use in the URL. % to %25 @ to %40 + to %2B - to %2D _ to %5F . to %2E - So, if the coupon subcode is `20%OFF`, the URL to delete this coupon - subcode would be: + So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode + would be: `https://.chargify.com/coupons/567/codes/20%25OFF.` Args: @@ -712,114 +723,106 @@ def create_coupon_subcodes(self, CouponSubcodesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons/{coupon_id}/codes.json') + .path("/coupons/{coupon_id}/codes.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponSubcodesResponse.from_dictionary) + .deserialize_into(CouponSubcodesResponse.from_dictionary), ).execute() def list_coupon_subcodes(self, - options=dict()): - """Does a GET request to /coupons/{coupon_id}/codes.json. + options=dict()): + """Perform a GET request to /coupons/{coupon_id}/codes.json. - This request allows you to request the subcodes that are attached to a - coupon. + This request allows you to request the subcodes that are attached to a coupon. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: coupon_id -- int -- The Advanced Billing id of the coupon - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. Returns: CouponSubcodes: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons/{coupon_id}/codes.json') + .path("/coupons/{coupon_id}/codes.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('coupon_id') - .value(options.get('coupon_id', None)) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(options.get("coupon_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponSubcodes.from_dictionary) + .deserialize_into(CouponSubcodes.from_dictionary), ).execute() def update_coupon_subcodes(self, coupon_id, - body=None): - """Does a PUT request to /coupons/{coupon_id}/codes.json. + body=None): + """Perform a PUT request to /coupons/{coupon_id}/codes.json. - You can update the subcodes for the given Coupon via the API with a - PUT request to the resource endpoint. + You can update the subcodes for the given Coupon via the API with a PUT + request to the resource endpoint. Send an array of new coupon subcodes. - **Note**: All current subcodes for that Coupon will be deleted first, - and replaced with the list of subcodes sent to this endpoint. + **Note**: All current subcodes for that Coupon will be deleted first, and + replaced with the list of subcodes sent to this endpoint. The response will contain: + The created subcodes, + Subcodes that were not created because they already exist, @@ -833,51 +836,50 @@ def update_coupon_subcodes(self, CouponSubcodesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons/{coupon_id}/codes.json') + .path("/coupons/{coupon_id}/codes.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponSubcodesResponse.from_dictionary) + .deserialize_into(CouponSubcodesResponse.from_dictionary), ).execute() def delete_coupon_subcode(self, coupon_id, - subcode): - """Does a DELETE request to /coupons/{coupon_id}/codes/{subcode}.json. + subcode): + """Perform a DELETE request to + /coupons/{coupon_id}/codes/{subcode}.json. ## Example - Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the - URL to `DELETE` this coupon subcode would be: + Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL to + `DELETE` this coupon subcode would be: ``` http://subdomain.chargify.com/coupons/567/codes/20OFF. ``` - Note: If you are using any of the allowed special characters (“%”, - “@”, “+”, “-”, “_”, and “.”), you must encode them for use in the URL. + Note: If you are using any of the allowed special characters (“%”, “@”, “+”, + “-”, “_”, and “.”), you must encode them for use in the URL. | Special character | Encoding | |-------------------|----------| | % | %25 | @@ -887,39 +889,37 @@ def delete_coupon_subcode(self, | _ | %5F | | . | %2E | ## Percent Encoding Example - Or if the coupon subcode is 20%OFF, the URL to delete this coupon - subcode would be: + Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode + would be: @https://.chargify.com/coupons/567/codes/20%25OFF. Args: - coupon_id (int): The Advanced Billing id of the coupon to which - the subcode belongs + coupon_id (int): The Advanced Billing id of the coupon to which the + subcode belongs subcode (str): The subcode of the coupon Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. - - """ + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + """ return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/coupons/{coupon_id}/codes/{subcode}.json') + .path("/coupons/{coupon_id}/codes/{subcode}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('coupon_id') - .value(coupon_id) - .is_required(True) - .should_encode(True)) + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('subcode') - .value(subcode) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("subcode") + .value(subcode) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() diff --git a/advancedbilling/controllers/custom_fields_controller.py b/advancedbilling/controllers/custom_fields_controller.py index 691b7788..df2ea95d 100644 --- a/advancedbilling/controllers/custom_fields_controller.py +++ b/advancedbilling/controllers/custom_fields_controller.py @@ -1,328 +1,332 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.metafield import Metafield -from advancedbilling.models.list_metafields_response import ListMetafieldsResponse -from advancedbilling.models.metadata import Metadata -from advancedbilling.models.paginated_metadata import PaginatedMetadata -from advancedbilling.exceptions.single_error_response_exception import SingleErrorResponseException -from advancedbilling.exceptions.api_exception import APIException + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.single_error_response_exception import ( + SingleErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_metafields_response import ( + ListMetafieldsResponse, +) +from advancedbilling.models.metadata import ( + Metadata, +) +from advancedbilling.models.metafield import ( + Metafield, +) +from advancedbilling.models.paginated_metadata import ( + PaginatedMetadata, +) class CustomFieldsController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize CustomFieldsController object.""" super(CustomFieldsController, self).__init__(config) def create_metafields(self, resource_type, body=None): - """Does a POST request to /{resource_type}/metafields.json. + """Perform a POST request to /{resource_type}/metafields.json. Creates metafields on a Site for either the Subscriptions or Customers - resource. - Metafields and their metadata are created in the Custom Fields - configuration page on your Site. Metafields can be populated with - metadata when you create them or later with the [Update + resource. + Metafields and their metadata are created in the Custom Fields configuration + page on your Site. Metafields can be populated with metadata when you create + them or later with the [Update Metafield]($e/Custom%20Fields/updateMetafield), [Create Metadata]($e/Custom%20Fields/createMetadata), or [Update - Metadata]($e/Custom%20Fields/updateMetadata) endpoints. The Create - Metadata and Update Metadata endpoints allow you to add metafields and - metadata values to a specific subscription or customer. - Each site is limited to 100 unique metafields per resource. This means - you can have 100 metafields for Subscriptions and another 100 for - Customers. - > Note: After creating a metafield, the resource type cannot be - modified. - In the UI and product documentation, metafields and metadata are - called Custom Fields. + Metadata]($e/Custom%20Fields/updateMetadata) endpoints. The Create Metadata + and Update Metadata endpoints allow you to add metafields and metadata values + to a specific subscription or customer. + Each site is limited to 100 unique metafields per resource. This means you + can have 100 metafields for Subscriptions and another 100 for Customers. + > Note: After creating a metafield, the resource type cannot be modified. + In the UI and product documentation, metafields and metadata are called + Custom Fields. - Metafield is the custom field - Metadata is the data populating the custom field. See [Custom Fields - Reference](https://docs.maxio.com/hc/en-us/articles/24266140850573-Cust - om-Fields-Reference) and [Custom Fields - Tab](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscri - ption-Summary-Custom-Fields-Tab) for information on using Custom - Fields in the Advanced Billing UI. + Reference](https://docs.maxio.com/hc/en-us/articles/24266140850573-Custom-Fiel + ds-Reference) and [Custom Fields + Tab](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscription-S + ummary-Custom-Fields-Tab) for information on using Custom Fields in the + Advanced Billing UI. Args: - resource_type (ResourceType): The resource type to which the - metafields belong. - body (CreateMetafieldsRequest, optional): The request body - parameter. + resource_type (ResourceType): The resource type to which the metafields + belong. + body (CreateMetafieldsRequest, optional): The request body parameter. Returns: List[Metafield]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/metafields.json') + .path("/{resource_type}/metafields.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('resource_type') - .value(resource_type) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(resource_type) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Metafield.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SingleErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SingleErrorResponseException), ).execute() def list_metafields(self, options=dict()): - """Does a GET request to /{resource_type}/metafields.json. + """Perform a GET request to /{resource_type}/metafields.json. - Lists the metafields and their associated details for a Site and - resource type. You can filter the request to a specific metafield. + Lists the metafields and their associated details for a Site and resource + type. You can filter the request to a specific metafield. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - resource_type -- ResourceType -- The resource type to - which the metafields belong. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + resource_type -- ResourceType -- The resource type to which the + metafields belong. name -- str -- Filter by the name of the metafield. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. Returns: ListMetafieldsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/metafields.json') + .path("/{resource_type}/metafields.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('resource_type') - .value(options.get('resource_type', None)) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(options.get("resource_type", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('name') - .value(options.get('name', None))) + .key("name") + .value(options.get("name", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListMetafieldsResponse.from_dictionary) + .deserialize_into(ListMetafieldsResponse.from_dictionary), ).execute() def update_metafield(self, resource_type, body=None): - """Does a PUT request to /{resource_type}/metafields.json. + """Perform a PUT request to /{resource_type}/metafields.json. Updates metafields on your Site for a resource type. Depending on the - request structure, you can update or add metafields and metadata to - the Subscriptions or Customers resource. - With this endpoint, you can: - - Add metafields. If the metafield specified in current_name does not - exist, a new metafield is added. - >Note: Each site is limited to 100 unique metafields per resource. - This means you can have 100 metafields for Subscriptions and another - 100 for Customers. - - Change the name of a metafield. - >Note: To keep the metafield name the same and only update the - metadata for the metafield, you must use the current metafield name in - both the `current_name` and `name` parameters. - - Change the input type for the metafield. For example, you can change - a metafield input type from text to a dropdown. If you change the - input type from text to a dropdown or radio, you must update the - specific subscriptions or customers where the metafield was used to - reflect the updated metafield and metadata. + request structure, you can update or add metafields and metadata to the + Subscriptions or Customers resource. + With this endpoint, you can: + - Add metafields. If the metafield specified in current_name does not exist, + a new metafield is added. + >Note: Each site is limited to 100 unique metafields per resource. This + means you can have 100 metafields for Subscriptions and another 100 for + Customers. + - Change the name of a metafield. + >Note: To keep the metafield name the same and only update the metadata for + the metafield, you must use the current metafield name in both the + `current_name` and `name` parameters. + - Change the input type for the metafield. For example, you can change a + metafield input type from text to a dropdown. If you change the input type + from text to a dropdown or radio, you must update the specific subscriptions + or customers where the metafield was used to reflect the updated metafield + and metadata. - Add metadata values to the existing metadata for a dropdown or radio - metafield. - >Note: Updates to metadata overwrite. To add one or more values, you - must specify all metadata values including the new value you want to - add. - - Add new metadata to a dropdown or radio for a metafield that was - created without metadata. - - Remove metadata for a dropdown or radio for a metafield. - >Note: Updates to metadata overwrite existing values. To remove one - or more values, specify all metadata values except those you want to - remove. + metafield. + >Note: Updates to metadata overwrite. To add one or more values, you must + specify all metadata values including the new value you want to add. + - Add new metadata to a dropdown or radio for a metafield that was created + without metadata. + - Remove metadata for a dropdown or radio for a metafield. + >Note: Updates to metadata overwrite existing values. To remove one or more + values, specify all metadata values except those you want to remove. - Add or update scope settings for a metafield. - >Note: Scope changes overwrite existing settings. You must specify - the complete scope, including the changes you want to make. + >Note: Scope changes overwrite existing settings. You must specify the + complete scope, including the changes you want to make. Args: - resource_type (ResourceType): The resource type to which the - metafields belong. - body (UpdateMetafieldsRequest, optional): The request body - parameter. + resource_type (ResourceType): The resource type to which the metafields + belong. + body (UpdateMetafieldsRequest, optional): The request body parameter. Returns: List[Metafield]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/metafields.json') + .path("/{resource_type}/metafields.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('resource_type') - .value(resource_type) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(resource_type) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Metafield.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SingleErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SingleErrorResponseException), ).execute() def delete_metafield(self, resource_type, name=None): - """Does a DELETE request to /{resource_type}/metafields.json. + """Perform a DELETE request to /{resource_type}/metafields.json. - Deletes a metafield from your Site. Removes the metafield and - associated metadata from all Subscriptions or Customers resources on - the Site. + Deletes a metafield from your Site. Removes the metafield and associated + metadata from all Subscriptions or Customers resources on the Site. Args: - resource_type (ResourceType): The resource type to which the - metafields belong. + resource_type (ResourceType): The resource type to which the metafields + belong. name (str, optional): The name of the metafield to be deleted Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/metafields.json') + .path("/{resource_type}/metafields.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('resource_type') - .value(resource_type) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(resource_type) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('name') - .value(name)) - .auth(Single('BasicAuth')) + .key("name") + .value(name)) + .auth(Single("BasicAuth")), ).execute() def create_metadata(self, resource_type, resource_id, body=None): - """Does a POST request to /{resource_type}/{resource_id}/metadata.json. - - Creates metadata and metafields for a specific subscription or - customer, or updates metadata values of existing metafields for a - subscription or customer. Metadata values are limited to 2 KB in size. - If you create metadata on a subscription or customer with a metafield - that does not already exist, the metafield is created with the - metadata you specify and it is always added as a text field. You can - update the input_type for the metafield with the [Update - Metafield]($e/Custom%20Fields/updateMetafield) endpoint. - >Note: Each site is limited to 100 unique metafields per resource. - This means you can have 100 metafields for Subscriptions and another - 100 for Customers. + """Perform a POST request to + /{resource_type}/{resource_id}/metadata.json. + + Creates metadata and metafields for a specific subscription or customer, or + updates metadata values of existing metafields for a subscription or + customer. Metadata values are limited to 2 KB in size. + If you create metadata on a subscription or customer with a metafield that + does not already exist, the metafield is created with the metadata you + specify and it is always added as a text field. You can update the input_type + for the metafield with the [Update + Metafield]($e/Custom%20Fields/updateMetafield) endpoint. + >Note: Each site is limited to 100 unique metafields per resource. This means + you can have 100 metafields for Subscriptions and another 100 for Customers. Args: - resource_type (ResourceType): The resource type to which the - metafields belong. + resource_type (ResourceType): The resource type to which the metafields + belong. resource_id (int): The Advanced Billing id of the customer or the subscription for which the metadata applies body (CreateMetadataRequest, optional): The request body parameter. @@ -331,139 +335,134 @@ def create_metadata(self, List[Metadata]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/{resource_id}/metadata.json') + .path("/{resource_type}/{resource_id}/metadata.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('resource_type') - .value(resource_type) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(resource_type) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('resource_id') - .value(resource_id) - .is_required(True) - .should_encode(True)) + .key("resource_id") + .value(resource_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Metadata.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SingleErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SingleErrorResponseException), ).execute() def list_metadata(self, options=dict()): - """Does a GET request to /{resource_type}/{resource_id}/metadata.json. + """Perform a GET request to + /{resource_type}/{resource_id}/metadata.json. Lists metadata and metafields for a specific customer or subscription. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - resource_type -- ResourceType -- The resource type to - which the metafields belong. - resource_id -- int -- The Advanced Billing id of the - customer or the subscription for which the metadata - applies - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + resource_type -- ResourceType -- The resource type to which the + metafields belong. + resource_id -- int -- The Advanced Billing id of the customer or + the subscription for which the metadata applies + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. Returns: PaginatedMetadata: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/{resource_id}/metadata.json') + .path("/{resource_type}/{resource_id}/metadata.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('resource_type') - .value(options.get('resource_type', None)) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(options.get("resource_type", None)) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('resource_id') - .value(options.get('resource_id', None)) - .is_required(True) - .should_encode(True)) + .key("resource_id") + .value(options.get("resource_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(PaginatedMetadata.from_dictionary) + .deserialize_into(PaginatedMetadata.from_dictionary), ).execute() def update_metadata(self, resource_type, resource_id, body=None): - """Does a PUT request to /{resource_type}/{resource_id}/metadata.json. - - Updates metadata and metafields on the Site and the customer or - subscription specified, and updates the metadata value on a - subscription or customer. - If you update metadata on a subscription or customer with a metafield - that does not already exist, the metafield is created with the - metadata you specify and it is always added as a text field to the - Site and to the subscription or customer you specify. You can update - the input_type for the metafield with the Update Metafield endpoint. - Each site is limited to 100 unique metafields per resource. This means - you can have 100 metafields for Subscription and another 100 for - Customer. + """Perform a PUT request to + /{resource_type}/{resource_id}/metadata.json. + + Updates metadata and metafields on the Site and the customer or subscription + specified, and updates the metadata value on a subscription or customer. + If you update metadata on a subscription or customer with a metafield that + does not already exist, the metafield is created with the metadata you + specify and it is always added as a text field to the Site and to the + subscription or customer you specify. You can update the input_type for the + metafield with the Update Metafield endpoint. + Each site is limited to 100 unique metafields per resource. This means you + can have 100 metafields for Subscription and another 100 for Customer. Args: - resource_type (ResourceType): The resource type to which the - metafields belong. + resource_type (ResourceType): The resource type to which the metafields + belong. resource_id (int): The Advanced Billing id of the customer or the subscription for which the metadata applies body (UpdateMetadataRequest, optional): The request body parameter. @@ -472,42 +471,43 @@ def update_metadata(self, List[Metadata]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/{resource_id}/metadata.json') + .path("/{resource_type}/{resource_id}/metadata.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('resource_type') - .value(resource_type) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(resource_type) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('resource_id') - .value(resource_id) - .is_required(True) - .should_encode(True)) + .key("resource_id") + .value(resource_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Metadata.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SingleErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SingleErrorResponseException), ).execute() def delete_metadata(self, @@ -515,174 +515,166 @@ def delete_metadata(self, resource_id, name=None, names=None): - """Does a DELETE request to /{resource_type}/{resource_id}/metadata.json. + """Perform a DELETE request to + /{resource_type}/{resource_id}/metadata.json. - Deletes one or more metafields (and associated metadata) from the - specified subscription or customer. + Deletes one or more metafields (and associated metadata) from the specified + subscription or customer. Args: - resource_type (ResourceType): The resource type to which the - metafields belong. + resource_type (ResourceType): The resource type to which the metafields + belong. resource_id (int): The Advanced Billing id of the customer or the subscription for which the metadata applies name (str, optional): Name of field to be removed. - names (List[str], optional): Names of fields to be removed. Use in - query: `names[]=field1&names[]=my-field&names[]=another-field`. + names (List[str], optional): Names of fields to be removed. Use in query: + `names[]=field1&names[]=my-field&names[]=another-field`. Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/{resource_id}/metadata.json') + .path("/{resource_type}/{resource_id}/metadata.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('resource_type') - .value(resource_type) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(resource_type) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('resource_id') - .value(resource_id) - .is_required(True) - .should_encode(True)) + .key("resource_id") + .value(resource_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('name') - .value(name)) + .key("name") + .value(name)) .query_param(Parameter() - .key('names') - .value(names)) + .key("names") + .value(names)) .array_serialization_format(SerializationFormats.UN_INDEXED) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def list_metadata_for_resource_type(self, options=dict()): - """Does a GET request to /{resource_type}/metadata.json. + """Perform a GET request to /{resource_type}/metadata.json. Lists metadata for a specified array of subscriptions or customers. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - resource_type -- ResourceType -- The resource type to - which the metafields belong. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - date_field -- BasicDateField -- The type of filter you - would like to apply to your search. - start_date -- date -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns metadata - with a timestamp at or after midnight (12:00:00 AM) in - your site’s time zone on the date specified. - end_date -- date -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns metadata with - a timestamp up to and including 11:59:59PM in your - site’s time zone on the date specified. - start_datetime -- datetime -- The start date and time - (format YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns metadata with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + resource_type -- ResourceType -- The resource type to which the + metafields belong. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + date_field -- BasicDateField -- The type of filter you would like + to apply to your search. + start_date -- date -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns metadata with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + end_date -- date -- The end date (format YYYY-MM-DD) with which + to filter the date_field. Returns metadata with a timestamp + up to and including 11:59:59PM in your site’s time zone on + the date specified. + start_datetime -- datetime -- The start date and time (format + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns metadata with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. end_datetime -- datetime -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns metadata with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of end_date. + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns metadata with a timestamp at or before exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of end_date. with_deleted -- bool -- Allow to fetch deleted metadata. - resource_ids -- List[int] -- Allow to fetch metadata for - multiple records based on provided ids. Use in query: - `resource_ids[]=122&resource_ids[]=123&resource_ids[]=1 - 24`. - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. + resource_ids -- List[int] -- Allow to fetch metadata for multiple + records based on provided ids. Use in query: + `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`. + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. Returns: PaginatedMetadata: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/{resource_type}/metadata.json') + .path("/{resource_type}/metadata.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('resource_type') - .value(options.get('resource_type', None)) - .is_required(True) - .should_encode(True)) + .key("resource_type") + .value(options.get("resource_type", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('start_datetime', None)))) + .key("start_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("start_datetime", None)))) .query_param(Parameter() - .key('end_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('end_datetime', None)))) + .key("end_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("end_datetime", None)))) .query_param(Parameter() - .key('with_deleted') - .value(options.get('with_deleted', None))) + .key("with_deleted") + .value(options.get("with_deleted", None))) .query_param(Parameter() - .key('resource_ids') - .value(options.get('resource_ids', None))) + .key("resource_ids") + .value(options.get("resource_ids", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.UN_INDEXED) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(PaginatedMetadata.from_dictionary) + .deserialize_into(PaginatedMetadata.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/customers_controller.py b/advancedbilling/controllers/customers_controller.py index fb965831..a6914390 100644 --- a/advancedbilling/controllers/customers_controller.py +++ b/advancedbilling/controllers/customers_controller.py @@ -1,72 +1,84 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.customer_response import CustomerResponse -from advancedbilling.models.subscription_response import SubscriptionResponse -from advancedbilling.exceptions.customer_error_response_exception import CustomerErrorResponseException -from advancedbilling.exceptions.api_exception import APIException + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.customer_error_response_exception import ( + CustomerErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.customer_response import ( + CustomerResponse, +) +from advancedbilling.models.subscription_response import ( + SubscriptionResponse, +) class CustomersController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize CustomersController object.""" super(CustomersController, self).__init__(config) def create_customer(self, body=None): - """Does a POST request to /customers.json. - - You may create a new Customer at any time, or you may create a - Customer at the same time you create a Subscription. The only - validation restriction is that you may only create one customer for a - given reference value. - If provided, the `reference` value must be unique. It represents a - unique identifier for the customer from your own app, i.e. the - customer’s ID. This allows you to retrieve a given customer via a - piece of shared information. Alternatively, you may choose to leave - `reference` blank, and store Advanced Billing’s unique ID for the - customer, which is in the `id` attribute. + """Perform a POST request to /customers.json. + + You may create a new Customer at any time, or you may create a Customer at + the same time you create a Subscription. The only validation restriction is + that you may only create one customer for a given reference value. + If provided, the `reference` value must be unique. It represents a unique + identifier for the customer from your own app, i.e. the customer’s ID. This + allows you to retrieve a given customer via a piece of shared information. + Alternatively, you may choose to leave `reference` blank, and store Advanced + Billing’s unique ID for the customer, which is in the `id` attribute. Full documentation on how to locate, create and edit Customers in the Advanced Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Custo - mer-Details). + [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Det + ails). ## Required Country Format - Advanced Billing requires that you use the ISO Standard Country codes - when formatting country attribute of the customer. - Countries should be formatted as 2 characters. For more information, - see the following wikipedia article on + Advanced Billing requires that you use the ISO Standard Country codes when + formatting country attribute of the customer. + Countries should be formatted as 2 characters. For more information, see the + following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) ## Required State Format - Advanced Billing requires that you use the ISO Standard State codes - when formatting state attribute of the customer. + Advanced Billing requires that you use the ISO Standard State codes when + formatting state attribute of the customer. + US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) - + States Outside the US (2-3 characters): To find the correct state - codes outside of the US, go to - [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) - and click on the link in the “ISO 3166-2 codes” column next to country - you wish to populate. + + States Outside the US (2-3 characters): To find the correct state codes + outside of the US, go to + [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click + on the link in the “ISO 3166-2 codes” column next to country you wish to + populate. ## Locale - Advanced Billing allows you to attribute a language/region to your - customer to deliver invoices in any required language. + Advanced Billing allows you to attribute a language/region to your customer + to deliver invoices in any required language. For more: [Customer - Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Cust - omer-Locale) + Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Lo + cale) Args: body (CreateCustomerRequest, optional): The request body parameter. @@ -75,43 +87,43 @@ def create_customer(self, CustomerResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/customers.json') + .path("/customers.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CustomerResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', CustomerErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + CustomerErrorResponseException), ).execute() def list_customers(self, options=dict()): - """Does a GET request to /customers.json. + """Perform a GET request to /customers.json. - This request will by default list all customers associated with your - Site. + This request will by default list all customers associated with your Site. ## Find Customer - Use the search feature with the `q` query parameter to retrieve an - array of customers that matches the search query. + Use the search feature with the `q` query parameter to retrieve an array of + customers that matches the search query. Common use cases are: + Search by an email + Search by an Advanced Billing ID @@ -119,119 +131,110 @@ def list_customers(self, + Search by a reference value from your application + Search by a first or last name To retrieve a single, exact match by reference, use the [lookup - endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-r - ead-customer-by-reference). + endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-cus + tomer-by-reference). Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - direction -- SortingDirection -- Direction to sort - customers by time of creation - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 50. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - date_field -- BasicDateField -- The type of filter you - would like to apply to your search. Use in query: + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + direction -- SortingDirection -- Direction to sort customers by + time of creation + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 50. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + date_field -- BasicDateField -- The type of filter you would like + to apply to your search. Use in query: `date_field=created_at`. - start_date -- str -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns - subscriptions with a timestamp at or after midnight - (12:00:00 AM) in your site’s time zone on the date - specified. - end_date -- str -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns subscriptions - with a timestamp up to and including 11:59:59PM in - your site’s time zone on the date specified. + start_date -- str -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns subscriptions with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + end_date -- str -- The end date (format YYYY-MM-DD) with which to + filter the date_field. Returns subscriptions with a timestamp + up to and including 11:59:59PM in your site’s time zone on + the date specified. start_datetime -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns subscriptions with a timestamp at - or after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. - end_datetime -- str -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns subscriptions with a timestamp at - or before exact time provided in query. You can - specify timezone in query - otherwise your site's time - zone will be used. If provided, this parameter will be - used instead of end_date. - q -- str -- A search query by which to filter customers - (can be an email, an ID, a reference, organization) + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns subscriptions with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. + end_datetime -- str -- The end date and time (format YYYY-MM-DD + HH:MM:SS) with which to filter the date_field. Returns + subscriptions with a timestamp at or before exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of end_date. + q -- str -- A search query by which to filter customers (can be + an email, an ID, a reference, organization) Returns: List[CustomerResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/customers.json') + .path("/customers.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(options.get('start_datetime', None))) + .key("start_datetime") + .value(options.get("start_datetime", None))) .query_param(Parameter() - .key('end_datetime') - .value(options.get('end_datetime', None))) + .key("end_datetime") + .value(options.get("end_datetime", None))) .query_param(Parameter() - .key('q') - .value(options.get('q', None))) + .key("q") + .value(options.get("q", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CustomerResponse.from_dictionary) + .deserialize_into(CustomerResponse.from_dictionary), ).execute() def read_customer(self, id): - """Does a GET request to /customers/{id}.json. + """Perform a GET request to /customers/{id}.json. - Retrieves the Customer properties by Advanced Billing-generated - Customer ID. + Retrieves the Customer properties by Advanced Billing-generated Customer ID. Args: id (int): The Advanced Billing id of the customer @@ -240,36 +243,34 @@ def read_customer(self, CustomerResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/customers/{id}.json') + .path("/customers/{id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('id') - .value(id) - .is_required(True) - .should_encode(True)) + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CustomerResponse.from_dictionary) + .deserialize_into(CustomerResponse.from_dictionary), ).execute() def update_customer(self, id, body=None): - """Does a PUT request to /customers/{id}.json. + """Perform a PUT request to /customers/{id}.json. This method allows to update the Customer. @@ -281,43 +282,44 @@ def update_customer(self, CustomerResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/customers/{id}.json') + .path("/customers/{id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('id') - .value(id) - .is_required(True) - .should_encode(True)) + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CustomerResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', CustomerErrorResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + CustomerErrorResponseException), ).execute() def delete_customer(self, id): - """Does a DELETE request to /customers/{id}.json. + """Perform a DELETE request to /customers/{id}.json. This method allows you to delete the Customer. @@ -328,28 +330,26 @@ def delete_customer(self, void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/customers/{id}.json') + .path("/customers/{id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('id') - .value(id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def read_customer_by_reference(self, reference): - """Does a GET request to /customers/lookup.json. + """Perform a GET request to /customers/lookup.json. Use this method to return the customer object if you have the unique **Reference ID (Your App)** value handy. It will return a single match. @@ -361,34 +361,33 @@ def read_customer_by_reference(self, CustomerResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/customers/lookup.json') + .path("/customers/lookup.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('reference') - .value(reference) - .is_required(True)) + .key("reference") + .value(reference) + .is_required(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CustomerResponse.from_dictionary) + .deserialize_into(CustomerResponse.from_dictionary), ).execute() def list_customer_subscriptions(self, customer_id): - """Does a GET request to /customers/{customer_id}/subscriptions.json. + """Perform a GET request to + /customers/{customer_id}/subscriptions.json. This method lists all subscriptions that belong to a customer. @@ -399,28 +398,26 @@ def list_customer_subscriptions(self, List[SubscriptionResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/customers/{customer_id}/subscriptions.json') + .path("/customers/{customer_id}/subscriptions.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('customer_id') - .value(customer_id) - .is_required(True) - .should_encode(True)) + .key("customer_id") + .value(customer_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionResponse.from_dictionary) + .deserialize_into(SubscriptionResponse.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/events_based_billing_segments_controller.py b/advancedbilling/controllers/events_based_billing_segments_controller.py index a8240b77..e69bc3fe 100644 --- a/advancedbilling/controllers/events_based_billing_segments_controller.py +++ b/advancedbilling/controllers/events_based_billing_segments_controller.py @@ -1,181 +1,202 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.segment_response import SegmentResponse -from advancedbilling.models.list_segments_response import ListSegmentsResponse -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.event_based_billing_segment_errors_exception import EventBasedBillingSegmentErrorsException -from advancedbilling.exceptions.event_based_billing_list_segments_errors_exception import EventBasedBillingListSegmentsErrorsException -from advancedbilling.exceptions.event_based_billing_segment_exception import EventBasedBillingSegmentException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.event_based_billing_list_segments_errors_exception import ( # noqa: E501 + EventBasedBillingListSegmentsErrorsException, +) +from advancedbilling.exceptions.event_based_billing_segment_errors_exception import ( + EventBasedBillingSegmentErrorsException, +) +from advancedbilling.exceptions.event_based_billing_segment_exception import ( + EventBasedBillingSegmentException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_segments_response import ( + ListSegmentsResponse, +) +from advancedbilling.models.segment_response import ( + SegmentResponse, +) -class EventsBasedBillingSegmentsController(BaseController): +class EventsBasedBillingSegmentsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize EventsBasedBillingSegmentsController object.""" super(EventsBasedBillingSegmentsController, self).__init__(config) def create_segment(self, component_id, price_point_id, body=None): - """Does a POST request to /components/{component_id}/price_points/{price_point_id}/segments.json. + """Perform a POST request to + /components/{component_id}/price_points/{price_point_id}/segments.json. - This endpoint creates a new Segment for a Component with segmented - Metric. It allows you to specify properties to bill upon and prices - for each Segment. You can only pass as many "property_values" as the - related Metric has segmenting properties defined. - You may specify component and/or price point by using either the - numeric ID or the `handle:gold` syntax. + This endpoint creates a new Segment for a Component with segmented Metric. It + allows you to specify properties to bill upon and prices for each Segment. + You can only pass as many "property_values" as the related Metric has + segmenting properties defined. + You may specify component and/or price point by using either the numeric ID + or the `handle:gold` syntax. Args: component_id (str): ID or Handle for the Component - price_point_id (str): ID or Handle for the Price Point belonging - to the Component + price_point_id (str): ID or Handle for the Price Point belonging to the + Component body (CreateSegmentRequest, optional): The request body parameter. Returns: SegmentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/segments.json') + .path("/components/{component_id}/price_points/{price_point_id}/segments.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SegmentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', EventBasedBillingSegmentErrorsException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + EventBasedBillingSegmentErrorsException), ).execute() def list_segments_for_price_point(self, options=dict()): - """Does a GET request to /components/{component_id}/price_points/{price_point_id}/segments.json. + """Perform a GET request to + /components/{component_id}/price_points/{price_point_id}/segments.json. - This endpoint allows you to fetch Segments created for a given Price - Point. They will be returned in the order of creation. - You can pass `page` and `per_page` parameters in order to access all - of the segments. By default it will return `30` records. You can set - `per_page` to `200` at most. - You may specify component and/or price point by using either the - numeric ID or the `handle:gold` syntax. + This endpoint allows you to fetch Segments created for a given Price Point. + They will be returned in the order of creation. + You can pass `page` and `per_page` parameters in order to access all of the + segments. By default it will return `30` records. You can set `per_page` to + `200` at most. + You may specify component and/or price point by using either the numeric ID + or the `handle:gold` syntax. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: component_id -- str -- ID or Handle for the Component price_point_id -- str -- ID or Handle for the Price Point belonging to the Component - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 30. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - filter -- ListSegmentsFilter -- Filter to use for List - Segments for a Price Point operation + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 30. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + filter -- ListSegmentsFilter -- Filter to use for List Segments + for a Price Point operation Returns: ListSegmentsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/segments.json') + .path("/components/{component_id}/price_points/{price_point_id}/segments.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('component_id') - .value(options.get('component_id', None)) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(options.get("component_id", None)) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(options.get('price_point_id', None)) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(options.get("price_point_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListSegmentsResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', EventBasedBillingListSegmentsErrorsException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + EventBasedBillingListSegmentsErrorsException), ).execute() def update_segment(self, @@ -183,17 +204,18 @@ def update_segment(self, price_point_id, id, body=None): - """Does a PUT request to /components/{component_id}/price_points/{price_point_id}/segments/{id}.json. + """Perform a PUT request to + /components/{component_id}/price_points/{price_point_id}/segments/{id}.json. - This endpoint updates a single Segment for a Component with a - segmented Metric. It allows you to update the pricing for the segment. - You may specify component and/or price point by using either the - numeric ID or the `handle:gold` syntax. + This endpoint updates a single Segment for a Component with a segmented + Metric. It allows you to update the pricing for the segment. + You may specify component and/or price point by using either the numeric ID + or the `handle:gold` syntax. Args: component_id (str): ID or Handle of the Component - price_point_id (str): ID or Handle of the Price Point belonging to - the Component + price_point_id (str): ID or Handle of the Price Point belonging to the + Component id (float): The ID of the Segment body (UpdateSegmentRequest, optional): The request body parameter. @@ -201,223 +223,227 @@ def update_segment(self, SegmentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/segments/{id}.json') + .path("/components/{component_id}/price_points/{price_point_id}/segments/{id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('id') - .value(id) - .is_required(True) - .should_encode(True)) + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SegmentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', EventBasedBillingSegmentErrorsException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + EventBasedBillingSegmentErrorsException), ).execute() def delete_segment(self, component_id, price_point_id, id): - """Does a DELETE request to /components/{component_id}/price_points/{price_point_id}/segments/{id}.json. + """Perform a DELETE request to + /components/{component_id}/price_points/{price_point_id}/segments/{id}.json. This endpoint allows you to delete a Segment with specified ID. - You may specify component and/or price point by using either the - numeric ID or the `handle:gold` syntax. + You may specify component and/or price point by using either the numeric ID + or the `handle:gold` syntax. Args: component_id (str): ID or Handle of the Component - price_point_id (str): ID or Handle of the Price Point belonging to - the Component + price_point_id (str): ID or Handle of the Price Point belonging to the + Component id (float): The ID of the Segment Returns: void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/segments/{id}.json') + .path("/components/{component_id}/price_points/{price_point_id}/segments/{id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('id') - .value(id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def bulk_create_segments(self, component_id, price_point_id, body=None): - """Does a POST request to /components/{component_id}/price_points/{price_point_id}/segments/bulk.json. - - This endpoint allows you to create multiple segments in one request. - The array of segments can contain up to `2000` records. - If any of the records contain an error the whole request would fail - and none of the requested segments get created. The error response - contains a message for only the one segment that failed validation, - with the corresponding index in the array. - You may specify component and/or price point by using either the - numeric ID or the `handle:gold` syntax. + """Perform a POST request to + /components/{component_id}/price_points/{price_point_id}/segments/bulk.json. + + This endpoint allows you to create multiple segments in one request. The + array of segments can contain up to `2000` records. + If any of the records contain an error the whole request would fail and none + of the requested segments get created. The error response contains a message + for only the one segment that failed validation, with the corresponding index + in the array. + You may specify component and/or price point by using either the numeric ID + or the `handle:gold` syntax. Args: component_id (str): ID or Handle for the Component - price_point_id (str): ID or Handle for the Price Point belonging - to the Component + price_point_id (str): ID or Handle for the Price Point belonging to the + Component body (BulkCreateSegments, optional): The request body parameter. Returns: ListSegmentsResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/segments/bulk.json') + .path("/components/{component_id}/price_points/{price_point_id}/segments/bulk.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListSegmentsResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', EventBasedBillingSegmentException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + EventBasedBillingSegmentException), ).execute() def bulk_update_segments(self, component_id, price_point_id, body=None): - """Does a PUT request to /components/{component_id}/price_points/{price_point_id}/segments/bulk.json. - - This endpoint allows you to update multiple segments in one request. - The array of segments can contain up to `1000` records. - If any of the records contain an error the whole request would fail - and none of the requested segments get updated. The error response - contains a message for only the one segment that failed validation, - with the corresponding index in the array. - You may specify component and/or price point by using either the - numeric ID or the `handle:gold` syntax. + """Perform a PUT request to + /components/{component_id}/price_points/{price_point_id}/segments/bulk.json. + + This endpoint allows you to update multiple segments in one request. The + array of segments can contain up to `1000` records. + If any of the records contain an error the whole request would fail and none + of the requested segments get updated. The error response contains a message + for only the one segment that failed validation, with the corresponding index + in the array. + You may specify component and/or price point by using either the numeric ID + or the `handle:gold` syntax. Args: component_id (str): ID or Handle for the Component - price_point_id (str): ID or Handle for the Price Point belonging - to the Component + price_point_id (str): ID or Handle for the Price Point belonging to the + Component body (BulkUpdateSegments, optional): The request body parameter. Returns: ListSegmentsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/components/{component_id}/price_points/{price_point_id}/segments/bulk.json') + .path("/components/{component_id}/price_points/{price_point_id}/segments/bulk.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListSegmentsResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', EventBasedBillingSegmentException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + EventBasedBillingSegmentException), ).execute() diff --git a/advancedbilling/controllers/events_controller.py b/advancedbilling/controllers/events_controller.py index ebb9f09d..19ec544b 100644 --- a/advancedbilling/controllers/events_controller.py +++ b/advancedbilling/controllers/events_controller.py @@ -1,48 +1,60 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.event_response import EventResponse -from advancedbilling.models.count_response import CountResponse +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.count_response import ( + CountResponse, +) +from advancedbilling.models.event_response import ( + EventResponse, +) -class EventsController(BaseController): +class EventsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize EventsController object.""" super(EventsController, self).__init__(config) def list_events(self, options=dict()): - """Does a GET request to /events.json. + """Perform a GET request to /events.json. ## Events Intro - Advanced Billing Events include various activity that happens around a - Site. This information is **especially** useful to track down issues - that arise when subscriptions are not created due to errors. - Within the Advanced Billing UI, "Events" are referred to as "Site - Activity". Full documentation on how to record view Events / Site - Activty in the Advanced Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site- - Activity). + Advanced Billing Events include various activity that happens around a Site. + This information is **especially** useful to track down issues that arise + when subscriptions are not created due to errors. + Within the Advanced Billing UI, "Events" are referred to as "Site Activity". + Full documentation on how to record view Events / Site Activty in the + Advanced Billing UI can be located + [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activit + y). ## List Events for a Site - This method will retrieve a list of events for a site. Use query - string filters to narrow down results. You may use the `key` filter as - part of your query string to narrow down results. + This method will retrieve a list of events for a site. Use query string + filters to narrow down results. You may use the `key` filter as part of your + query string to narrow down results. ### Legacy Filters The following keys are no longer supported. + `payment_failure_recreated` @@ -54,13 +66,13 @@ def list_events(self, + `zferral_revenue_post_success` - (Specific to the deprecated Zferral integration) ## Event Key - The event type is identified by the key property. You can check - supported keys [here]($m/Event%20Key). + The event type is identified by the key property. You can check supported + keys [here]($m/Event%20Key). ## Event Specific Data - Different event types may include additional data in - `event_specific_data` property. - While some events share the same schema for `event_specific_data`, - others may not include it at all. + Different event types may include additional data in `event_specific_data` + property. + While some events share the same schema for `event_specific_data`, others may + not include it at all. For precise mappings from key to event_specific_data, refer to [Event]($m/Event). ### Example @@ -70,8 +82,8 @@ def list_events(self, "event": { "id": 351, "key": "subscription_product_change", - "message": "Product changed on Marky Mark's subscription from - 'Basic' to 'Pro'", + "message": "Product changed on Marky Mark's subscription from 'Basic' + to 'Pro'", "subscription_id": 205, "event_specific_data": { "new_product_id": 3, @@ -87,8 +99,8 @@ def list_events(self, "event": { "id": 353, "key": "subscription_state_change", - "message": "State changed on Marky Mark's subscription to Pro - from trialing to active", + "message": "State changed on Marky Mark's subscription to Pro from + trialing to active", "subscription_id": 205, "event_specific_data": { "new_subscription_state": "active", @@ -100,295 +112,277 @@ def list_events(self, ``` Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - since_id -- int -- Returns events with an id greater than - or equal to the one specified - max_id -- int -- Returns events with an id less than or + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + since_id -- int -- Returns events with an id greater than or equal to the one specified - direction -- Direction -- The sort direction of the - returned events. - filter -- List[EventKey] -- You can pass multiple event - keys after comma. Use in query + max_id -- int -- Returns events with an id less than or equal to + the one specified + direction -- Direction -- The sort direction of the returned + events. + filter -- List[EventKey] -- You can pass multiple event keys + after comma. Use in query `filter=signup_success,payment_success`. - date_field -- ListEventsDateField -- The type of filter - you would like to apply to your search. - start_date -- str -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns - components with a timestamp at or after midnight - (12:00:00 AM) in your site’s time zone on the date - specified. - end_date -- str -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns components - with a timestamp up to and including 11:59:59PM in - your site’s time zone on the date specified. + date_field -- ListEventsDateField -- The type of filter you would + like to apply to your search. + start_date -- str -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns components with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + end_date -- str -- The end date (format YYYY-MM-DD) with which to + filter the date_field. Returns components with a timestamp up + to and including 11:59:59PM in your site’s time zone on the + date specified. start_datetime -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. - end_datetime -- str -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of end_date. + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns components with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. + end_datetime -- str -- The end date and time (format YYYY-MM-DD + HH:MM:SS) with which to filter the date_field. Returns + components with a timestamp at or before exact time provided + in query. You can specify timezone in query - otherwise your + site's time zone will be used. If provided, this parameter + will be used instead of end_date. Returns: List[EventResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/events.json') + .path("/events.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('since_id') - .value(options.get('since_id', None))) + .key("since_id") + .value(options.get("since_id", None))) .query_param(Parameter() - .key('max_id') - .value(options.get('max_id', None))) + .key("max_id") + .value(options.get("max_id", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(options.get('start_datetime', None))) + .key("start_datetime") + .value(options.get("start_datetime", None))) .query_param(Parameter() - .key('end_datetime') - .value(options.get('end_datetime', None))) + .key("end_datetime") + .value(options.get("end_datetime", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(EventResponse.from_dictionary) + .deserialize_into(EventResponse.from_dictionary), ).execute() def list_subscription_events(self, options=dict()): - """Does a GET request to /subscriptions/{subscription_id}/events.json. + """Perform a GET request to + /subscriptions/{subscription_id}/events.json. The following request will return a list of events for a subscription. ## Event Key - The event type is identified by the key property. You can check - supported keys [here]($m/Event%20Key). + The event type is identified by the key property. You can check supported + keys [here]($m/Event%20Key). ## Event Specific Data - Different event types may include additional data in - `event_specific_data` property. - While some events share the same schema for `event_specific_data`, - others may not include it at all. + Different event types may include additional data in `event_specific_data` + property. + While some events share the same schema for `event_specific_data`, others may + not include it at all. For precise mappings from key to event_specific_data, refer to [Event]($m/Event). Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - subscription_id -- int -- The Chargify id of the - subscription - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - since_id -- int -- Returns events with an id greater than - or equal to the one specified - max_id -- int -- Returns events with an id less than or + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + subscription_id -- int -- The Chargify id of the subscription. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + since_id -- int -- Returns events with an id greater than or equal to the one specified - direction -- Direction -- The sort direction of the - returned events. - filter -- List[EventKey] -- You can pass multiple event - keys after comma. Use in query + max_id -- int -- Returns events with an id less than or equal to + the one specified + direction -- Direction -- The sort direction of the returned + events. + filter -- List[EventKey] -- You can pass multiple event keys + after comma. Use in query `filter=signup_success,payment_success`. Returns: List[EventResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/events.json') + .path("/subscriptions/{subscription_id}/events.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None)) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(options.get("subscription_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('since_id') - .value(options.get('since_id', None))) + .key("since_id") + .value(options.get("since_id", None))) .query_param(Parameter() - .key('max_id') - .value(options.get('max_id', None))) + .key("max_id") + .value(options.get("max_id", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(EventResponse.from_dictionary) + .deserialize_into(EventResponse.from_dictionary), ).execute() def read_events_count(self, options=dict()): - """Does a GET request to /events/count.json. + """Perform a GET request to /events/count.json. Get a count of all the events for a given site by using this method. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - since_id -- int -- Returns events with an id greater than - or equal to the one specified - max_id -- int -- Returns events with an id less than or + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + since_id -- int -- Returns events with an id greater than or equal to the one specified - direction -- Direction -- The sort direction of the - returned events. - filter -- List[EventKey] -- You can pass multiple event - keys after comma. Use in query + max_id -- int -- Returns events with an id less than or equal to + the one specified + direction -- Direction -- The sort direction of the returned + events. + filter -- List[EventKey] -- You can pass multiple event keys + after comma. Use in query `filter=signup_success,payment_success`. Returns: CountResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/events/count.json') + .path("/events/count.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('since_id') - .value(options.get('since_id', None))) + .key("since_id") + .value(options.get("since_id", None))) .query_param(Parameter() - .key('max_id') - .value(options.get('max_id', None))) + .key("max_id") + .value(options.get("max_id", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CountResponse.from_dictionary) + .deserialize_into(CountResponse.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/insights_controller.py b/advancedbilling/controllers/insights_controller.py index 0ab82fa3..ecf00116 100644 --- a/advancedbilling/controllers/insights_controller.py +++ b/advancedbilling/controllers/insights_controller.py @@ -1,44 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from deprecation import deprecated -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.site_summary import SiteSummary -from advancedbilling.models.mrr_response import MRRResponse -from advancedbilling.models.list_mrr_response import ListMRRResponse -from advancedbilling.models.subscription_mrr_response import SubscriptionMRRResponse -from advancedbilling.exceptions.subscriptions_mrr_error_response_exception import SubscriptionsMrrErrorResponseException +from deprecation import deprecated +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.subscriptions_mrr_error_response_exception import ( + SubscriptionsMrrErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_mrr_response import ( + ListMRRResponse, +) +from advancedbilling.models.mrr_response import ( + MRRResponse, +) +from advancedbilling.models.site_summary import ( + SiteSummary, +) +from advancedbilling.models.subscription_mrr_response import ( + SubscriptionMRRResponse, +) -class InsightsController(BaseController): +class InsightsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize InsightsController object.""" super(InsightsController, self).__init__(config) def read_site_stats(self): - """Does a GET request to /stats.json. + """Perform a GET request to /stats.json. - The Stats API is a very basic view of some Site-level stats. This API - call only answers with JSON responses. An XML version is not provided. + The Stats API is a very basic view of some Site-level stats. This API call + only answers with JSON responses. An XML version is not provided. ## Stats Documentation - There currently is not a complimentary matching set of documentation - that compliments this endpoint. However, each Site's dashboard will - reflect the summary of information provided in the Stats response. + There currently is not a complimentary matching set of documentation that + compliments this endpoint. However, each Site's dashboard will reflect the + summary of information provided in the Stats response. ``` https://subdomain.chargify.com/dashboard ``` @@ -47,95 +65,91 @@ def read_site_stats(self): SiteSummary: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/stats.json') + .path("/stats.json") .http_method(HttpMethodEnum.GET) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SiteSummary.from_dictionary) + .deserialize_into(SiteSummary.from_dictionary), ).execute() @deprecated() def read_mrr(self, at_time=None, subscription_id=None): - """Does a GET request to /mrr.json. + """Perform a GET request to /mrr.json. - This endpoint returns your site's current MRR, including plan and - usage breakouts. + This endpoint returns your site's current MRR, including plan and usage + breakouts. Args: - at_time (datetime, optional): submit a timestamp in ISO8601 format - to request MRR for a historic time - subscription_id (int, optional): submit the id of a subscription - in order to limit results + at_time (datetime, optional): submit a timestamp in ISO8601 format to + request MRR for a historic time + subscription_id (int, optional): submit the id of a subscription in order + to limit results Returns: MRRResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/mrr.json') + .path("/mrr.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('at_time') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, at_time))) + .key("at_time") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + at_time))) .query_param(Parameter() - .key('subscription_id') - .value(subscription_id)) + .key("subscription_id") + .value(subscription_id)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(MRRResponse.from_dictionary) + .deserialize_into(MRRResponse.from_dictionary), ).execute() @deprecated() def list_mrr_movements(self, options=dict()): - """Does a GET request to /mrr_movements.json. + """Perform a GET request to /mrr_movements.json. This endpoint returns your site's MRR movements. ## Understanding MRR movements This endpoint will aid in accessing your site's [MRR - Report](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR- - Analytics) data. - Whenever a subscription event occurs that causes your site's MRR to - change (such as a signup or upgrade), we record an MRR movement. These - records are accessible via the MRR Movements endpoint. + Report](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-Analyti + cs) data. + Whenever a subscription event occurs that causes your site's MRR to change + (such as a signup or upgrade), we record an MRR movement. These records are + accessible via the MRR Movements endpoint. Each MRR Movement belongs to a subscription and contains a timestamp, - category, and an amount. `line_items` represent the subscription's - product configuration at the time of the movement. + category, and an amount. `line_items` represent the subscription's product + configuration at the time of the movement. ### Plan & Usage Breakouts In the MRR Report UI, we support a setting to [include or - exclude](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR - -Analytics#displaying-component-based-metered-usage-in-mrr) usage - revenue. In the MRR APIs, responses include `plan` and `usage` - breakouts. + exclude](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-Analyt + ics#displaying-component-based-metered-usage-in-mrr) usage revenue. In the + MRR APIs, responses include `plan` and `usage` breakouts. Plan includes revenue from: * Products * Quantity-Based Components @@ -145,146 +159,137 @@ def list_mrr_movements(self, * Prepaid Usage Components Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: subscription_id -- int -- optionally filter results by subscription - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 10. - The maximum allowed values is 50; any per_page value - over 50 will be changed to 50. Use in query - `per_page=20`. - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 10. The maximum + allowed values is 50; any per_page value over 50 will be + changed to 50. Use in query `per_page=20`. + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. Returns: ListMRRResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/mrr_movements.json') + .path("/mrr_movements.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None))) + .key("subscription_id") + .value(options.get("subscription_id", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListMRRResponse.from_dictionary) + .deserialize_into(ListMRRResponse.from_dictionary), ).execute() @deprecated() def list_mrr_per_subscription(self, options=dict()): - """Does a GET request to /subscriptions_mrr.json. + """Perform a GET request to /subscriptions_mrr.json. - This endpoint returns your site's current MRR, including plan and - usage breakouts split per subscription. + This endpoint returns your site's current MRR, including plan and usage + breakouts split per subscription. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: filter -- ListMrrFilter -- Filter to use for List MRR per subscription operation - at_time -- str -- Submit a timestamp in ISO8601 format to - request MRR for a historic time. Use in query: + at_time -- str -- Submit a timestamp in ISO8601 format to request + MRR for a historic time. Use in query: `at_time=2022-01-10T10:00:00-05:00`. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - direction -- Direction -- Controls the order in which - results are returned. Records are ordered by - subscription_id in ascending order by default. Use in - query `direction=desc`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + direction -- Direction -- Controls the order in which results are + returned. Records are ordered by subscription_id in ascending + order by default. Use in query `direction=desc`. Returns: SubscriptionMRRResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions_mrr.json') + .path("/subscriptions_mrr.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('at_time') - .value(options.get('at_time', None))) + .key("at_time") + .value(options.get("at_time", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionMRRResponse.from_dictionary) - .local_error_template('400', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SubscriptionsMrrErrorResponseException) + .local_error_template("400", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SubscriptionsMrrErrorResponseException), ).execute() diff --git a/advancedbilling/controllers/invoices_controller.py b/advancedbilling/controllers/invoices_controller.py index 06b60997..92cad398 100644 --- a/advancedbilling/controllers/invoices_controller.py +++ b/advancedbilling/controllers/invoices_controller.py @@ -1,149 +1,177 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_array_map_response_exception import ( + ErrorArrayMapResponseException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.consolidated_invoice import ( + ConsolidatedInvoice, +) +from advancedbilling.models.credit_note import ( + CreditNote, +) +from advancedbilling.models.customer_changes_preview_response import ( + CustomerChangesPreviewResponse, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.list_invoices_response import ListInvoicesResponse -from advancedbilling.models.list_invoice_events_response import ListInvoiceEventsResponse -from advancedbilling.models.multi_invoice_payment_response import MultiInvoicePaymentResponse -from advancedbilling.models.list_credit_notes_response import ListCreditNotesResponse -from advancedbilling.models.credit_note import CreditNote -from advancedbilling.models.record_payment_response import RecordPaymentResponse -from advancedbilling.models.consolidated_invoice import ConsolidatedInvoice -from advancedbilling.models.invoice_response import InvoiceResponse -from advancedbilling.models.customer_changes_preview_response import CustomerChangesPreviewResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_array_map_response_exception import ErrorArrayMapResponseException +from advancedbilling.models.invoice_response import ( + InvoiceResponse, +) +from advancedbilling.models.list_credit_notes_response import ( + ListCreditNotesResponse, +) +from advancedbilling.models.list_invoice_events_response import ( + ListInvoiceEventsResponse, +) +from advancedbilling.models.list_invoices_response import ( + ListInvoicesResponse, +) +from advancedbilling.models.multi_invoice_payment_response import ( + MultiInvoicePaymentResponse, +) +from advancedbilling.models.record_payment_response import ( + RecordPaymentResponse, +) class InvoicesController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize InvoicesController object.""" super(InvoicesController, self).__init__(config) def refund_invoice(self, uid, body=None): - """Does a POST request to /invoices/{uid}/refunds.json. + """Perform a POST request to /invoices/{uid}/refunds.json. Refund an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated Invoice - A refund less than the total of a consolidated invoice will be split - across its segments. - A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and - one $40.00 segment, the refunded amount will be applied as 50% of each - ($30.00 and $20.00 respectively). + A refund less than the total of a consolidated invoice will be split across + its segments. + A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and one + $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 + and $20.00 respectively). Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. body (RefundInvoiceRequest, optional): The request body parameter. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/refunds.json') + .path("/invoices/{uid}/refunds.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_invoices(self, options=dict()): - """Does a GET request to /invoices.json. + """Perform a GET request to /invoices.json. - By default, invoices returned on the index will only include totals, - not detailed breakdowns for `line_items`, `discounts`, `taxes`, - `credits`, `payments`, `custom_fields`, or `refunds`. To include - breakdowns, pass the specific field as a key in the query with a value - set to `true`. + By default, invoices returned on the index will only include totals, not + detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, + `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the + specific field as a key in the query with a value set to `true`. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - start_date -- str -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns invoices - with a timestamp at or after midnight (12:00:00 AM) in - your site’s time zone on the date specified. - end_date -- str -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns invoices with - a timestamp up to and including 11:59:59PM in your - site’s time zone on the date specified. - status -- InvoiceStatus -- The current status of the - invoice. Allowed Values: draft, open, paid, pending, - voided + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + start_date -- str -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns invoices with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + end_date -- str -- The end date (format YYYY-MM-DD) with which to + filter the date_field. Returns invoices with a timestamp up + to and including 11:59:59PM in your site’s time zone on the + date specified. + status -- InvoiceStatus -- The current status of the invoice. + Allowed Values: draft, open, paid, pending, voided subscription_id -- int -- The subscription's ID. - subscription_group_uid -- str -- The UID of the - subscription group you want to fetch consolidated - invoices for. This will return a paginated list of - consolidated invoices for the specified group. - consolidation_level -- str -- The consolidation level of - the invoice. Allowed Values: none, parent, child or + subscription_group_uid -- str -- The UID of the subscription + group you want to fetch consolidated invoices for. This will + return a paginated list of consolidated invoices for the + specified group. + consolidation_level -- str -- The consolidation level of the + invoice. Allowed Values: none, parent, child or comma-separated lists of thereof, e.g. none,parent. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - direction -- Direction -- The sort direction of the - returned invoices. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + direction -- Direction -- The sort direction of the returned + invoices. line_items -- bool -- Include line items data discounts -- bool -- Include discounts data taxes -- bool -- Include taxes data @@ -151,136 +179,132 @@ def list_invoices(self, payments -- bool -- Include payments data custom_fields -- bool -- Include custom fields data refunds -- bool -- Include refunds data - date_field -- InvoiceDateField -- The type of filter you - would like to apply to your search. Use in query + date_field -- InvoiceDateField -- The type of filter you would + like to apply to your search. Use in query `date_field=issue_date`. start_datetime -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns invoices with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. Allowed to be used only along - with date_field set to created_at or updated_at. - end_datetime -- str -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns invoices with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of end_date. Allowed to be used only along - with date_field set to created_at or updated_at. + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns invoices with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. Allowed to + be used only along with date_field set to created_at or + updated_at. + end_datetime -- str -- The end date and time (format YYYY-MM-DD + HH:MM:SS) with which to filter the date_field. Returns + invoices with a timestamp at or before exact time provided in + query. You can specify timezone in query - otherwise your + site's time zone will be used. If provided, this parameter + will be used instead of end_date. Allowed to be used only + along with date_field set to created_at or updated_at. customer_ids -- List[int] -- Allows fetching invoices with - matching customer id based on provided values. Use in - query `customer_ids=1,2,3`. - number -- List[str] -- Allows fetching invoices with - matching invoice number based on provided values. Use - in query `number=1234,1235`. + matching customer id based on provided values. Use in query + `customer_ids=1,2,3`. + number -- List[str] -- Allows fetching invoices with matching + invoice number based on provided values. Use in query + `number=1234,1235`. product_ids -- List[int] -- Allows fetching invoices with - matching line items product ids based on provided - values. Use in query `product_ids=23,34`. - sort -- InvoiceSortField -- Allows specification of the - order of the returned list. Use in query - `sort=total_amount`. + matching line items product ids based on provided values. Use + in query `product_ids=23,34`. + sort -- InvoiceSortField -- Allows specification of the order of + the returned list. Use in query `sort=total_amount`. Returns: ListInvoicesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices.json') + .path("/invoices.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('status') - .value(options.get('status', None))) + .key("status") + .value(options.get("status", None))) .query_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None))) + .key("subscription_id") + .value(options.get("subscription_id", None))) .query_param(Parameter() - .key('subscription_group_uid') - .value(options.get('subscription_group_uid', None))) + .key("subscription_group_uid") + .value(options.get("subscription_group_uid", None))) .query_param(Parameter() - .key('consolidation_level') - .value(options.get('consolidation_level', None))) + .key("consolidation_level") + .value(options.get("consolidation_level", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('line_items') - .value(options.get('line_items', None))) + .key("line_items") + .value(options.get("line_items", None))) .query_param(Parameter() - .key('discounts') - .value(options.get('discounts', None))) + .key("discounts") + .value(options.get("discounts", None))) .query_param(Parameter() - .key('taxes') - .value(options.get('taxes', None))) + .key("taxes") + .value(options.get("taxes", None))) .query_param(Parameter() - .key('credits') - .value(options.get('credits', None))) + .key("credits") + .value(options.get("credits", None))) .query_param(Parameter() - .key('payments') - .value(options.get('payments', None))) + .key("payments") + .value(options.get("payments", None))) .query_param(Parameter() - .key('custom_fields') - .value(options.get('custom_fields', None))) + .key("custom_fields") + .value(options.get("custom_fields", None))) .query_param(Parameter() - .key('refunds') - .value(options.get('refunds', None))) + .key("refunds") + .value(options.get("refunds", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_datetime') - .value(options.get('start_datetime', None))) + .key("start_datetime") + .value(options.get("start_datetime", None))) .query_param(Parameter() - .key('end_datetime') - .value(options.get('end_datetime', None))) + .key("end_datetime") + .value(options.get("end_datetime", None))) .query_param(Parameter() - .key('customer_ids') - .value(options.get('customer_ids', None))) + .key("customer_ids") + .value(options.get("customer_ids", None))) .query_param(Parameter() - .key('number') - .value(options.get('number', None))) + .key("number") + .value(options.get("number", None))) .query_param(Parameter() - .key('product_ids') - .value(options.get('product_ids', None))) + .key("product_ids") + .value(options.get("product_ids", None))) .query_param(Parameter() - .key('sort') - .value(options.get('sort', None))) + .key("sort") + .value(options.get("sort", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListInvoicesResponse.from_dictionary) + .deserialize_into(ListInvoicesResponse.from_dictionary), ).execute() def read_invoice(self, uid): - """Does a GET request to /invoices/{uid}.json. + """Perform a GET request to /invoices/{uid}.json. Use this endpoint to retrieve the details for an invoice. ## PDF Invoice retrieval @@ -288,8 +312,7 @@ def read_invoice(self, application/pdf or appending .pdf as the format portion of the URL: ```curl -u :x -H Accept:application/pdf -H - https://acme.chargify.com/invoices/inv_8gd8tdhtd3hgr.pdf > - output_file.pdf + https://acme.chargify.com/invoices/inv_8gd8tdhtd3hgr.pdf > output_file.pdf URL: `https://.chargify.com/invoices/.` Method: GET Required parameters: `uid` @@ -297,46 +320,44 @@ def read_invoice(self, ``` Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}.json') + .path("/invoices/{uid}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(Invoice.from_dictionary) + .deserialize_into(Invoice.from_dictionary), ).execute() def list_invoice_events(self, options=dict()): - """Does a GET request to /invoices/events.json. + """Perform a GET request to /invoices/events.json. - This endpoint returns a list of invoice events. Each event contains - event "data" (such as an applied payment) as well as a snapshot of the - `invoice` at the time of event completion. + This endpoint returns a list of invoice events. Each event contains event + "data" (such as an applied payment) as well as a snapshot of the `invoice` at + the time of event completion. Exposed event types are: + issue_invoice + apply_credit_note @@ -353,161 +374,153 @@ def list_invoice_events(self, + create_debit_note + change_chargeback_status Invoice events are returned in ascending order. - If both a `since_date` and `since_id` are provided in request - parameters, the `since_date` will be used. - Note - invoice events that occurred prior to 09/05/2018 __will not__ - contain an `invoice` snapshot. + If both a `since_date` and `since_id` are provided in request parameters, the + `since_date` will be used. + Note - invoice events that occurred prior to 09/05/2018 __will not__ contain + an `invoice` snapshot. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - since_date -- str -- The timestamp in a format `YYYY-MM-DD - T HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it - returns data from the beginning of the day). of the - event from which you want to start the search. All the - events before the `since_date` timestamp are not - returned in the response. - since_id -- int -- The ID of the event from which you want - to start the search(ID is not included. e.g. if ID is - set to 2, then all events with ID 3 and more will be - shown) This parameter is not used if since_date is - defined. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is - 100. The maximum allowed values is 200; any per_page - value over 200 will be changed to 200. - invoice_uid -- str -- Providing an invoice_uid allows for - scoping of the invoice events to a single invoice or - credit note. - with_change_invoice_status -- str -- Use this parameter if - you want to fetch also invoice events with - change_invoice_status type. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + since_date -- str -- The timestamp in a format `YYYY-MM-DD T + HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it returns data + from the beginning of the day). of the event from which you + want to start the search. All the events before the + `since_date` timestamp are not returned in the response. + since_id -- int -- The ID of the event from which you want to + start the search(ID is not included. e.g. if ID is set to 2, + then all events with ID 3 and more will be shown) This + parameter is not used if since_date is defined. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 100. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. + invoice_uid -- str -- Providing an invoice_uid allows for scoping + of the invoice events to a single invoice or credit note. + with_change_invoice_status -- str -- Use this parameter if you + want to fetch also invoice events with change_invoice_status + type. event_types -- List[InvoiceEventType] -- Filter results by - event_type. Supply a comma separated list of event - types (listed above). Use in query: + event_type. Supply a comma separated list of event types + (listed above). Use in query: `event_types=void_invoice,void_remainder`. Returns: ListInvoiceEventsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/events.json') + .path("/invoices/events.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('since_date') - .value(options.get('since_date', None))) + .key("since_date") + .value(options.get("since_date", None))) .query_param(Parameter() - .key('since_id') - .value(options.get('since_id', None))) + .key("since_id") + .value(options.get("since_id", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('invoice_uid') - .value(options.get('invoice_uid', None))) + .key("invoice_uid") + .value(options.get("invoice_uid", None))) .query_param(Parameter() - .key('with_change_invoice_status') - .value(options.get('with_change_invoice_status', None))) + .key("with_change_invoice_status") + .value(options.get("with_change_invoice_status", None))) .query_param(Parameter() - .key('event_types') - .value(options.get('event_types', None))) + .key("event_types") + .value(options.get("event_types", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListInvoiceEventsResponse.from_dictionary) + .deserialize_into(ListInvoiceEventsResponse.from_dictionary), ).execute() def record_payment_for_invoice(self, uid, body=None): - """Does a POST request to /invoices/{uid}/payments.json. + """Perform a POST request to /invoices/{uid}/payments.json. - Applies a payment of a given type against a specific invoice. If you - would like to apply a payment across multiple invoices, you can use - the Bulk Payment endpoint. + Applies a payment of a given type against a specific invoice. If you would + like to apply a payment across multiple invoices, you can use the Bulk + Payment endpoint. Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. - body (CreateInvoicePaymentRequest, optional): The request body - parameter. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. + body (CreateInvoicePaymentRequest, optional): The request body parameter. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/payments.json') + .path("/invoices/{uid}/payments.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def record_payment_for_multiple_invoices(self, body=None): - """Does a POST request to /invoices/payments.json. + """Perform a POST request to /invoices/payments.json. - This API call should be used when you want to record an external - payment against multiple invoices. - In order apply a payment to multiple invoices, at minimum, specify - the `amount` and `applications` (i.e., `invoice_uid` and `amount`) - details. + This API call should be used when you want to record an external payment + against multiple invoices. + In order apply a payment to multiple invoices, at minimum, specify the + `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. ``` { "payment": { @@ -528,79 +541,76 @@ def record_payment_for_multiple_invoices(self, } } ``` - Note that the invoice payment amounts must be greater than 0. Total - amount must be greater or equal to invoices payment amount sum. + Note that the invoice payment amounts must be greater than 0. Total amount + must be greater or equal to invoices payment amount sum. Args: - body (CreateMultiInvoicePaymentRequest, optional): The request - body parameter. + body (CreateMultiInvoicePaymentRequest, optional): The request body + parameter. Returns: MultiInvoicePaymentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/payments.json') + .path("/invoices/payments.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(MultiInvoicePaymentResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_credit_notes(self, options=dict()): - """Does a GET request to /credit_notes.json. + """Perform a GET request to /credit_notes.json. - Credit Notes are like inverse invoices. They reduce the amount a - customer owes. - By default, the credit notes returned by this endpoint will exclude - the arrays of `line_items`, `discounts`, `taxes`, `applications`, or - `refunds`. To include these arrays, pass the specific field as a key - in the query with a value set to `true`. + Credit Notes are like inverse invoices. They reduce the amount a customer + owes. + By default, the credit notes returned by this endpoint will exclude the + arrays of `line_items`, `discounts`, `taxes`, `applications`, or `refunds`. + To include these arrays, pass the specific field as a key in the query with a + value set to `true`. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - subscription_id -- int -- The subscription's Advanced - Billing id - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + subscription_id -- int -- The subscription's Advanced Billing id + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. line_items -- bool -- Include line items data discounts -- bool -- Include discounts data taxes -- bool -- Include taxes data @@ -611,54 +621,52 @@ def list_credit_notes(self, ListCreditNotesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/credit_notes.json') + .path("/credit_notes.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None))) + .key("subscription_id") + .value(options.get("subscription_id", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('line_items') - .value(options.get('line_items', None))) + .key("line_items") + .value(options.get("line_items", None))) .query_param(Parameter() - .key('discounts') - .value(options.get('discounts', None))) + .key("discounts") + .value(options.get("discounts", None))) .query_param(Parameter() - .key('taxes') - .value(options.get('taxes', None))) + .key("taxes") + .value(options.get("taxes", None))) .query_param(Parameter() - .key('refunds') - .value(options.get('refunds', None))) + .key("refunds") + .value(options.get("refunds", None))) .query_param(Parameter() - .key('applications') - .value(options.get('applications', None))) + .key("applications") + .value(options.get("applications", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListCreditNotesResponse.from_dictionary) + .deserialize_into(ListCreditNotesResponse.from_dictionary), ).execute() def read_credit_note(self, uid): - """Does a GET request to /credit_notes/{uid}.json. + """Perform a GET request to /credit_notes/{uid}.json. Use this endpoint to retrieve the details for a credit note. @@ -669,282 +677,278 @@ def read_credit_note(self, CreditNote: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/credit_notes/{uid}.json') + .path("/credit_notes/{uid}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(CreditNote.from_dictionary) + .deserialize_into(CreditNote.from_dictionary), ).execute() def record_payment_for_subscription(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/payments.json. + """Perform a POST request to + /subscriptions/{subscription_id}/payments.json. Record an external payment made against a subscription that will pay partially or in full one or more invoices. - Payment will be applied starting with the oldest open invoice and then - next oldest, and so on until the amount of the payment is fully - consumed. - Excess payment will result in the creation of a prepayment on the - Invoice Account. - Only ungrouped or primary subscriptions may be paid using the "bulk" - payment request. + Payment will be applied starting with the oldest open invoice and then next + oldest, and so on until the amount of the payment is fully consumed. + Excess payment will result in the creation of a prepayment on the Invoice + Account. + Only ungrouped or primary subscriptions may be paid using the "bulk" payment + request. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (RecordPaymentRequest, optional): The request body parameter. Returns: RecordPaymentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/payments.json') + .path("/subscriptions/{subscription_id}/payments.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(RecordPaymentResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def reopen_invoice(self, uid): - """Does a POST request to /invoices/{uid}/reopen.json. - - This endpoint allows you to reopen any invoice with the "canceled" - status. Invoices enter "canceled" status if they were open at the time - the subscription was canceled (whether through dunning or an - intentional cancellation). - Invoices with "canceled" status are no longer considered to be due. - Once reopened, they are considered due for payment. Payment may then - be captured in one of the following ways: - - Reactivating the subscription, which will capture all open invoices - (See note below about automatic reopening of invoices.) + """Perform a POST request to /invoices/{uid}/reopen.json. + + This endpoint allows you to reopen any invoice with the "canceled" status. + Invoices enter "canceled" status if they were open at the time the + subscription was canceled (whether through dunning or an intentional + cancellation). + Invoices with "canceled" status are no longer considered to be due. Once + reopened, they are considered due for payment. Payment may then be captured + in one of the following ways: + - Reactivating the subscription, which will capture all open invoices (See + note below about automatic reopening of invoices.) - Recording a payment directly against the invoice - A note about reactivations: any canceled invoices from the most recent - active period are automatically opened as a part of the reactivation - process. Reactivating via this endpoint prior to reactivation is only - necessary when you wish to capture older invoices from previous - periods during the reactivation. + A note about reactivations: any canceled invoices from the most recent active + period are automatically opened as a part of the reactivation process. + Reactivating via this endpoint prior to reactivation is only necessary when + you wish to capture older invoices from previous periods during the + reactivation. ### Reopening Consolidated Invoices - When reopening a consolidated invoice, all of its canceled segments - will also be reopened. + When reopening a consolidated invoice, all of its canceled segments will also + be reopened. Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/reopen.json') + .path("/invoices/{uid}/reopen.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def void_invoice(self, uid, body=None): - """Does a POST request to /invoices/{uid}/void.json. + """Perform a POST request to /invoices/{uid}/void.json. - This endpoint allows you to void any invoice with the "open" or - "canceled" status. It will also allow voiding of an invoice with the - "pending" status if it is not a consolidated invoice. + This endpoint allows you to void any invoice with the "open" or "canceled" + status. It will also allow voiding of an invoice with the "pending" status + if it is not a consolidated invoice. Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. body (VoidInvoiceRequest, optional): The request body parameter. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/void.json') + .path("/invoices/{uid}/void.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_consolidated_invoice_segments(self, options=dict()): - """Does a GET request to /invoices/{invoice_uid}/segments.json. + """Perform a GET request to /invoices/{invoice_uid}/segments.json. - Invoice segments returned on the index will only include totals, not - detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, - `payments`, or `custom_fields`. + Invoice segments returned on the index will only include totals, not detailed + breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or + `custom_fields`. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - invoice_uid -- str -- The unique identifier of the - consolidated invoice - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - direction -- Direction -- Sort direction of the returned - segments. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + invoice_uid -- str -- The unique identifier of the consolidated + invoice + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + direction -- Direction -- Sort direction of the returned segments. Returns: ConsolidatedInvoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{invoice_uid}/segments.json') + .path("/invoices/{invoice_uid}/segments.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('invoice_uid') - .value(options.get('invoice_uid', None)) - .is_required(True) - .should_encode(True)) + .key("invoice_uid") + .value(options.get("invoice_uid", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ConsolidatedInvoice.from_dictionary) + .deserialize_into(ConsolidatedInvoice.from_dictionary), ).execute() def create_invoice(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/invoices.json. + """Perform a POST request to + /subscriptions/{subscription_id}/invoices.json. This endpoint will allow you to create an ad hoc invoice. ### Basic Behavior - You can create a basic invoice by sending an array of line items to - this endpoint. Each line item, at a minimum, must include a title, a - quantity and a unit price. Example: + You can create a basic invoice by sending an array of line items to this + endpoint. Each line item, at a minimum, must include a title, a quantity and + a unit price. Example: ```json { "invoice": { @@ -959,8 +963,8 @@ def create_invoice(self, } ``` ### Catalog items - Instead of creating custom products like in above example, You can - pass existing items like products, components. + Instead of creating custom products like in above example, You can pass + existing items like products, components. ```json { "invoice": { @@ -973,14 +977,13 @@ def create_invoice(self, } } ``` - The price for each line item will be calculated as well as a total due - amount for the invoice. Multiple line items can be sent. + The price for each line item will be calculated as well as a total due amount + for the invoice. Multiple line items can be sent. ### Line items types - When defining line item, You can choose one of 3 types for one line - item: + When defining line item, You can choose one of 3 types for one line item: #### Custom item - Like in basic behavior example above, You can pass `title` and - `unit_price` for custom item. + Like in basic behavior example above, You can pass `title` and `unit_price` + for custom item. #### Product id Product handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `product_id`. By default @@ -990,16 +993,14 @@ def create_invoice(self, `component_id`. #### Component id Component handle (with handle: prefix) or id from the scope of current - subscription's site can be provided with `component_id`. If - `component_id` is used, following fields cannot be used: `title`, - `product_id`. By default `unit_price` is taken from product's default - price point, but can be overwritten by passing `unit_price` or - `price_point_id`. At this moment price points are supportted only for - quantity based, on/off and metered components. For prepaid and event - based billing components `unit_price` is required. + subscription's site can be provided with `component_id`. If `component_id` is + used, following fields cannot be used: `title`, `product_id`. By default + `unit_price` is taken from product's default price point, but can be + overwritten by passing `unit_price` or `price_point_id`. At this moment price + points are supportted only for quantity based, on/off and metered components. + For prepaid and event based billing components `unit_price` is required. ### Coupons - When creating ad hoc invoice, new discounts can be applied in - following way: + When creating ad hoc invoice, new discounts can be applied in following way: ```json { "invoice": { @@ -1018,8 +1019,8 @@ def create_invoice(self, } } ``` - If You want to use existing coupon for discount creation, only `code` - and optional `product_family_id` is needed + If You want to use existing coupon for discount creation, only `code` and + optional `product_family_id` is needed ```json ... "coupons": [ @@ -1031,8 +1032,8 @@ def create_invoice(self, ... ``` #### Using Coupon Subcodes - You can also use coupon subcodes to apply existing coupons with - specific subcodes: + You can also use coupon subcodes to apply existing coupons with specific + subcodes: ```json ... "coupons": [ @@ -1043,12 +1044,11 @@ def create_invoice(self, ] ... ``` - **Important:** You cannot specify both `code` and `subcode` for the - same coupon. Use either: + **Important:** You cannot specify both `code` and `subcode` for the same + coupon. Use either: - `code` to apply a main coupon - `subcode` to apply a specific coupon subcode - The API response will include both the main coupon code and the - subcode used: + The API response will include both the main coupon code and the subcode used: ```json ... "coupons": [ @@ -1065,352 +1065,355 @@ def create_invoice(self, ### Coupon options #### Code Coupon `code` will be displayed on invoice discount section. - Coupon code can only contain uppercase letters, numbers, and allowed - special characters. - Lowercase letters will be converted to uppercase. It can be used to - select an existing coupon from the catalog, or as an ad hoc coupon - when passed with `percentage` or `amount`. + Coupon code can only contain uppercase letters, numbers, and allowed special + characters. + Lowercase letters will be converted to uppercase. It can be used to select an + existing coupon from the catalog, or as an ad hoc coupon when passed with + `percentage` or `amount`. #### Subcode - Coupon `subcode` allows you to apply existing coupons using their - subcodes. When a subcode is used, the API response will include both - the main coupon code and the specific subcode that was applied. - Subcodes are case-insensitive and will be converted to uppercase - automatically. + Coupon `subcode` allows you to apply existing coupons using their subcodes. + When a subcode is used, the API response will include both the main coupon + code and the specific subcode that was applied. Subcodes are case-insensitive + and will be converted to uppercase automatically. #### Percentage - Coupon `percentage` can take values from 0 to 100 and up to 4 decimal - places. It cannot be used with `amount`. Only for ad hoc coupons, will - be ignored if `code` is used to select an existing coupon from the - catalog. + Coupon `percentage` can take values from 0 to 100 and up to 4 decimal places. + It cannot be used with `amount`. Only for ad hoc coupons, will be ignored if + `code` is used to select an existing coupon from the catalog. #### Amount - Coupon `amount` takes number value. It cannot be used with - `percentage`. Used only when not matching existing coupon by `code`. + Coupon `amount` takes number value. It cannot be used with `percentage`. Used + only when not matching existing coupon by `code`. #### Description - Optional `description` will be displayed with coupon `code`. Used only - when not matching existing coupon by `code`. + Optional `description` will be displayed with coupon `code`. Used only when + not matching existing coupon by `code`. #### Product Family id - Optional `product_family_id` handle (with handle: prefix) or id is - used to match existing coupon within site, when codes are not unique. + Optional `product_family_id` handle (with handle: prefix) or id is used to + match existing coupon within site, when codes are not unique. #### Compounding Strategy - Optional `compounding_strategy` for percentage coupons, can take - values `compound` or `full-price`. - For amount coupons, discounts will be always calculated against the - original item price, before other discounts are applied. + Optional `compounding_strategy` for percentage coupons, can take values + `compound` or `full-price`. + For amount coupons, discounts will be always calculated against the original + item price, before other discounts are applied. `compound` strategy: - Percentage-based discounts will be calculated against the remaining - price, after prior discounts have been calculated. It is set by - default. + Percentage-based discounts will be calculated against the remaining price, + after prior discounts have been calculated. It is set by default. `full-price` strategy: - Percentage-based discounts will always be calculated against the - original item price, before other discounts are applied. + Percentage-based discounts will always be calculated against the original + item price, before other discounts are applied. ### Line Item Options #### Period Date Range A custom period date range can be defined for each line item with the - `period_range_start` and `period_range_end` parameters. Dates must be - sent in the `YYYY-MM-DD` format. + `period_range_start` and `period_range_end` parameters. Dates must be sent in + the `YYYY-MM-DD` format. `period_range_end` must be greater or equal `period_range_start`. #### Taxes - The `taxable` parameter can be sent as `true` if taxes should be - calculated for a specific line item. For this to work, the site should - be configured to use and calculate taxes. Further, if the site uses - Avalara for tax calculations, a `tax_code` parameter should also be - sent. For existing catalog items: products/components taxes cannot be - overwritten. + The `taxable` parameter can be sent as `true` if taxes should be calculated + for a specific line item. For this to work, the site should be configured to + use and calculate taxes. Further, if the site uses Avalara for tax + calculations, a `tax_code` parameter should also be sent. For existing + catalog items: products/components taxes cannot be overwritten. #### Price Point - Price point handle (with handle: prefix) or id from the scope of - current subscription's site can be provided with `price_point_id` for - components with `component_id` or `product_price_point_id` for - products with `product_id` parameter. If price point is passed - `unit_price` cannot be used. It can be used only with catalog items - products and components. + Price point handle (with handle: prefix) or id from the scope of current + subscription's site can be provided with `price_point_id` for components with + `component_id` or `product_price_point_id` for products with `product_id` + parameter. If price point is passed `unit_price` cannot be used. It can be + used only with catalog items products and components. #### Description Optional `description` parameter, it will overwrite default generated description for line item. ### Invoice Options #### Issue Date By default, invoices will be created with a issue date set to today. - `issue_date` parameter can be send to alter that. Only dates in the - past can be send. `issue_date` should be send in `YYYY-MM-DD` format. + `issue_date` parameter can be send to alter that. Only dates in the past can + be send. `issue_date` should be send in `YYYY-MM-DD` format. #### Net Terms - By default, invoices will be created with a due date matching the date - of invoice creation. If a different due date is desired, the - `net_terms` parameter can be sent indicating the number of days in - advance the due date should be. + By default, invoices will be created with a due date matching the date of + invoice creation. If a different due date is desired, the `net_terms` + parameter can be sent indicating the number of days in advance the due date + should be. #### Addresses - The seller, shipping and billing addresses can be sent to override the - site's defaults. Each address requires to send a `first_name` at a - minimum in order to work. See below for the details on which - parameters can be sent for each address object. + The seller, shipping and billing addresses can be sent to override the site's + defaults. Each address requires to send a `first_name` at a minimum in order + to work. See below for the details on which parameters can be sent for each + address object. #### Memo and Payment Instructions - A custom memo can be sent with the `memo` parameter to override the - site's default. Likewise, custom payment instructions can be sent with - the `payment_instrucions` parameter. + A custom memo can be sent with the `memo` parameter to override the site's + default. Likewise, custom payment instructions can be sent with the + `payment_instrucions` parameter. #### Status - By default, invoices will be created with open status. Possible - alternative is `draft`. + By default, invoices will be created with open status. Possible alternative + is `draft`. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (CreateInvoiceRequest, optional): The request body parameter. Returns: InvoiceResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/invoices.json') + .path("/subscriptions/{subscription_id}/invoices.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(InvoiceResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def send_invoice(self, uid, body=None): - """Does a POST request to /invoices/{uid}/deliveries.json. - - This endpoint allows for invoices to be programmatically delivered via - email. This endpoint supports the delivery of both ad-hoc and - automatically generated invoices. Additionally, this endpoint supports - email delivery to direct recipients, carbon-copy (cc) recipients, and - blind carbon-copy (bcc) recipients. + """Perform a POST request to /invoices/{uid}/deliveries.json. + + This endpoint allows for invoices to be programmatically delivered via email. + This endpoint supports the delivery of both ad-hoc and automatically + generated invoices. Additionally, this endpoint supports email delivery to + direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) + recipients. + **File Attachments**: You can attach files to invoice emails using + `attachment_urls[]` parameter by providing URLs to the files you want to + attach. When using attachments, the request must use `multipart/form-data` + content type. Max 10 files, 10MB per file. If no recipient email addresses are specified in the request, then the - subscription's default email configuration will be used. For example, - if `recipient_emails` is left blank, then the invoice will be - delivered to the subscription's customer email address. - On success, a 204 no-content response will be returned. The response - does not indicate that email(s) have been delivered, but instead - indicates that emails have been successfully queued for delivery. If - _any_ invalid or malformed email address is found in the request body, - the entire request will be rejected and a 422 response will be - returned. + subscription's default email configuration will be used. For example, if + `recipient_emails` is left blank, then the invoice will be delivered to the + subscription's customer email address. + On success, a 204 no-content response will be returned. The response does not + indicate that email(s) have been delivered, but instead indicates that emails + have been successfully queued for delivery. If _any_ invalid or malformed + email address is found in the request body, the entire request will be + rejected and a 422 response will be returned. Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. body (SendInvoiceRequest, optional): The request body parameter. Returns: void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/deliveries.json') + .path("/invoices/{uid}/deliveries.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def preview_customer_information_changes(self, uid): - """Does a POST request to /invoices/{uid}/customer_information/preview.json. + """Perform a POST request to + /invoices/{uid}/customer_information/preview.json. - Customer information may change after an invoice is issued which may - lead to a mismatch between customer information that are present on an - open invoice and actual customer information. This endpoint allows to - preview these differences, if any. - The endpoint doesn't accept a request body. Customer information - differences are calculated on the application side. + Customer information may change after an invoice is issued which may lead to + a mismatch between customer information that are present on an open invoice + and actual customer information. This endpoint allows to preview these + differences, if any. + The endpoint doesn't accept a request body. Customer information differences + are calculated on the application side. Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. Returns: CustomerChangesPreviewResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/customer_information/preview.json') + .path("/invoices/{uid}/customer_information/preview.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CustomerChangesPreviewResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', ErrorListResponseException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", + "Not Found:'{$response.body}'", + ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def update_customer_information(self, uid): - """Does a PUT request to /invoices/{uid}/customer_information.json. + """Perform a PUT request to /invoices/{uid}/customer_information.json. - This endpoint updates customer information on an open invoice and - returns the updated invoice. If you would like to preview changes that - will be applied, use the - `/invoices/{uid}/customer_information/preview.json` endpoint before. - The endpoint doesn't accept a request body. Customer information - differences are calculated on the application side. + This endpoint updates customer information on an open invoice and returns the + updated invoice. If you would like to preview changes that will be applied, + use the `/invoices/{uid}/customer_information/preview.json` endpoint before. + The endpoint doesn't accept a request body. Customer information differences + are calculated on the application side. Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/customer_information.json') + .path("/invoices/{uid}/customer_information.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', ErrorListResponseException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", + "Not Found:'{$response.body}'", + ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def issue_invoice(self, uid, body=None): - """Does a POST request to /invoices/{uid}/issue.json. + """Perform a POST request to /invoices/{uid}/issue.json. - This endpoint allows you to issue an invoice that is in "pending" + This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when - allocating new quantity on a component and using "accrue charges" - option. + allocating new quantity on a component and using "accrue charges" option. You cannot issue a pending child invoice that was created for a member subscription in a group. - For Remittance subscriptions, the invoice will go into "open" status - and payment won't be attempted. The value for `on_failed_payment` - would be rejected if sent. Any prepayments or service credits that - exist on subscription will be automatically applied. Additionally, if - setting is on, an email will be sent for issued invoice. - For Automatic subscriptions, prepayments and service credits will - apply to the invoice and before payment is attempted. On successful - payment, the invoice will go into "paid" status and email will be sent - to the customer (if setting applies). When payment fails, the next - event depends on the `on_failed_payment` value: - - `leave_open_invoice` - prepayments and credits applied to invoice; - invoice status set to "open"; email sent to the customer for the - issued invoice (if setting applies); payment failure recorded in the - invoice history. This is the default option. + For Remittance subscriptions, the invoice will go into "open" status and + payment won't be attempted. The value for `on_failed_payment` would be + rejected if sent. Any prepayments or service credits that exist on + subscription will be automatically applied. Additionally, if setting is on, + an email will be sent for issued invoice. + For Automatic subscriptions, prepayments and service credits will apply to + the invoice and before payment is attempted. On successful payment, the + invoice will go into "paid" status and email will be sent to the customer (if + setting applies). When payment fails, the next event depends on the + `on_failed_payment` value: + - `leave_open_invoice` - prepayments and credits applied to invoice; invoice + status set to "open"; email sent to the customer for the issued invoice (if + setting applies); payment failure recorded in the invoice history. This is + the default option. - `rollback_to_pending` - prepayments and credits not applied; invoice - remains in "pending" status; no email sent to the customer; payment - failure recorded in the invoice history. + remains in "pending" status; no email sent to the customer; payment failure + recorded in the invoice history. - `initiate_dunning` - prepayments and credits applied to the invoice; - invoice status set to "open"; email sent to the customer for the - issued invoice (if setting applies); payment failure recorded in the - invoice history; subscription will most likely go into "past_due" or - "canceled" state (depending upon net terms and dunning settings). + invoice status set to "open"; email sent to the customer for the issued + invoice (if setting applies); payment failure recorded in the invoice + history; subscription will most likely go into "past_due" or "canceled" + state (depending upon net terms and dunning settings). Args: - uid (str): The unique identifier for the invoice, this does not - refer to the public facing invoice number. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. body (IssueInvoiceRequest, optional): The request body parameter. Returns: Invoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/invoices/{uid}/issue.json') + .path("/invoices/{uid}/issue.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Invoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/controllers/offers_controller.py b/advancedbilling/controllers/offers_controller.py index 21adbaeb..f9e1dfdb 100644 --- a/advancedbilling/controllers/offers_controller.py +++ b/advancedbilling/controllers/offers_controller.py @@ -1,53 +1,66 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.offer_response import OfferResponse -from advancedbilling.models.list_offers_response import ListOffersResponse -from advancedbilling.exceptions.error_array_map_response_exception import ErrorArrayMapResponseException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.error_array_map_response_exception import ( + ErrorArrayMapResponseException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_offers_response import ( + ListOffersResponse, +) +from advancedbilling.models.offer_response import ( + OfferResponse, +) -class OffersController(BaseController): +class OffersController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize OffersController object.""" super(OffersController, self).__init__(config) def create_offer(self, body=None): - """Does a POST request to /offers.json. + """Perform a POST request to /offers.json. - Create an offer within your Advanced Billing site by sending a POST - request. + Create an offer within your Advanced Billing site by sending a POST request. ## Documentation - Offers allow you to package complicated combinations of products, - components and coupons into a convenient package which can then be - subscribed to just like products. - Once an offer is defined it can be used as an alternative to the - product when creating subscriptions. - Full documentation on how to use offers in the Advanced Billing UI can - be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offer - s-Overview). + Offers allow you to package complicated combinations of products, components + and coupons into a convenient package which can then be subscribed to just + like products. + Once an offer is defined it can be used as an alternative to the product when + creating subscriptions. + Full documentation on how to use offers in the Advanced Billing UI can be + located + [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overv + iew). ## Using a Product Price Point - You can optionally pass in a `product_price_point_id` that corresponds - with the `product_id` and the offer will use that price point. If a - `product_price_point_id` is not passed in, the product's default price - point will be used. + You can optionally pass in a `product_price_point_id` that corresponds with + the `product_id` and the offer will use that price point. If a + `product_price_point_id` is not passed in, the product's default price point + will be used. Args: body (CreateOfferRequest, optional): The request body parameter. @@ -56,106 +69,104 @@ def create_offer(self, OfferResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/offers.json') + .path("/offers.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(OfferResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def list_offers(self, options=dict()): - """Does a GET request to /offers.json. + """Perform a GET request to /offers.json. This endpoint will list offers for a site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - include_archived -- bool -- Include archived products. Use - in query: `include_archived=true`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + include_archived -- bool -- Include archived products. Use in + query: `include_archived=true`. Returns: ListOffersResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/offers.json') + .path("/offers.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('include_archived') - .value(options.get('include_archived', None))) + .key("include_archived") + .value(options.get("include_archived", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListOffersResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_offer(self, offer_id): - """Does a GET request to /offers/{offer_id}.json. + """Perform a GET request to /offers/{offer_id}.json. This method allows you to list a specific offer's attributes. This is - different than list all offers for a site, as it requires an - `offer_id`. + different than list all offers for a site, as it requires an `offer_id`. Args: offer_id (int): The Chargify id of the offer @@ -164,38 +175,36 @@ def read_offer(self, OfferResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/offers/{offer_id}.json') + .path("/offers/{offer_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('offer_id') - .value(offer_id) - .is_required(True) - .should_encode(True)) + .key("offer_id") + .value(offer_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(OfferResponse.from_dictionary) + .deserialize_into(OfferResponse.from_dictionary), ).execute() def archive_offer(self, offer_id): - """Does a PUT request to /offers/{offer_id}/archive.json. + """Perform a PUT request to /offers/{offer_id}/archive.json. - Archive an existing offer. Please provide an `offer_id` in order to - archive the correct item. + Archive an existing offer. Please provide an `offer_id` in order to archive + the correct item. Args: offer_id (int): The Chargify id of the offer @@ -204,31 +213,29 @@ def archive_offer(self, void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/offers/{offer_id}/archive.json') + .path("/offers/{offer_id}/archive.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('offer_id') - .value(offer_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("offer_id") + .value(offer_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def unarchive_offer(self, offer_id): - """Does a PUT request to /offers/{offer_id}/unarchive.json. + """Perform a PUT request to /offers/{offer_id}/unarchive.json. - Unarchive a previously archived offer. Please provide an `offer_id` in - order to un-archive the correct item. + Unarchive a previously archived offer. Please provide an `offer_id` in order + to un-archive the correct item. Args: offer_id (int): The Chargify id of the offer @@ -237,21 +244,19 @@ def unarchive_offer(self, void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/offers/{offer_id}/unarchive.json') + .path("/offers/{offer_id}/unarchive.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('offer_id') - .value(offer_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("offer_id") + .value(offer_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() diff --git a/advancedbilling/controllers/payment_profiles_controller.py b/advancedbilling/controllers/payment_profiles_controller.py index f7402e45..3191afbf 100644 --- a/advancedbilling/controllers/payment_profiles_controller.py +++ b/advancedbilling/controllers/payment_profiles_controller.py @@ -1,115 +1,128 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.payment_profile_response import PaymentProfileResponse -from advancedbilling.models.bank_account_response import BankAccountResponse -from advancedbilling.models.get_one_time_token_request import GetOneTimeTokenRequest -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.error_string_map_response_exception import ErrorStringMapResponseException + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.exceptions.error_string_map_response_exception import ( + ErrorStringMapResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.bank_account_response import ( + BankAccountResponse, +) +from advancedbilling.models.get_one_time_token_request import ( + GetOneTimeTokenRequest, +) +from advancedbilling.models.payment_profile_response import ( + PaymentProfileResponse, +) class PaymentProfilesController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize PaymentProfilesController object.""" super(PaymentProfilesController, self).__init__(config) def create_payment_profile(self, body=None): - """Does a POST request to /payment_profiles.json. + """Perform a POST request to /payment_profiles.json. Creates a payment profile for a customer. - When you create a new payment profile for a customer via the API, it - does not automatically make the profile current for any of the - customer’s subscriptions. To use the payment profile as the default, - you must set it explicitly for the subscription or subscription group. - Select an option from the **Request Examples** drop-down on the right - side of the portal to see examples of common scenarios for creating - payment profiles. - Do not use real card information for testing. See the Sites articles - that cover [testing your site - setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing- - Overview#testing-overview-0-0) for more details on testing in your - sandbox. - Note that collecting and sending raw card details in production - requires [PCI - compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI - -Compliance#pci-compliance-0-0) on your end. If your business is not - PCI compliant, use - [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C - hargify-js-Overview#chargify-js-overview-0-0) to collect credit card - or bank account information. - See the following articles to learn more about subscriptions and - payments: + When you create a new payment profile for a customer via the API, it does not + automatically make the profile current for any of the customer’s + subscriptions. To use the payment profile as the default, you must set it + explicitly for the subscription or subscription group. + Select an option from the **Request Examples** drop-down on the right side of + the portal to see examples of common scenarios for creating payment profiles. + Do not use real card information for testing. See the Sites articles that + cover [testing your site + setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overvie + w#testing-overview-0-0) for more details on testing in your sandbox. + Note that collecting and sending raw card details in production requires [PCI + compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compli + ance#pci-compliance-0-0) on your end. If your business is not PCI compliant, + use + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify + -js-Overview#chargify-js-overview-0-0) to collect credit card or bank account + information. + See the following articles to learn more about subscriptions and payments: + [Subscriber Payment - Details](https://maxio.zendesk.com/hc/en-us/articles/24251599929613-Sub - scription-Summary-Payment-Details-Tab) + Details](https://maxio.zendesk.com/hc/en-us/articles/24251599929613-Subscripti + on-Summary-Payment-Details-Tab) + [Self Service - Pages](https://maxio.zendesk.com/hc/en-us/articles/24261425318541-Self- - Service-Pages) (Allows credit card updates by Subscriber) + Pages](https://maxio.zendesk.com/hc/en-us/articles/24261425318541-Self-Service + -Pages) (Allows credit card updates by Subscriber) + [Public Signup Pages payment - settings](https://maxio.zendesk.com/hc/en-us/articles/24261368332557-In - dividual-Page-Settings) + settings](https://maxio.zendesk.com/hc/en-us/articles/24261368332557-Individua + l-Page-Settings) + - [Taxes](https://developers.chargify.com/docs/developer-docs/d2e9e34db74 - 0e-signups#taxes) + [Taxes](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-sign + ups#taxes) + - [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C - hargify-js-Overview) + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify + -js-Overview) + [Chargify.js with GoCardless - minimal - example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl - es#h_01K0PJ15QQZKCER8CFK40MR6XJ) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01 + K0PJ15QQZKCER8CFK40MR6XJ) + [Chargify.js with GoCardless - full - example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl - es#h_01K0PJ15QR09JVHWW0MCA7HVJV) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01 + K0PJ15QR09JVHWW0MCA7HVJV) + [Chargify.js with Stripe Direct Debit - minimal - example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl - es#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01 + K0PJ15QQFKKN8Z7B7DZ9AJS5) + [Chargify.js with Stripe Direct Debit - full - example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl - es#h_01K0PJ15QRECQQ4ECS3ZA55GY7) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01 + K0PJ15QRECQQ4ECS3ZA55GY7) + [Chargify.js with Stripe BECS Direct Debit - minimal - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-g - ateway) + example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy- + examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) + [Chargify.js with Stripe BECS Direct Debit - full - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) + example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy- + examples#full-example-with-sepa-direct-debit-stripe-gateway) + [Full documentation on - GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909- - GoCardless) + GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardl + ess) + [Full documentation on Stripe SEPA Direct - Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Strip - e-SEPA-and-BECS-Direct-Debit) + Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA- + and-BECS-Direct-Debit) + [Full documentation on Stripe BECS Direct - Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Strip - e-SEPA-and-BECS-Direct-Debit) + Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA- + and-BECS-Direct-Debit) + [Full documentation on Stripe BACS Direct - Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Strip - e-SEPA-and-BECS-Direct-Debit) + Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA- + and-BECS-Direct-Debit) ## 3D Secure Authentication during payment profile creation. - When a payment requires 3D Secure Authentication to adhear to Strong - Customer Authentication (SCA) during payment profile creation, the - request enters a [post-authentication - flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testin - g-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authent - ication). In this case, a 422 Unprocessable Entity status is returned - with the following response: + When a payment requires 3D Secure Authentication to adhear to Strong Customer + Authentication (SCA) during payment profile creation, the request enters a + [post-authentication + flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Imple + menting-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). In + this case, a 422 Unprocessable Entity status is returned with the following + response: ```json { "jsonapi": { @@ -118,48 +131,47 @@ def create_payment_profile(self, "errors": [ { "title": "This card requires 3DSecure verification.", - "detail": "This card requires 3D secure authentication. - Redirect the customer to the URL from the action_link attribute to - authenticate. Attach callback_url param to this URL if you want to be - notified about the result of 3D Secure authentication. Attach - redirect_url param to this URL if you want to redirect a customer back - to your page after 3D Secure authentication. Example: - https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5 - uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:40 - 00&redirect_url=https://yourpage.com will do a POST request to - https://localhost:4000 after credit card is authenticated and will - redirect a customer to https://yourpage.com after 3DS authentication.", + "detail": "This card requires 3D secure authentication. Redirect + the customer to the URL from the action_link attribute to authenticate. + Attach callback_url param to this URL if you want to be notified about the + result of 3D Secure authentication. Attach redirect_url param to this URL if + you want to redirect a customer back to your page after 3D Secure + authentication. Example: + https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx + 5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_ur + l=https://yourpage.com will do a POST request to https://localhost:4000 after + credit card is authenticated and will redirect a customer to + https://yourpage.com after 3DS authentication.", "links": { "action_link": - "https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd - 5uhkbodx5jhvkg6yeu?one_time_token_id=93" + "https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbod + x5jhvkg6yeu?one_time_token_id=93" } } ] } ``` - To let the customer go through 3D Secure Authentication, they need to - be redirected to the URL specified in `action_link`. - Optionally, you can specify the `callback_url` parameter in the - `action_link` URL to receive notification about the result of 3D - Secure Authentication. + To let the customer go through 3D Secure Authentication, they need to be + redirected to the URL specified in `action_link`. + Optionally, you can specify the `callback_url` parameter in the `action_link` + URL to receive notification about the result of 3D Secure Authentication. The `callback_url` will return the following information: - whether the authentication was successful (`success`) - the payment profile ID (`payment_profile_id`) - You can also specify a `redirect_url` parameter in the `action_link` - URL to redirect the customer back to your site. - You cannot use action_link in an iframe inside a custom application. - You must redirect the customer directly to the `action_link` and use - the `redirect_url` or `callback_url` to be notified of the result. - The final URL that you send a customer to complete 3D Secure may - resemble the following, where the first half is the `action_link` and - the second half contains a `redirect_url` and `callback_url`: - `https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsx - d5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost: - 4000&redirect_url=https://yourpage.com` + You can also specify a `redirect_url` parameter in the `action_link` URL to + redirect the customer back to your site. + You cannot use action_link in an iframe inside a custom application. You must + redirect the customer directly to the `action_link` and use the + `redirect_url` or `callback_url` to be notified of the result. + The final URL that you send a customer to complete 3D Secure may resemble the + following, where the first half is the `action_link` and the second half + contains a `redirect_url` and `callback_url`: + `https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbo + dx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_ + url=https://yourpage.com` ### Example Redirect Flow - Here's an example flow to redirect customers to different pages - depending on whether SCA was performed successfully: + Here's an example flow to redirect customers to different pages depending on + whether SCA was performed successfully: 1. Create a payment profile via the API; it requires 3DS. 2. You receive an `action_link` in the response. 3. Use this `action_link` to, for example, connect with your internal @@ -168,128 +180,124 @@ def create_payment_profile(self, `redirect_url` to be aware which “session” this applies to. 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied - 6. After the customer completes 3DS authentication, we notify you of - the result via the applied `callback_url`. - 7. After that, we redirect the customer to the `redirect_url`; at this - point the result of authentication is known. - 8. Optionally, you can use the applied "msg" param in the - `redirect_url` to determine if the redirect was successful. + 6. After the customer completes 3DS authentication, we notify you of the + result via the applied `callback_url`. + 7. After that, we redirect the customer to the `redirect_url`; at this point + the result of authentication is known. + 8. Optionally, you can use the applied "msg" param in the `redirect_url` to + determine if the redirect was successful. Args: - body (CreatePaymentProfileRequest, optional): When following the - IBAN or the Local Bank details examples, a customer, bank - account and mandate will be created in your current vault. If - the customer, bank account, and mandate already exist in your - vault, follow the Import example to link the payment profile - into Advanced Billing. + body (CreatePaymentProfileRequest, optional): When following the IBAN or + the Local Bank details examples, a customer, bank account and mandate + will be created in your current vault. If the customer, bank account, + and mandate already exist in your vault, follow the Import example to + link the payment profile into Advanced Billing. Returns: PaymentProfileResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/payment_profiles.json') + .path("/payment_profiles.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PaymentProfileResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_payment_profiles(self, options=dict()): - """Does a GET request to /payment_profiles.json. + """Perform a GET request to /payment_profiles.json. - This method will return all of the active `payment_profiles` for a - Site, or for one Customer within a site. If no payment profiles are - found, this endpoint will return an empty array, not a 404. + This method will return all of the active `payment_profiles` for a Site, or + for one Customer within a site. If no payment profiles are found, this + endpoint will return an empty array, not a 404. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - customer_id -- int -- The ID of the customer for which you - wish to list payment profiles + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + customer_id -- int -- The ID of the customer for which you wish + to list payment profiles Returns: List[PaymentProfileResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/payment_profiles.json') + .path("/payment_profiles.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('customer_id') - .value(options.get('customer_id', None))) + .key("customer_id") + .value(options.get("customer_id", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(PaymentProfileResponse.from_dictionary) + .deserialize_into(PaymentProfileResponse.from_dictionary), ).execute() def read_payment_profile(self, payment_profile_id): - """Does a GET request to /payment_profiles/{payment_profile_id}.json. + """Perform a GET request to + /payment_profiles/{payment_profile_id}.json. - Using the GET method you can retrieve a Payment Profile identified by - its unique ID. - Note that a different JSON object will be returned if the card method - on file is a bank account. + Using the GET method you can retrieve a Payment Profile identified by its + unique ID. + Note that a different JSON object will be returned if the card method on file + is a bank account. ### Response for Bank Account Example response for Bank Account: ``` @@ -329,43 +337,42 @@ def read_payment_profile(self, PaymentProfileResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/payment_profiles/{payment_profile_id}.json') + .path("/payment_profiles/{payment_profile_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('payment_profile_id') - .value(payment_profile_id) - .is_required(True) - .should_encode(True)) + .key("payment_profile_id") + .value(payment_profile_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PaymentProfileResponse.from_dictionary) - .local_error('404', 'Not Found', APIException) + .local_error("404", "Not Found", APIException), ).execute() def update_payment_profile(self, payment_profile_id, body=None): - """Does a PUT request to /payment_profiles/{payment_profile_id}.json. + """Perform a PUT request to + /payment_profiles/{payment_profile_id}.json. ## Partial Card Updates - In the event that you are using the Authorize.net, Stripe, - Cybersource, Forte or Braintree Blue payment gateways, you can update - just the billing and contact information for a payment method. Note - the lack of credit-card related data contained in the JSON payload. + In the event that you are using the Authorize.net, Stripe, Cybersource, Forte + or Braintree Blue payment gateways, you can update just the billing and + contact information for a payment method. Note the lack of credit-card + related data contained in the JSON payload. In this case, the following JSON is acceptable: ``` { @@ -381,79 +388,78 @@ def update_payment_profile(self, } } ``` - The result will be that you have updated the billing information for - the card, yet retained the original card number data. + The result will be that you have updated the billing information for the + card, yet retained the original card number data. ## Specific notes on updating payment profiles - - Merchants with **Authorize.net**, **Cybersource**, **Forte**, - **Braintree Blue** or **Stripe** as their payment gateway can update - their Customer’s credit cards without passing in the full credit card - number and CVV. - - If you are using **Authorize.net**, **Cybersource**, **Forte**, - **Braintree Blue** or **Stripe**, Advanced Billing will ignore the - credit card number and CVV when processing an update via the API, and - attempt a partial update instead. If you wish to change the card - number on a payment profile, you will need to create a new payment - profile for the given customer. - - A Payment Profile cannot be updated with the attributes of another - type of Payment Profile. For example, if the payment profile you are - attempting to update is a credit card, you cannot pass in bank account - attributes (like `bank_account_number`), and vice versa. - - Updating a payment profile directly will not trigger an attempt to - capture a past-due balance. If this is the intent, update the card - details via the Subscription instead. - - If you are using Authorize.net or Stripe, you may elect to manually - trigger a retry for a past due subscription after a partial update. + - Merchants with **Authorize.net**, **Cybersource**, **Forte**, **Braintree + Blue** or **Stripe** as their payment gateway can update their Customer’s + credit cards without passing in the full credit card number and CVV. + - If you are using **Authorize.net**, **Cybersource**, **Forte**, **Braintree + Blue** or **Stripe**, Advanced Billing will ignore the credit card number and + CVV when processing an update via the API, and attempt a partial update + instead. If you wish to change the card number on a payment profile, you will + need to create a new payment profile for the given customer. + - A Payment Profile cannot be updated with the attributes of another type of + Payment Profile. For example, if the payment profile you are attempting to + update is a credit card, you cannot pass in bank account attributes (like + `bank_account_number`), and vice versa. + - Updating a payment profile directly will not trigger an attempt to capture + a past-due balance. If this is the intent, update the card details via the + Subscription instead. + - If you are using Authorize.net or Stripe, you may elect to manually trigger + a retry for a past due subscription after a partial update. Args: payment_profile_id (int): The Chargify id of the payment profile - body (UpdatePaymentProfileRequest, optional): The request body - parameter. + body (UpdatePaymentProfileRequest, optional): The request body parameter. Returns: PaymentProfileResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/payment_profiles/{payment_profile_id}.json') + .path("/payment_profiles/{payment_profile_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('payment_profile_id') - .value(payment_profile_id) - .is_required(True) - .should_encode(True)) + .key("payment_profile_id") + .value(payment_profile_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PaymentProfileResponse.from_dictionary) - .local_error('404', 'Not Found', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorStringMapResponseException) + .local_error("404", "Not Found", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorStringMapResponseException), ).execute() def delete_unused_payment_profile(self, payment_profile_id): - """Does a DELETE request to /payment_profiles/{payment_profile_id}.json. + """Perform a DELETE request to + /payment_profiles/{payment_profile_id}.json. Deletes an unused payment profile. - If the payment profile is in use by one or more subscriptions or - groups, a 422 and error message will be returned. + If the payment profile is in use by one or more subscriptions or groups, a + 422 and error message will be returned. Args: payment_profile_id (int): The Chargify id of the payment profile @@ -462,85 +468,80 @@ def delete_unused_payment_profile(self, void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/payment_profiles/{payment_profile_id}.json') + .path("/payment_profiles/{payment_profile_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('payment_profile_id') - .value(payment_profile_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("payment_profile_id") + .value(payment_profile_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def delete_subscriptions_payment_profile(self, subscription_id, payment_profile_id): - """Does a DELETE request to /subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}.json. - - This will delete a payment profile belonging to the customer on the - subscription. - + If the customer has multiple subscriptions, the payment profile will - be removed from all of them. - + If you delete the default payment profile for a subscription, you - will need to specify another payment profile to be the default through - the api, or either prompt the user to enter a card in the billing - portal or on the self-service page, or visit the Payment Details tab - on the subscription in the Admin UI and use the “Add New Credit Card” - or “Make Active Payment Method” link, (depending on whether there are - other cards present). + """Perform a DELETE request to + /subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}.json. + + Deletes a payment profile belonging to the customer on the subscription. + + If the customer has multiple subscriptions, the payment profile will be + removed from all of them. + + If you delete the default payment profile for a subscription, you will need + to specify another payment profile to be the default through the api, or + either prompt the user to enter a card in the billing portal or on the + self-service page, or visit the Payment Details tab on the subscription in + the Admin UI and use the “Add New Credit Card” or “Make Active Payment + Method” link, (depending on whether there are other cards present). Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. payment_profile_id (int): The Chargify id of the payment profile Returns: void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}.json') + .path("/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('payment_profile_id') - .value(payment_profile_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("payment_profile_id") + .value(payment_profile_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def verify_bank_account(self, bank_account_id, body=None): - """Does a PUT request to /bank_accounts/{bank_account_id}/verification.json. + """Perform a PUT request to + /bank_accounts/{bank_account_id}/verification.json. - Submit the two small deposit amounts the customer received in their - bank account in order to verify the bank account. (Stripe only) + Submit the two small deposit amounts the customer received in their bank + account in order to verify the bank account. (Stripe only) Args: - bank_account_id (int): Identifier of the bank account in the - system. + bank_account_id (int): Identifier of the bank account in the system. body (BankAccountVerificationRequest, optional): The request body parameter. @@ -548,48 +549,50 @@ def verify_bank_account(self, BankAccountResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/bank_accounts/{bank_account_id}/verification.json') + .path("/bank_accounts/{bank_account_id}/verification.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('bank_account_id') - .value(bank_account_id) - .is_required(True) - .should_encode(True)) + .key("bank_account_id") + .value(bank_account_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BankAccountResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def delete_subscription_group_payment_profile(self, uid, payment_profile_id): - """Does a DELETE request to /subscription_groups/{uid}/payment_profiles/{payment_profile_id}.json. + """Perform a DELETE request to + /subscription_groups/{uid}/payment_profiles/{payment_profile_id}.json. - This will delete a Payment Profile belonging to a Subscription Group. - **Note**: If the Payment Profile belongs to multiple Subscription - Groups and/or Subscriptions, it will be removed from all of them. + Deletes a Payment Profile belonging to a Subscription Group. + **Note**: If the Payment Profile belongs to multiple Subscription Groups + and/or Subscriptions, it will be removed from all of them. Args: uid (str): The uid of the subscription group @@ -599,94 +602,95 @@ def delete_subscription_group_payment_profile(self, void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/payment_profiles/{payment_profile_id}.json') + .path("/subscription_groups/{uid}/payment_profiles/{payment_profile_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('payment_profile_id') - .value(payment_profile_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("payment_profile_id") + .value(payment_profile_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def change_subscription_default_payment_profile(self, subscription_id, payment_profile_id): - """Does a POST request to /subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}/change_payment_profile.json. + """Perform a POST request to + /subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}/change_p + ayment_profile.json. - This will change the default payment profile on the subscription to - the existing payment profile with the id specified. + This will change the default payment profile on the subscription to the + existing payment profile with the id specified. You must elect to change the existing payment profile to a new payment - profile ID in order to receive a satisfactory response from this - endpoint. + profile ID in order to receive a satisfactory response from this endpoint. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. payment_profile_id (int): The Chargify id of the payment profile Returns: PaymentProfileResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}/change_payment_profile.json') + .path("/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}/change_payment_profile.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('payment_profile_id') - .value(payment_profile_id) - .is_required(True) - .should_encode(True)) + .key("payment_profile_id") + .value(payment_profile_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PaymentProfileResponse.from_dictionary) - .local_error('404', 'Not Found', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error("404", "Not Found", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def change_subscription_group_default_payment_profile(self, uid, payment_profile_id): - """Does a POST request to /subscription_groups/{uid}/payment_profiles/{payment_profile_id}/change_payment_profile.json. + """Perform a POST request to + /subscription_groups/{uid}/payment_profiles/{payment_profile_id}/change_payment + _profile.json. - This will change the default payment profile on the subscription group - to the existing payment profile with the id specified. + This will change the default payment profile on the subscription group to the + existing payment profile with the id specified. You must elect to change the existing payment profile to a new payment - profile ID in order to receive a satisfactory response from this - endpoint. - The new payment profile must belong to the subscription group's - customer, otherwise you will receive an error. + profile ID in order to receive a satisfactory response from this endpoint. + The new payment profile must belong to the subscription group's customer, + otherwise you will receive an error. Args: uid (str): The uid of the subscription group @@ -696,50 +700,51 @@ def change_subscription_group_default_payment_profile(self, PaymentProfileResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/payment_profiles/{payment_profile_id}/change_payment_profile.json') + .path("/subscription_groups/{uid}/payment_profiles/{payment_profile_id}/change_payment_profile.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('payment_profile_id') - .value(payment_profile_id) - .is_required(True) - .should_encode(True)) + .key("payment_profile_id") + .value(payment_profile_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PaymentProfileResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_one_time_token(self, chargify_token): - """Does a GET request to /one_time_tokens/{chargify_token}.json. + """Perform a GET request to /one_time_tokens/{chargify_token}.json. - One Time Tokens aka Advanced Billing Tokens house the credit card or - ACH (Authorize.Net or Stripe only) data for a customer. - You can use One Time Tokens while creating a subscription or payment - profile instead of passing all bank account or credit card data - directly to a given API endpoint. + One Time Tokens aka Advanced Billing Tokens house the credit card or ACH + (Authorize.Net or Stripe only) data for a customer. + You can use One Time Tokens while creating a subscription or payment profile + instead of passing all bank account or credit card data directly to a given + API endpoint. To obtain a One Time Token you have to use - [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C - hargify-js-Overview#chargify-js-overview-0-0). + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify + -js-Overview#chargify-js-overview-0-0). Args: chargify_token (str): Advanced Billing Token @@ -748,75 +753,74 @@ def read_one_time_token(self, GetOneTimeTokenRequest: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/one_time_tokens/{chargify_token}.json') + .path("/one_time_tokens/{chargify_token}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('chargify_token') - .value(chargify_token) - .is_required(True) - .should_encode(True)) + .key("chargify_token") + .value(chargify_token) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(GetOneTimeTokenRequest.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', ErrorListResponseException) + .local_error_template("404", + "Not Found:'{$response.body}'", + ErrorListResponseException), ).execute() def send_request_update_payment_email(self, subscription_id): - """Does a POST request to /subscriptions/{subscription_id}/request_payment_profiles_update.json. - - You can send a "request payment update" email to the customer - associated with the subscription. - If you attempt to send a "request payment update" email more than five - times within a 30-minute period, you will receive a `422` response - with an error message in the body. This error message will indicate - that the request has been rejected due to excessive attempts, and will - provide instructions on how to resubmit the request. - Additionally, if you attempt to send a "request payment update" email - for a subscription that does not exist, you will receive a `404` error - response. This error message will indicate that the subscription could - not be found, and will provide instructions on how to correct the - error and resubmit the request. - These error responses are designed to prevent excessive or invalid - requests, and to provide clear and helpful information to users who - encounter errors during the request process. + """Perform a POST request to + /subscriptions/{subscription_id}/request_payment_profiles_update.json. + + You can send a "request payment update" email to the customer associated with + the subscription. + If you attempt to send a "request payment update" email more than five times + within a 30-minute period, you will receive a `422` response with an error + message in the body. This error message will indicate that the request has + been rejected due to excessive attempts, and will provide instructions on how + to resubmit the request. + Additionally, if you attempt to send a "request payment update" email for a + subscription that does not exist, you will receive a `404` error response. + This error message will indicate that the subscription could not be found, + and will provide instructions on how to correct the error and resubmit the + request. + These error responses are designed to prevent excessive or invalid requests, + and to provide clear and helpful information to users who encounter errors + during the request process. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: void: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/request_payment_profiles_update.json') + .path("/subscriptions/{subscription_id}/request_payment_profiles_update.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() diff --git a/advancedbilling/controllers/product_families_controller.py b/advancedbilling/controllers/product_families_controller.py index f784da24..d66e844f 100644 --- a/advancedbilling/controllers/product_families_controller.py +++ b/advancedbilling/controllers/product_families_controller.py @@ -1,291 +1,299 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.product_response import ProductResponse -from advancedbilling.models.product_family_response import ProductFamilyResponse -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.product_family_response import ( + ProductFamilyResponse, +) +from advancedbilling.models.product_response import ( + ProductResponse, +) -class ProductFamiliesController(BaseController): +class ProductFamiliesController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ProductFamiliesController object.""" super(ProductFamiliesController, self).__init__(config) def list_products_for_product_family(self, options=dict()): - """Does a GET request to /product_families/{product_family_id}/products.json. + """Perform a GET request to + /product_families/{product_family_id}/products.json. Retrieves a list of Products belonging to a Product Family. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - product_family_id -- str -- Either the product family's id - or its handle prefixed with `handle:` - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - date_field -- BasicDateField -- The type of filter you - would like to apply to your search. Use in query: + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + product_family_id -- str -- Either the product family's id or its + handle prefixed with `handle:` + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + date_field -- BasicDateField -- The type of filter you would like + to apply to your search. Use in query: `date_field=created_at`. - filter -- ListProductsFilter -- Filter to use for List - Products operations - start_date -- date -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns products - with a timestamp at or after midnight (12:00:00 AM) in - your site’s time zone on the date specified. - end_date -- date -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns products with - a timestamp up to and including 11:59:59PM in your - site’s time zone on the date specified. - start_datetime -- datetime -- The start date and time - (format YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns products with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. + filter -- ListProductsFilter -- Filter to use for List Products + operations + start_date -- date -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns products with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + end_date -- date -- The end date (format YYYY-MM-DD) with which + to filter the date_field. Returns products with a timestamp + up to and including 11:59:59PM in your site’s time zone on + the date specified. + start_datetime -- datetime -- The start date and time (format + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns products with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. end_datetime -- datetime -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns products with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of end_date. + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns products with a timestamp at or before exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of end_date. include_archived -- bool -- Include archived products - include -- ListProductsInclude -- Allows including - additional data in the response. Use in query + include -- ListProductsInclude -- Allows including additional + data in the response. Use in query `include=prepaid_product_price_point`. Returns: List[ProductResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/products.json') + .path("/product_families/{product_family_id}/products.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_family_id') - .value(options.get('product_family_id', None)) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(options.get("product_family_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('start_datetime', None)))) + .key("start_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("start_datetime", None)))) .query_param(Parameter() - .key('end_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('end_datetime', None)))) + .key("end_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("end_datetime", None)))) .query_param(Parameter() - .key('include_archived') - .value(options.get('include_archived', None))) + .key("include_archived") + .value(options.get("include_archived", None))) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def create_product_family(self, body=None): - """Does a POST request to /product_families.json. + """Perform a POST request to /product_families.json. - Creates a Product Family within your Advanced Billing site. Create a - Product Family to act as a container for your products, components and - coupons. + Creates a Product Family within your Advanced Billing site. Create a Product + Family to act as a container for your products, components and coupons. Full documentation on how Product Families operate within the Advanced Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Produ - ct-Families). + [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Fami + lies). Args: - body (CreateProductFamilyRequest, optional): The request body - parameter. + body (CreateProductFamilyRequest, optional): The request body parameter. Returns: ProductFamilyResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families.json') + .path("/product_families.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductFamilyResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_product_families(self, options=dict()): - """Does a GET request to /product_families.json. + """Perform a GET request to /product_families.json. Retrieve a list of Product Families for a site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - date_field -- BasicDateField -- The type of filter you - would like to apply to your search. Use in query: + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + date_field -- BasicDateField -- The type of filter you would like + to apply to your search. Use in query: `date_field=created_at`. - start_date -- date -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns products - with a timestamp at or after midnight (12:00:00 AM) in - your site’s time zone on the date specified. - end_date -- date -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns products with - a timestamp up to and including 11:59:59PM in your - site’s time zone on the date specified. - start_datetime -- datetime -- The start date and time - (format YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns products with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. + start_date -- date -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns products with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + end_date -- date -- The end date (format YYYY-MM-DD) with which + to filter the date_field. Returns products with a timestamp + up to and including 11:59:59PM in your site’s time zone on + the date specified. + start_datetime -- datetime -- The start date and time (format + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns products with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. end_datetime -- datetime -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns products with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of end_date. + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns products with a timestamp at or before exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of end_date. Returns: List[ProductFamilyResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families.json') + .path("/product_families.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('start_datetime', None)))) + .key("start_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("start_datetime", None)))) .query_param(Parameter() - .key('end_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('end_datetime', None)))) + .key("end_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("end_datetime", None)))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductFamilyResponse.from_dictionary) + .deserialize_into(ProductFamilyResponse.from_dictionary), ).execute() def read_product_family(self, id): - """Does a GET request to /product_families/{id}.json. + """Perform a GET request to /product_families/{id}.json. - Retrieves a Product Family via the `product_family_id`. The response - will contain a Product Family object. - The product family can be specified either with the id number, or with - the `handle:my-family` format. + Retrieves a Product Family via the `product_family_id`. The response will + contain a Product Family object. + The product family can be specified either with the id number, or with the + `handle:my-family` format. Args: id (int): The Advanced Billing id of the product family @@ -294,28 +302,26 @@ def read_product_family(self, ProductFamilyResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{id}.json') + .path("/product_families/{id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('id') - .value(id) - .is_required(True) - .should_encode(True)) + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductFamilyResponse.from_dictionary) + .deserialize_into(ProductFamilyResponse.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/product_price_points_controller.py b/advancedbilling/controllers/product_price_points_controller.py index 534ec884..30a3d524 100644 --- a/advancedbilling/controllers/product_price_points_controller.py +++ b/advancedbilling/controllers/product_price_points_controller.py @@ -1,51 +1,79 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController -from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.product_price_point_response import ProductPricePointResponse -from advancedbilling.models.list_product_price_points_response import ListProductPricePointsResponse -from advancedbilling.models.product_response import ProductResponse -from advancedbilling.models.bulk_create_product_price_points_response import BulkCreateProductPricePointsResponse -from advancedbilling.models.currency_prices_response import CurrencyPricesResponse -from advancedbilling.exceptions.product_price_point_error_response_exception import ProductPricePointErrorResponseException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_array_map_response_exception import ErrorArrayMapResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_array_map_response_exception import ( + ErrorArrayMapResponseException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.exceptions.product_price_point_error_response_exception import ( + ProductPricePointErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.bulk_create_product_price_points_response import ( + BulkCreateProductPricePointsResponse, +) +from advancedbilling.models.currency_prices_response import ( + CurrencyPricesResponse, +) +from advancedbilling.models.list_product_price_points_response import ( + ListProductPricePointsResponse, +) +from advancedbilling.models.product_price_point_response import ( + ProductPricePointResponse, +) +from advancedbilling.models.product_response import ( + ProductResponse, +) +from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, +) -class ProductPricePointsController(BaseController): +class ProductPricePointsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ProductPricePointsController object.""" super(ProductPricePointsController, self).__init__(config) def create_product_price_point(self, product_id, body=None): - """Does a POST request to /products/{product_id}/price_points.json. + """Perform a POST request to /products/{product_id}/price_points.json. Creates a Product Price Point. See the [Product Price - Point](https://maxio.zendesk.com/hc/en-us/articles/24261111947789-Produ - ct-Price-Points) documentation for details. + Point](https://maxio.zendesk.com/hc/en-us/articles/24261111947789-Product-Pric + e-Points) documentation for details. Args: - product_id (int | str): The id or handle of the product. When - using the handle, it must be prefixed with `handle:` + product_id (int | str): The id or handle of the product. When using the + handle, it must be prefixed with `handle:` body (CreateProductPricePointRequest, optional): The request body parameter. @@ -53,149 +81,145 @@ def create_product_price_point(self, ProductPricePointResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points.json') + .path("/products/{product_id}/price_points.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('CreateProductPricePointProductId').validate(value))) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("CreateProductPricePointProductId").validate(value))) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductPricePointResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ProductPricePointErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ProductPricePointErrorResponseException), ).execute() def list_product_price_points(self, options=dict()): - """Does a GET request to /products/{product_id}/price_points.json. + """Perform a GET request to /products/{product_id}/price_points.json. Retrieves a list of product price points. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - product_id -- int | str -- The id or handle of the - product. When using the handle, it must be prefixed - with `handle:` - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 10. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + product_id -- int | str -- The id or handle of the product. When + using the handle, it must be prefixed with `handle:` + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 10. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. currency_prices -- bool -- When fetching a product's price - points, if you have defined multiple currencies at the - site level, you can optionally pass the - ?currency_prices=true query param to include an array - of currency price data in the response. If the product - price point is set to use_site_exchange_rate: true, it - will return pricing based on the current exchange - rate. If the flag is set to false, it will return all - of the defined prices for each currency. + points, if you have defined multiple currencies at the site + level, you can optionally pass the ?currency_prices=true + query param to include an array of currency price data in the + response. If the product price point is set to + use_site_exchange_rate: true, it will return pricing based on + the current exchange rate. If the flag is set to false, it + will return all of the defined prices for each currency. filter_type -- List[PricePointType] -- Use in query: `filter[type]=catalog,default`. - archived -- bool -- Set to include archived price points - in the response. + archived -- bool -- Set to include archived price points in the + response. Returns: ListProductPricePointsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points.json') + .path("/products/{product_id}/price_points.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_id') - .value(options.get('product_id', None)) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ListProductPricePointsInputProductId').validate(value))) + .key("product_id") + .value(options.get("product_id", None)) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ListProductPricePointsInputProductId").validate(value))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('currency_prices') - .value(options.get('currency_prices', None))) + .key("currency_prices") + .value(options.get("currency_prices", None))) .query_param(Parameter() - .key('filter[type]') - .value(options.get('filter_type', None))) + .key("filter[type]") + .value(options.get("filter_type", None))) .query_param(Parameter() - .key('archived') - .value(options.get('archived', None))) + .key("archived") + .value(options.get("archived", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListProductPricePointsResponse.from_dictionary) + .deserialize_into(ListProductPricePointsResponse.from_dictionary), ).execute() def update_product_price_point(self, product_id, price_point_id, body=None): - """Does a PUT request to /products/{product_id}/price_points/{price_point_id}.json. + """Perform a PUT request to + /products/{product_id}/price_points/{price_point_id}.json. Updates a product price point. Note: Custom product price points cannot be updated. Args: - product_id (int | str): The id or handle of the product. When - using the handle, it must be prefixed with `handle:`. Example: - `123` for an integer ID, or `handle:example-product-handle` - for a string handle. - price_point_id (int | str): The id or handle of the price point. - When using the handle, it must be prefixed with `handle:`. - Example: `123` for an integer ID, or - `handle:example-product-price-point-handle` for a string - handle. + product_id (int | str): The id or handle of the product. When using the + handle, it must be prefixed with `handle:`. Example: `123` for an + integer ID, or `handle:example-product-handle` for a string handle. + price_point_id (int | str): The id or handle of the price point. When + using the handle, it must be prefixed with `handle:`. Example: `123` + for an integer ID, or `handle:example-product-price-point-handle` for + a string handle. body (UpdateProductPricePointRequest, optional): The request body parameter. @@ -203,507 +227,500 @@ def update_product_price_point(self, ProductPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points/{price_point_id}.json') + .path("/products/{product_id}/price_points/{price_point_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('UpdateProductPricePointProductId').validate(value))) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("UpdateProductPricePointProductId").validate(value))) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('UpdateProductPricePointPricePointId').validate(value))) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("UpdateProductPricePointPricePointId").validate(value))) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductPricePointResponse.from_dictionary) + .deserialize_into(ProductPricePointResponse.from_dictionary), ).execute() def read_product_price_point(self, product_id, price_point_id, currency_prices=None): - """Does a GET request to /products/{product_id}/price_points/{price_point_id}.json. + """Perform a GET request to + /products/{product_id}/price_points/{price_point_id}.json. - Use this endpoint to retrieve details for a specific product price - point. You can achieve this by using either the product price point ID - or handle. + Use this endpoint to retrieve details for a specific product price point. You + can achieve this by using either the product price point ID or handle. Args: - product_id (int | str): The id or handle of the product. When - using the handle, it must be prefixed with `handle:`. Example: - `123` for an integer ID, or `handle:example-product-handle` - for a string handle. - price_point_id (int | str): The id or handle of the price point. - When using the handle, it must be prefixed with `handle:`. - Example: `123` for an integer ID, or - `handle:example-product-price-point-handle` for a string - handle. - currency_prices (bool, optional): When fetching a product's price - points, if you have defined multiple currencies at the site - level, you can optionally pass the ?currency_prices=true query - param to include an array of currency price data in the - response. If the product price point is set to - use_site_exchange_rate: true, it will return pricing based on - the current exchange rate. If the flag is set to false, it + product_id (int | str): The id or handle of the product. When using the + handle, it must be prefixed with `handle:`. Example: `123` for an + integer ID, or `handle:example-product-handle` for a string handle. + price_point_id (int | str): The id or handle of the price point. When + using the handle, it must be prefixed with `handle:`. Example: `123` + for an integer ID, or `handle:example-product-price-point-handle` for + a string handle. + currency_prices (bool, optional): When fetching a product's price points, + if you have defined multiple currencies at the site level, you can + optionally pass the ?currency_prices=true query param to include an + array of currency price data in the response. If the product price + point is set to use_site_exchange_rate: true, it will return pricing + based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. Returns: ProductPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points/{price_point_id}.json') + .path("/products/{product_id}/price_points/{price_point_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ReadProductPricePointProductId').validate(value))) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ReadProductPricePointProductId").validate(value))) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ReadProductPricePointPricePointId').validate(value))) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ReadProductPricePointPricePointId").validate(value))) .query_param(Parameter() - .key('currency_prices') - .value(currency_prices)) + .key("currency_prices") + .value(currency_prices)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductPricePointResponse.from_dictionary) + .deserialize_into(ProductPricePointResponse.from_dictionary), ).execute() def archive_product_price_point(self, product_id, price_point_id): - """Does a DELETE request to /products/{product_id}/price_points/{price_point_id}.json. + """Perform a DELETE request to + /products/{product_id}/price_points/{price_point_id}.json. Archives a product price point. Args: - product_id (int | str): The id or handle of the product. When - using the handle, it must be prefixed with `handle:`. Example: - `123` for an integer ID, or `handle:example-product-handle` - for a string handle. - price_point_id (int | str): The id or handle of the price point. - When using the handle, it must be prefixed with `handle:`. - Example: `123` for an integer ID, or - `handle:example-product-price-point-handle` for a string - handle. + product_id (int | str): The id or handle of the product. When using the + handle, it must be prefixed with `handle:`. Example: `123` for an + integer ID, or `handle:example-product-handle` for a string handle. + price_point_id (int | str): The id or handle of the price point. When + using the handle, it must be prefixed with `handle:`. Example: `123` + for an integer ID, or `handle:example-product-price-point-handle` for + a string handle. Returns: ProductPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points/{price_point_id}.json') + .path("/products/{product_id}/price_points/{price_point_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ArchiveProductPricePointProductId').validate(value))) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ArchiveProductPricePointProductId").validate(value))) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ArchiveProductPricePointPricePointId').validate(value))) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ArchiveProductPricePointPricePointId").validate(value))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductPricePointResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def unarchive_product_price_point(self, product_id, price_point_id): - """Does a PATCH request to /products/{product_id}/price_points/{price_point_id}/unarchive.json. + """Perform a PATCH request to + /products/{product_id}/price_points/{price_point_id}/unarchive.json. Use this endpoint to unarchive an archived product price point. Args: - product_id (int): The Advanced Billing id of the product to which - the price point belongs - price_point_id (int): The Advanced Billing id of the product price - point + product_id (int): The Advanced Billing id of the product to which the + price point belongs + price_point_id (int): The Advanced Billing id of the product price point Returns: ProductPricePointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points/{price_point_id}/unarchive.json') + .path("/products/{product_id}/price_points/{price_point_id}/unarchive.json") .http_method(HttpMethodEnum.PATCH) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True)) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductPricePointResponse.from_dictionary) + .deserialize_into(ProductPricePointResponse.from_dictionary), ).execute() def promote_product_price_point_to_default(self, product_id, price_point_id): - """Does a PATCH request to /products/{product_id}/price_points/{price_point_id}/default.json. + """Perform a PATCH request to + /products/{product_id}/price_points/{price_point_id}/default.json. Sets a product price point as the default for the product. - Note: Custom product price points cannot be set as the default for a - product. + Note: Custom product price points cannot be set as the default for a product. Args: - product_id (int): The Advanced Billing id of the product to which - the price point belongs - price_point_id (int): The Advanced Billing id of the product price - point + product_id (int): The Advanced Billing id of the product to which the + price point belongs + price_point_id (int): The Advanced Billing id of the product price point Returns: ProductResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points/{price_point_id}/default.json') + .path("/products/{product_id}/price_points/{price_point_id}/default.json") .http_method(HttpMethodEnum.PATCH) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True)) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('price_point_id') - .value(price_point_id) - .is_required(True) - .should_encode(True)) + .key("price_point_id") + .value(price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductResponse.from_dictionary) + .deserialize_into(ProductResponse.from_dictionary), ).execute() def bulk_create_product_price_points(self, product_id, body=None): - """Does a POST request to /products/{product_id}/price_points/bulk.json. + """Perform a POST request to + /products/{product_id}/price_points/bulk.json. Creates multiple product price points in one request. Args: - product_id (int): The Advanced Billing id of the product to which - the price points belong - body (BulkCreateProductPricePointsRequest, optional): The request - body parameter. + product_id (int): The Advanced Billing id of the product to which the + price points belong + body (BulkCreateProductPricePointsRequest, optional): The request body + parameter. Returns: - BulkCreateProductPricePointsResponse: Response from the API. - Created + BulkCreateProductPricePointsResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}/price_points/bulk.json') + .path("/products/{product_id}/price_points/bulk.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True)) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BulkCreateProductPricePointsResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + APIException), ).execute() def create_product_currency_prices(self, product_price_point_id, body=None): - """Does a POST request to /product_price_points/{product_price_point_id}/currency_prices.json. - - Creates currency prices for a given currency that has been defined on - the site level in your settings. - When creating currency prices, they need to mirror the structure of - your primary pricing. If the product price point defines a trial - and/or setup fee, each currency must also define a trial and/or setup - fee. - Note: Currency Prices are not able to be created for custom product - price points. + """Perform a POST request to + /product_price_points/{product_price_point_id}/currency_prices.json. + + Creates currency prices for a given currency that has been defined on the + site level in your settings. + When creating currency prices, they need to mirror the structure of your + primary pricing. If the product price point defines a trial and/or setup fee, + each currency must also define a trial and/or setup fee. + Note: Currency Prices are not able to be created for custom product price + points. Args: - product_price_point_id (int): The Advanced Billing id of the - product price point - body (CreateProductCurrencyPricesRequest, optional): The request - body parameter. + product_price_point_id (int): The Advanced Billing id of the product + price point + body (CreateProductCurrencyPricesRequest, optional): The request body + parameter. Returns: CurrencyPricesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_price_points/{product_price_point_id}/currency_prices.json') + .path("/product_price_points/{product_price_point_id}/currency_prices.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_price_point_id') - .value(product_price_point_id) - .is_required(True) - .should_encode(True)) + .key("product_price_point_id") + .value(product_price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CurrencyPricesResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def update_product_currency_prices(self, product_price_point_id, body=None): - """Does a PUT request to /product_price_points/{product_price_point_id}/currency_prices.json. - - Updates the `price`s of currency prices for a given currency that - exists on the product price point. - When updating the pricing, it needs to mirror the structure of your - primary pricing. If the product price point defines a trial and/or - setup fee, each currency must also define a trial and/or setup fee. - Note: Currency Prices cannot be updated for custom product price - points. + """Perform a PUT request to + /product_price_points/{product_price_point_id}/currency_prices.json. + + Updates the `price`s of currency prices for a given currency that exists on + the product price point. + When updating the pricing, it needs to mirror the structure of your primary + pricing. If the product price point defines a trial and/or setup fee, each + currency must also define a trial and/or setup fee. + Note: Currency Prices cannot be updated for custom product price points. Args: - product_price_point_id (int): The Advanced Billing id of the - product price point - body (UpdateCurrencyPricesRequest, optional): The request body - parameter. + product_price_point_id (int): The Advanced Billing id of the product + price point + body (UpdateCurrencyPricesRequest, optional): The request body parameter. Returns: CurrencyPricesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_price_points/{product_price_point_id}/currency_prices.json') + .path("/product_price_points/{product_price_point_id}/currency_prices.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('product_price_point_id') - .value(product_price_point_id) - .is_required(True) - .should_encode(True)) + .key("product_price_point_id") + .value(product_price_point_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CurrencyPricesResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def list_all_product_price_points(self, options=dict()): - """Does a GET request to /products_price_points.json. + """Perform a GET request to /products_price_points.json. - This method allows retrieval of a list of Products Price Points - belonging to a Site. + This method allows retrieval of a list of Products Price Points belonging to + a Site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. filter -- ListPricePointsFilter -- Filter to use for List PricePoints operations - include -- ListProductsPricePointsInclude -- Allows - including additional data in the response. Use in - query: `include=currency_prices`. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + include -- ListProductsPricePointsInclude -- Allows including + additional data in the response. Use in query: + `include=currency_prices`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. Returns: ListProductPricePointsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products_price_points.json') + .path("/products_price_points.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListProductPricePointsResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/controllers/products_controller.py b/advancedbilling/controllers/products_controller.py index cd8f6c3a..8c1adaa4 100644 --- a/advancedbilling/controllers/products_controller.py +++ b/advancedbilling/controllers/products_controller.py @@ -1,91 +1,104 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.product_response import ProductResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.product_response import ( + ProductResponse, +) -class ProductsController(BaseController): +class ProductsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ProductsController object.""" super(ProductsController, self).__init__(config) def create_product(self, product_family_id, body=None): - """Does a POST request to /product_families/{product_family_id}/products.json. + """Perform a POST request to + /product_families/{product_family_id}/products.json. Creates a product in your Advanced Billing site. See the following product docuemation for more information: + [Products - Documentation](https://maxio.zendesk.com/hc/en-us/articles/242610901176 - 45-Products-Overview) + Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Prod + ucts-Overview) + [Changing a Subscription's - Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Pro - duct-Changes-and-Migrations) + Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Ch + anges-and-Migrations) Args: - product_family_id (str): Either the product family's id or its - handle prefixed with `handle:` - body (CreateOrUpdateProductRequest, optional): The request body - parameter. + product_family_id (str): Either the product family's id or its handle + prefixed with `handle:` + body (CreateOrUpdateProductRequest, optional): The request body parameter. Returns: ProductResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/product_families/{product_family_id}/products.json') + .path("/product_families/{product_family_id}/products.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('product_family_id') - .value(product_family_id) - .is_required(True) - .should_encode(True)) + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_product(self, product_id): - """Does a GET request to /products/{product_id}.json. + """Perform a GET request to /products/{product_id}.json. Reads the current details of a product. @@ -96,98 +109,94 @@ def read_product(self, ProductResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}.json') + .path("/products/{product_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True)) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductResponse.from_dictionary) + .deserialize_into(ProductResponse.from_dictionary), ).execute() def update_product(self, product_id, body=None): - """Does a PUT request to /products/{product_id}.json. + """Perform a PUT request to /products/{product_id}.json. Updates aspects of an existing product. ### Input Attributes Update Notes + `update_return_params` The parameters we will append to your `update_return_url`. See Return URLs and Parameters ### Product Price Point - Updating a product using this endpoint will create a new price point - and set it as the default price point for this product. If you should - like to update an existing product price point, that must be done - separately. + Updating a product using this endpoint will create a new price point and set + it as the default price point for this product. If you should like to update + an existing product price point, that must be done separately. Args: product_id (int): The Advanced Billing id of the product - body (CreateOrUpdateProductRequest, optional): The request body - parameter. + body (CreateOrUpdateProductRequest, optional): The request body parameter. Returns: ProductResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}.json') + .path("/products/{product_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True)) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def archive_product(self, product_id): - """Does a DELETE request to /products/{product_id}.json. + """Perform a DELETE request to /products/{product_id}.json. Archives the product. All current subscribers will be unffected; their subscription/purchase will continue to be charged monthly. - This will restrict the option to chose the product for purchase via - the Billing Portal, as well as disable Public Signup Pages for the - product. + This will restrict the option to chose the product for purchase via the + Billing Portal, as well as disable Public Signup Pages for the product. Args: product_id (int): The Advanced Billing id of the product @@ -196,36 +205,37 @@ def archive_product(self, ProductResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/{product_id}.json') + .path("/products/{product_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('product_id') - .value(product_id) - .is_required(True) - .should_encode(True)) + .key("product_id") + .value(product_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_product_by_handle(self, api_handle): - """Does a GET request to /products/handle/{api_handle}.json. + """Perform a GET request to /products/handle/{api_handle}.json. Retrieves a Product object by its `api_handle`. @@ -236,144 +246,137 @@ def read_product_by_handle(self, ProductResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products/handle/{api_handle}.json') + .path("/products/handle/{api_handle}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('api_handle') - .value(api_handle) - .is_required(True) - .should_encode(True)) + .key("api_handle") + .value(api_handle) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductResponse.from_dictionary) + .deserialize_into(ProductResponse.from_dictionary), ).execute() def list_products(self, options=dict()): - """Does a GET request to /products.json. + """Perform a GET request to /products.json. This method allows to retrieve a list of Products belonging to a Site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - date_field -- BasicDateField -- The type of filter you - would like to apply to your search. Use in query: + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + date_field -- BasicDateField -- The type of filter you would like + to apply to your search. Use in query: `date_field=created_at`. - filter -- ListProductsFilter -- Filter to use for List - Products operations - end_date -- date -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns products with - a timestamp up to and including 11:59:59PM in your - site’s time zone on the date specified. + filter -- ListProductsFilter -- Filter to use for List Products + operations + end_date -- date -- The end date (format YYYY-MM-DD) with which + to filter the date_field. Returns products with a timestamp + up to and including 11:59:59PM in your site’s time zone on + the date specified. end_datetime -- datetime -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns products with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site''s time zone - will be used. If provided, this parameter will be used - instead of end_date. - start_date -- date -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns products - with a timestamp at or after midnight (12:00:00 AM) in - your site’s time zone on the date specified. - start_datetime -- datetime -- The start date and time - (format YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns products with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site''s time zone - will be used. If provided, this parameter will be used - instead of start_date. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - include_archived -- bool -- Include archived products. Use - in query: `include_archived=true`. - include -- ListProductsInclude -- Allows including - additional data in the response. Use in query + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns products with a timestamp at or before exact time + provided in query. You can specify timezone in query - + otherwise your site''s time zone will be used. If provided, + this parameter will be used instead of end_date. + start_date -- date -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns products with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. + start_datetime -- datetime -- The start date and time (format + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns products with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site''s time zone will be used. If provided, + this parameter will be used instead of start_date. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + include_archived -- bool -- Include archived products. Use in + query: `include_archived=true`. + include -- ListProductsInclude -- Allows including additional + data in the response. Use in query `include=prepaid_product_price_point`. Returns: List[ProductResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/products.json') + .path("/products.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('end_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('end_datetime', None)))) + .key("end_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("end_datetime", None)))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('start_datetime', None)))) + .key("start_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("start_datetime", None)))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('include_archived') - .value(options.get('include_archived', None))) + .key("include_archived") + .value(options.get("include_archived", None))) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ProductResponse.from_dictionary) + .deserialize_into(ProductResponse.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/proforma_invoices_controller.py b/advancedbilling/controllers/proforma_invoices_controller.py index 2e7272c6..6a7fde58 100644 --- a/advancedbilling/controllers/proforma_invoices_controller.py +++ b/advancedbilling/controllers/proforma_invoices_controller.py @@ -1,51 +1,71 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.list_proforma_invoices_response import ListProformaInvoicesResponse -from advancedbilling.models.proforma_invoice import ProformaInvoice -from advancedbilling.models.signup_proforma_preview_response import SignupProformaPreviewResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.proforma_bad_request_error_response_exception import ProformaBadRequestErrorResponseException -from advancedbilling.exceptions.error_array_map_response_exception import ErrorArrayMapResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_array_map_response_exception import ( + ErrorArrayMapResponseException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.exceptions.proforma_bad_request_error_response_exception import ( + ProformaBadRequestErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_proforma_invoices_response import ( + ListProformaInvoicesResponse, +) +from advancedbilling.models.proforma_invoice import ( + ProformaInvoice, +) +from advancedbilling.models.signup_proforma_preview_response import ( + SignupProformaPreviewResponse, +) -class ProformaInvoicesController(BaseController): +class ProformaInvoicesController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ProformaInvoicesController object.""" super(ProformaInvoicesController, self).__init__(config) def create_consolidated_proforma_invoice(self, uid): - """Does a POST request to /subscription_groups/{uid}/proforma_invoices.json. - - This endpoint will trigger the creation of a consolidated proforma - invoice asynchronously. It will return a 201 with no message, or a 422 - with any errors. To find and view the new consolidated proforma - invoice, you may poll the subscription group listing for proforma - invoices; only one consolidated proforma invoice may be created per - group at a time. + """Perform a POST request to + /subscription_groups/{uid}/proforma_invoices.json. + + This endpoint will trigger the creation of a consolidated proforma invoice + asynchronously. It will return a 201 with no message, or a 422 with any + errors. To find and view the new consolidated proforma invoice, you may poll + the subscription group listing for proforma invoices; only one consolidated + proforma invoice may be created per group at a time. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. ## Restrictions - Proforma invoices are only available on Relationship Invoicing sites. - To create a proforma invoice, the subscription must not be prepaid, - and must be in a live state. + Proforma invoices are only available on Relationship Invoicing sites. To + create a proforma invoice, the subscription must not be prepaid, and must be + in a live state. Args: uid (str): The uid of the subscription group @@ -54,44 +74,40 @@ def create_consolidated_proforma_invoice(self, void: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/proforma_invoices.json') + .path("/subscription_groups/{uid}/proforma_invoices.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def list_subscription_group_proforma_invoices(self, options=dict()): - """Does a GET request to /subscription_groups/{uid}/proforma_invoices.json. + """Perform a GET request to + /subscription_groups/{uid}/proforma_invoices.json. - Only proforma invoices with a `consolidation_level` of parent are - returned. - By default, proforma invoices returned on the index will only include - totals, not detailed breakdowns for `line_items`, `discounts`, - `taxes`, `credits`, `payments`, `custom_fields`. To include - breakdowns, pass the specific field as a key in the query with a value - set to true. + Only proforma invoices with a `consolidation_level` of parent are returned. + By default, proforma invoices returned on the index will only include totals, + not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, + `payments`, `custom_fields`. To include breakdowns, pass the specific field + as a key in the query with a value set to true. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: uid -- str -- The uid of the subscription group line_items -- bool -- Include line items data discounts -- bool -- Include discounts data @@ -104,54 +120,53 @@ def list_subscription_group_proforma_invoices(self, ListProformaInvoicesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/proforma_invoices.json') + .path("/subscription_groups/{uid}/proforma_invoices.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('uid') - .value(options.get('uid', None)) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(options.get("uid", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('line_items') - .value(options.get('line_items', None))) + .key("line_items") + .value(options.get("line_items", None))) .query_param(Parameter() - .key('discounts') - .value(options.get('discounts', None))) + .key("discounts") + .value(options.get("discounts", None))) .query_param(Parameter() - .key('taxes') - .value(options.get('taxes', None))) + .key("taxes") + .value(options.get("taxes", None))) .query_param(Parameter() - .key('credits') - .value(options.get('credits', None))) + .key("credits") + .value(options.get("credits", None))) .query_param(Parameter() - .key('payments') - .value(options.get('payments', None))) + .key("payments") + .value(options.get("payments", None))) .query_param(Parameter() - .key('custom_fields') - .value(options.get('custom_fields', None))) + .key("custom_fields") + .value(options.get("custom_fields", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListProformaInvoicesResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def read_proforma_invoice(self, proforma_invoice_uid): - """Does a GET request to /proforma_invoices/{proforma_invoice_uid}.json. + """Perform a GET request to + /proforma_invoices/{proforma_invoice_uid}.json. Use this endpoint to read the details of an existing proforma invoice. ## Restrictions @@ -164,123 +179,178 @@ def read_proforma_invoice(self, ProformaInvoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/proforma_invoices/{proforma_invoice_uid}.json') + .path("/proforma_invoices/{proforma_invoice_uid}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('proforma_invoice_uid') - .value(proforma_invoice_uid) - .is_required(True) - .should_encode(True)) + .key("proforma_invoice_uid") + .value(proforma_invoice_uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProformaInvoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), + ).execute() + + def deliver_proforma_invoice(self, + proforma_invoice_uid, + body=None): + """Perform a POST request to + /proforma_invoices/{proforma_invoice_uid}.json. + + Allows for proforma invoices to be programmatically delivered via email. + Supports email + delivery to direct recipients, carbon-copy (cc) recipients, and blind + carbon-copy (bcc) recipients. + If `recipient_emails` is omitted, the system will fall back to the primary + recipient derived from the invoice or + subscription. At least one recipient must be present, either via the request + body or via this default behavior, so an + empty body may still succeed when defaults are available. + + Args: + proforma_invoice_uid (str): The uid of the proforma invoice + body (DeliverProformaInvoiceRequest, optional): The request body + parameter. + + Returns: + ProformaInvoice: Response from the API. Created + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/proforma_invoices/{proforma_invoice_uid}.json") + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key("proforma_invoice_uid") + .value(proforma_invoice_uid) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ProformaInvoice.from_dictionary) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def create_proforma_invoice(self, subscription_id): - """Does a POST request to /subscriptions/{subscription_id}/proforma_invoices.json. - - This endpoint will create a proforma invoice and return it as a - response. If the information becomes outdated, simply void the old - proforma invoice and generate a new one. - If you would like to preview the next billing amounts without - generating a full proforma invoice, use the renewal preview endpoint. + """Perform a POST request to + /subscriptions/{subscription_id}/proforma_invoices.json. + + This endpoint will create a proforma invoice and return it as a response. If + the information becomes outdated, simply void the old proforma invoice and + generate a new one. + If you would like to preview the next billing amounts without generating a + full proforma invoice, use the renewal preview endpoint. ## Restrictions - Proforma invoices are only available on Relationship Invoicing sites. - To create a proforma invoice, the subscription must not be in a group, - must not be prepaid, and must be in a live state. + Proforma invoices are only available on Relationship Invoicing sites. To + create a proforma invoice, the subscription must not be in a group, must not + be prepaid, and must be in a live state. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: ProformaInvoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/proforma_invoices.json') + .path("/subscriptions/{subscription_id}/proforma_invoices.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProformaInvoice.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_proforma_invoices(self, options=dict()): - """Does a GET request to /subscriptions/{subscription_id}/proforma_invoices.json. + """Perform a GET request to + /subscriptions/{subscription_id}/proforma_invoices.json. - By default, proforma invoices returned on the index will only include - totals, not detailed breakdowns for `line_items`, `discounts`, - `taxes`, `credits`, `payments`, or `custom_fields`. To include - breakdowns, pass the specific field as a key in the query with a value - set to `true`. + By default, proforma invoices returned on the index will only include totals, + not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, + `payments`, or `custom_fields`. To include breakdowns, pass the specific + field as a key in the query with a value set to `true`. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - subscription_id -- int -- The Chargify id of the - subscription - start_date -- str -- The beginning date range for the - invoice's Due Date, in the YYYY-MM-DD format. - end_date -- str -- The ending date range for the invoice's + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + subscription_id -- int -- The Chargify id of the subscription. + start_date -- str -- The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format. - status -- ProformaInvoiceStatus -- The current status of - the invoice. Allowed Values: draft, open, paid, - pending, voided - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - direction -- Direction -- The sort direction of the - returned invoices. + end_date -- str -- The ending date range for the invoice's Due + Date, in the YYYY-MM-DD format. + status -- ProformaInvoiceStatus -- The current status of the + invoice. Allowed Values: draft, open, paid, pending, voided + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + direction -- Direction -- The sort direction of the returned + invoices. line_items -- bool -- Include line items data discounts -- bool -- Include discounts data taxes -- bool -- Include taxes data @@ -292,83 +362,81 @@ def list_proforma_invoices(self, ListProformaInvoicesResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/proforma_invoices.json') + .path("/subscriptions/{subscription_id}/proforma_invoices.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None)) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(options.get("subscription_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('status') - .value(options.get('status', None))) + .key("status") + .value(options.get("status", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('line_items') - .value(options.get('line_items', None))) + .key("line_items") + .value(options.get("line_items", None))) .query_param(Parameter() - .key('discounts') - .value(options.get('discounts', None))) + .key("discounts") + .value(options.get("discounts", None))) .query_param(Parameter() - .key('taxes') - .value(options.get('taxes', None))) + .key("taxes") + .value(options.get("taxes", None))) .query_param(Parameter() - .key('credits') - .value(options.get('credits', None))) + .key("credits") + .value(options.get("credits", None))) .query_param(Parameter() - .key('payments') - .value(options.get('payments', None))) + .key("payments") + .value(options.get("payments", None))) .query_param(Parameter() - .key('custom_fields') - .value(options.get('custom_fields', None))) + .key("custom_fields") + .value(options.get("custom_fields", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListProformaInvoicesResponse.from_dictionary) + .deserialize_into(ListProformaInvoicesResponse.from_dictionary), ).execute() def void_proforma_invoice(self, proforma_invoice_uid, body=None): - """Does a POST request to /proforma_invoices/{proforma_invoice_uid}/void.json. + """Perform a POST request to + /proforma_invoices/{proforma_invoice_uid}/void.json. This endpoint will void a proforma invoice that has the status "draft". ## Restrictions Proforma invoices are only available on Relationship Invoicing sites. - Only proforma invoices that have the appropriate status may be - reopened. If the invoice identified by {uid} does not have the - appropriate status, the response will have HTTP status code 422 and an - error message. - A reason for the void operation is required to be included in the - request body. If one is not provided, the response will have HTTP - status code 422 and an error message. + Only proforma invoices that have the appropriate status may be reopened. If + the invoice identified by {uid} does not have the appropriate status, the + response will have HTTP status code 422 and an error message. + A reason for the void operation is required to be included in the request + body. If one is not provided, the response will have HTTP status code 422 and + an error message. Args: proforma_invoice_uid (str): The uid of the proforma invoice @@ -378,211 +446,220 @@ def void_proforma_invoice(self, ProformaInvoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/proforma_invoices/{proforma_invoice_uid}/void.json') + .path("/proforma_invoices/{proforma_invoice_uid}/void.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('proforma_invoice_uid') - .value(proforma_invoice_uid) - .is_required(True) - .should_encode(True)) + .key("proforma_invoice_uid") + .value(proforma_invoice_uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProformaInvoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def preview_proforma_invoice(self, subscription_id): - """Does a POST request to /subscriptions/{subscription_id}/proforma_invoices/preview.json. - - Return a preview of the data that will be included on a given - subscription's proforma invoice if one were to be generated. It will - have similar line items and totals as a renewal preview, but the - response will be presented in the format of a proforma invoice. - Consequently it will include additional information such as the name - and addresses that will appear on the proforma invoice. - The preview endpoint is subject to all the same conditions as the - proforma invoice endpoint. For example, previews are only available on - the Relationship Invoicing architecture, and previews cannot be made - for end-of-life subscriptions. - If all the data returned in the preview is as expected, you may then - create a static proforma invoice and send it to your customer. The - data within a preview will not be saved and will not be accessible - after the call is made. - Alternatively, if you have some proforma invoices already, you may - make a preview call to determine whether any billing information for - the subscription's upcoming renewal has changed. + """Perform a POST request to + /subscriptions/{subscription_id}/proforma_invoices/preview.json. + + Return a preview of the data that will be included on a given subscription's + proforma invoice if one were to be generated. It will have similar line items + and totals as a renewal preview, but the response will be presented in the + format of a proforma invoice. Consequently it will include additional + information such as the name and addresses that will appear on the proforma + invoice. + The preview endpoint is subject to all the same conditions as the proforma + invoice endpoint. For example, previews are only available on the + Relationship Invoicing architecture, and previews cannot be made for + end-of-life subscriptions. + If all the data returned in the preview is as expected, you may then create a + static proforma invoice and send it to your customer. The data within a + preview will not be saved and will not be accessible after the call is made. + Alternatively, if you have some proforma invoices already, you may make a + preview call to determine whether any billing information for the + subscription's upcoming renewal has changed. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: ProformaInvoice: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/proforma_invoices/preview.json') + .path("/subscriptions/{subscription_id}/proforma_invoices/preview.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProformaInvoice.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def create_signup_proforma_invoice(self, body=None): - """Does a POST request to /subscriptions/proforma_invoices.json. - - This endpoint is only available for Relationship Invoicing sites. It - cannot be used to create consolidated proforma invoices or preview - prepaid subscriptions. - Create a proforma invoice to preview costs before a subscription's - signup. Like other proforma invoices, it can be emailed to the - customer, voided, and publicly viewed on the chargifypay domain. + """Perform a POST request to /subscriptions/proforma_invoices.json. + + This endpoint is only available for Relationship Invoicing sites. It cannot + be used to create consolidated proforma invoices or preview prepaid + subscriptions. + Create a proforma invoice to preview costs before a subscription's signup. + Like other proforma invoices, it can be emailed to the customer, voided, and + publicly viewed on the chargifypay domain. Pass a payload that resembles a subscription create or signup preview - request. For example, you can specify components, coupons/a referral, - offers, custom pricing, and an existing customer or payment profile to - populate a shipping or billing address. - A product and customer first name, last name, and email are the - minimum requirements. We recommend associating the proforma invoice - with a customer_id to easily find their proforma invoices, since the - subscription_id will always be blank. + request. For example, you can specify components, coupons/a referral, offers, + custom pricing, and an existing customer or payment profile to populate a + shipping or billing address. + A product and customer first name, last name, and email are the minimum + requirements. We recommend associating the proforma invoice with a + customer_id to easily find their proforma invoices, since the subscription_id + will always be blank. Args: - body (CreateSubscriptionRequest, optional): The request body - parameter. + body (CreateSubscriptionRequest, optional): The request body parameter. Returns: ProformaInvoice: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/proforma_invoices.json') + .path("/subscriptions/proforma_invoices.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProformaInvoice.from_dictionary) - .local_error_template('400', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ProformaBadRequestErrorResponseException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("400", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ProformaBadRequestErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() def preview_signup_proforma_invoice(self, include=None, body=None): - """Does a POST request to /subscriptions/proforma_invoices/preview.json. - - This endpoint is only available for Relationship Invoicing sites. It - cannot be used to create consolidated proforma invoice previews or - preview prepaid subscriptions. - Create a signup preview in the format of a proforma invoice to preview - costs before a subscription's signup. You have the option of - optionally previewing the first renewal's costs as well. The proforma - invoice preview will not be persisted. + """Perform a POST request to + /subscriptions/proforma_invoices/preview.json. + + This endpoint is only available for Relationship Invoicing sites. It cannot + be used to create consolidated proforma invoice previews or preview prepaid + subscriptions. + Create a signup preview in the format of a proforma invoice to preview costs + before a subscription's signup. You have the option of optionally previewing + the first renewal's costs as well. The proforma invoice preview will not be + persisted. Pass a payload that resembles a subscription create or signup preview - request. For example, you can specify components, coupons/a referral, - offers, custom pricing, and an existing customer or payment profile to - populate a shipping or billing address. - A product and customer first name, last name, and email are the - minimum requirements. + request. For example, you can specify components, coupons/a referral, offers, + custom pricing, and an existing customer or payment profile to populate a + shipping or billing address. + A product and customer first name, last name, and email are the minimum + requirements. Args: - include (CreateSignupProformaPreviewInclude, optional): Choose to - include a proforma invoice preview for the first renewal. Use - in query `include=next_proforma_invoice`. - body (CreateSubscriptionRequest, optional): The request body - parameter. + include (CreateSignupProformaPreviewInclude, optional): Choose to include + a proforma invoice preview for the first renewal. Use in query + `include=next_proforma_invoice`. + body (CreateSubscriptionRequest, optional): The request body parameter. Returns: SignupProformaPreviewResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/proforma_invoices/preview.json') + .path("/subscriptions/proforma_invoices/preview.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .query_param(Parameter() - .key('include') - .value(include)) + .key("include") + .value(include)) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SignupProformaPreviewResponse.from_dictionary) - .local_error_template('400', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ProformaBadRequestErrorResponseException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("400", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ProformaBadRequestErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() diff --git a/advancedbilling/controllers/reason_codes_controller.py b/advancedbilling/controllers/reason_codes_controller.py index f1d2c73d..e6d5ab7f 100644 --- a/advancedbilling/controllers/reason_codes_controller.py +++ b/advancedbilling/controllers/reason_codes_controller.py @@ -1,156 +1,167 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.reason_code_response import ReasonCodeResponse -from advancedbilling.models.ok_response import OkResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.ok_response import ( + OkResponse, +) +from advancedbilling.models.reason_code_response import ( + ReasonCodeResponse, +) -class ReasonCodesController(BaseController): +class ReasonCodesController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ReasonCodesController object.""" super(ReasonCodesController, self).__init__(config) def create_reason_code(self, body=None): - """Does a POST request to /reason_codes.json. + """Perform a POST request to /reason_codes.json. # Reason Codes Intro - ReasonCodes are a way to gain a high level view of why your customers - are cancelling the subscription to your product or service. - Add a set of churn reason codes to be displayed in-app and/or the - Maxio Billing Portal. As your subscribers decide to cancel their - subscription, learn why they decided to cancel. + ReasonCodes are a way to gain a high level view of why your customers are + cancelling the subscription to your product or service. + Add a set of churn reason codes to be displayed in-app and/or the Maxio + Billing Portal. As your subscribers decide to cancel their subscription, + learn why they decided to cancel. ## Reason Code Documentation - Full documentation on how Reason Codes operate within Advanced Billing - can be located under the following links. + Full documentation on how Reason Codes operate within Advanced Billing can be + located under the following links. [Churn Reason - Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn - -Reason-Codes) + Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason + -Codes) ## Create Reason Code - This method gives a merchant the option to create a reason codes for a - given Site. + This method gives a merchant the option to create a reason codes for a given + Site. Args: - body (CreateReasonCodeRequest, optional): The request body - parameter. + body (CreateReasonCodeRequest, optional): The request body parameter. Returns: ReasonCodeResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/reason_codes.json') + .path("/reason_codes.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ReasonCodeResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_reason_codes(self, options=dict()): - """Does a GET request to /reason_codes.json. + """Perform a GET request to /reason_codes.json. - This method gives a merchant the option to retrieve a list of all of - the current churn codes for a given site. + This method gives a merchant the option to retrieve a list of all of the + current churn codes for a given site. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. Returns: List[ReasonCodeResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/reason_codes.json') + .path("/reason_codes.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ReasonCodeResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_reason_code(self, reason_code_id): - """Does a GET request to /reason_codes/{reason_code_id}.json. + """Perform a GET request to /reason_codes/{reason_code_id}.json. - This method gives a merchant the option to retrieve a list of a - particular code for a given Site by providing the unique numerical ID - of the code. + This method gives a merchant the option to retrieve a list of a particular + code for a given Site by providing the unique numerical ID of the code. Args: reason_code_id (int): The Advanced Billing id of the reason code @@ -159,91 +170,89 @@ def read_reason_code(self, ReasonCodeResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/reason_codes/{reason_code_id}.json') + .path("/reason_codes/{reason_code_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('reason_code_id') - .value(reason_code_id) - .is_required(True) - .should_encode(True)) + .key("reason_code_id") + .value(reason_code_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ReasonCodeResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def update_reason_code(self, reason_code_id, body=None): - """Does a PUT request to /reason_codes/{reason_code_id}.json. + """Perform a PUT request to /reason_codes/{reason_code_id}.json. - This method gives a merchant the option to update an existing reason - code for a given site. + This method gives a merchant the option to update an existing reason code for + a given site. Args: reason_code_id (int): The Advanced Billing id of the reason code - body (UpdateReasonCodeRequest, optional): The request body - parameter. + body (UpdateReasonCodeRequest, optional): The request body parameter. Returns: ReasonCodeResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/reason_codes/{reason_code_id}.json') + .path("/reason_codes/{reason_code_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('reason_code_id') - .value(reason_code_id) - .is_required(True) - .should_encode(True)) + .key("reason_code_id") + .value(reason_code_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ReasonCodeResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def delete_reason_code(self, reason_code_id): - """Does a DELETE request to /reason_codes/{reason_code_id}.json. + """Perform a DELETE request to /reason_codes/{reason_code_id}.json. - This method gives a merchant the option to delete one reason code from - the Churn Reason Codes. This code will be immediately removed. This - action is not reversible. + This method gives a merchant the option to delete one reason code from the + Churn Reason Codes. This code will be immediately removed. This action is not + reversible. Args: reason_code_id (int): The Advanced Billing id of the reason code @@ -252,29 +261,27 @@ def delete_reason_code(self, OkResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/reason_codes/{reason_code_id}.json') + .path("/reason_codes/{reason_code_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('reason_code_id') - .value(reason_code_id) - .is_required(True) - .should_encode(True)) + .key("reason_code_id") + .value(reason_code_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(OkResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() diff --git a/advancedbilling/controllers/referral_codes_controller.py b/advancedbilling/controllers/referral_codes_controller.py index 2b80a3dd..3b9eb73c 100644 --- a/advancedbilling/controllers/referral_codes_controller.py +++ b/advancedbilling/controllers/referral_codes_controller.py @@ -1,46 +1,55 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.referral_validation_response import ReferralValidationResponse -from advancedbilling.exceptions.single_string_error_response_exception import SingleStringErrorResponseException + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.single_string_error_response_exception import ( + SingleStringErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.referral_validation_response import ( + ReferralValidationResponse, +) class ReferralCodesController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize ReferralCodesController object.""" super(ReferralCodesController, self).__init__(config) def validate_referral_code(self, code): - """Does a GET request to /referral_codes/validate.json. + """Perform a GET request to /referral_codes/validate.json. - Use this method to determine if the referral code is valid and - applicable within your Site. This method is useful for validating - referral codes that are entered by a customer. + Use this method to determine if the referral code is valid and applicable + within your Site. This method is useful for validating referral codes that + are entered by a customer. ## Referrals Documentation Full documentation on how to use the referrals feature in the Advanced Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Refer - rals). + [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referrals). ## Server Response - If the referral code is valid the status code will be `200` and the - referral code will be returned. If the referral code is invalid, a - `404` response will be returned. + If the referral code is valid the status code will be `200` and the referral + code will be returned. If the referral code is invalid, a `404` response will + be returned. Args: code (str): The referral code you are trying to validate @@ -49,28 +58,28 @@ def validate_referral_code(self, ReferralValidationResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/referral_codes/validate.json') + .path("/referral_codes/validate.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('code') - .value(code) - .is_required(True)) + .key("code") + .value(code) + .is_required(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ReferralValidationResponse.from_dictionary) - .local_error_template('404', 'Invalid referral code.', SingleStringErrorResponseException) + .local_error_template("404", + "Invalid referral code.", + SingleStringErrorResponseException), ).execute() diff --git a/advancedbilling/controllers/sales_commissions_controller.py b/advancedbilling/controllers/sales_commissions_controller.py index b5207c99..2abc6239 100644 --- a/advancedbilling/controllers/sales_commissions_controller.py +++ b/advancedbilling/controllers/sales_commissions_controller.py @@ -1,305 +1,304 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.sale_rep_settings import SaleRepSettings -from advancedbilling.models.list_sale_rep_item import ListSaleRepItem -from advancedbilling.models.sale_rep import SaleRep +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_sale_rep_item import ( + ListSaleRepItem, +) +from advancedbilling.models.sale_rep import ( + SaleRep, +) +from advancedbilling.models.sale_rep_settings import ( + SaleRepSettings, +) -class SalesCommissionsController(BaseController): +class SalesCommissionsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SalesCommissionsController object.""" super(SalesCommissionsController, self).__init__(config) def list_sales_commission_settings(self, options=dict()): - """Does a GET request to /sellers/{seller_id}/sales_commission_settings.json. + """Perform a GET request to + /sellers/{seller_id}/sales_commission_settings.json. Endpoint returns subscriptions with associated sales reps ## Modified Authentication Process - The Sales Commission API differs from other Chargify API endpoints. - This resource is associated with the seller itself. Up to now all - available resources were at the level of the site, therefore creating - the API Key per site was a sufficient solution. To share resources at - the seller level, a new authentication method was introduced, which is - user authentication. Creating an API Key for a user is a required step - to correctly use the Sales Commission API, more details - [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5 - NTg0-2020-04-20-new-api-authentication). - Access to the Sales Commission API endpoints is available to users - with financial access, where the seller has the Advanced Analytics - component enabled. For further information on getting access to - Advanced Analytics contact Maxio support. - > Note: The request is at seller level, it means `<>` - variable will be replaced by `app` + The Sales Commission API differs from other Chargify API endpoints. This + resource is associated with the seller itself. Up to now all available + resources were at the level of the site, therefore creating the API Key per + site was a sufficient solution. To share resources at the seller level, a new + authentication method was introduced, which is user authentication. Creating + an API Key for a user is a required step to correctly use the Sales + Commission API, more details + [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-20 + 20-04-20-new-api-authentication). + Access to the Sales Commission API endpoints is available to users with + financial access, where the seller has the Advanced Analytics component + enabled. For further information on getting access to Advanced Analytics + contact Maxio support. + > Note: The request is at seller level, it means `<>` variable + will be replaced by `app` Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: seller_id -- str -- The Chargify id of your seller account - authorization -- str -- For authorization use user API - key. See details - [here](https://developers.chargify.com/docs/developer-d - ocs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication) - . - live_mode -- bool -- This parameter indicates if records - should be fetched from live mode sites. Default value - is true. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 100. + authorization -- str -- For authorization use user API key. See + details + [here](https://developers.chargify.com/docs/developer-docs/ZG9 + jOjMyNzk5NTg0-2020-04-20-new-api-authentication). + live_mode -- bool -- This parameter indicates if records should + be fetched from live mode sites. Default value is true. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 100. Returns: List[SaleRepSettings]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/sellers/{seller_id}/sales_commission_settings.json') + .path("/sellers/{seller_id}/sales_commission_settings.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('seller_id') - .value(options.get('seller_id', None)) - .is_required(True) - .should_encode(True)) + .key("seller_id") + .value(options.get("seller_id", None)) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Authorization') - .value(options.get('authorization', None))) + .key("Authorization") + .value(options.get("authorization", None))) .query_param(Parameter() - .key('live_mode') - .value(options.get('live_mode', None))) + .key("live_mode") + .value(options.get("live_mode", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SaleRepSettings.from_dictionary) + .deserialize_into(SaleRepSettings.from_dictionary), ).execute() def list_sales_reps(self, options=dict()): - """Does a GET request to /sellers/{seller_id}/sales_reps.json. + """Perform a GET request to /sellers/{seller_id}/sales_reps.json. Endpoint returns sales rep list with details ## Modified Authentication Process - The Sales Commission API differs from other Chargify API endpoints. - This resource is associated with the seller itself. Up to now all - available resources were at the level of the site, therefore creating - the API Key per site was a sufficient solution. To share resources at - the seller level, a new authentication method was introduced, which is - user authentication. Creating an API Key for a user is a required step - to correctly use the Sales Commission API, more details - [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5 - NTg0-2020-04-20-new-api-authentication). - Access to the Sales Commission API endpoints is available to users - with financial access, where the seller has the Advanced Analytics - component enabled. For further information on getting access to - Advanced Analytics contact Maxio support. - > Note: The request is at seller level, it means `<>` - variable will be replaced by `app` + The Sales Commission API differs from other Chargify API endpoints. This + resource is associated with the seller itself. Up to now all available + resources were at the level of the site, therefore creating the API Key per + site was a sufficient solution. To share resources at the seller level, a new + authentication method was introduced, which is user authentication. Creating + an API Key for a user is a required step to correctly use the Sales + Commission API, more details + [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-20 + 20-04-20-new-api-authentication). + Access to the Sales Commission API endpoints is available to users with + financial access, where the seller has the Advanced Analytics component + enabled. For further information on getting access to Advanced Analytics + contact Maxio support. + > Note: The request is at seller level, it means `<>` variable + will be replaced by `app` Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: seller_id -- str -- The Chargify id of your seller account - authorization -- str -- For authorization use user API - key. See details - [here](https://developers.chargify.com/docs/developer-d - ocs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication) - . - live_mode -- bool -- This parameter indicates if records - should be fetched from live mode sites. Default value - is true. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 100. + authorization -- str -- For authorization use user API key. See + details + [here](https://developers.chargify.com/docs/developer-docs/ZG9 + jOjMyNzk5NTg0-2020-04-20-new-api-authentication). + live_mode -- bool -- This parameter indicates if records should + be fetched from live mode sites. Default value is true. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 100. Returns: List[ListSaleRepItem]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/sellers/{seller_id}/sales_reps.json') + .path("/sellers/{seller_id}/sales_reps.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('seller_id') - .value(options.get('seller_id', None)) - .is_required(True) - .should_encode(True)) + .key("seller_id") + .value(options.get("seller_id", None)) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Authorization') - .value(options.get('authorization', None))) + .key("Authorization") + .value(options.get("authorization", None))) .query_param(Parameter() - .key('live_mode') - .value(options.get('live_mode', None))) + .key("live_mode") + .value(options.get("live_mode", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListSaleRepItem.from_dictionary) + .deserialize_into(ListSaleRepItem.from_dictionary), ).execute() def read_sales_rep(self, seller_id, sales_rep_id, - authorization='Bearer <>', + authorization="Bearer <>", live_mode=None, page=1, per_page=100): - """Does a GET request to /sellers/{seller_id}/sales_reps/{sales_rep_id}.json. + """Perform a GET request to + /sellers/{seller_id}/sales_reps/{sales_rep_id}.json. Endpoint returns sales rep and attached subscriptions details. ## Modified Authentication Process - The Sales Commission API differs from other Chargify API endpoints. - This resource is associated with the seller itself. Up to now all - available resources were at the level of the site, therefore creating - the API Key per site was a sufficient solution. To share resources at - the seller level, a new authentication method was introduced, which is - user authentication. Creating an API Key for a user is a required step - to correctly use the Sales Commission API, more details - [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5 - NTg0-2020-04-20-new-api-authentication). - Access to the Sales Commission API endpoints is available to users - with financial access, where the seller has the Advanced Analytics - component enabled. For further information on getting access to - Advanced Analytics contact Maxio support. - > Note: The request is at seller level, it means `<>` - variable will be replaced by `app` + The Sales Commission API differs from other Chargify API endpoints. This + resource is associated with the seller itself. Up to now all available + resources were at the level of the site, therefore creating the API Key per + site was a sufficient solution. To share resources at the seller level, a new + authentication method was introduced, which is user authentication. Creating + an API Key for a user is a required step to correctly use the Sales + Commission API, more details + [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-20 + 20-04-20-new-api-authentication). + Access to the Sales Commission API endpoints is available to users with + financial access, where the seller has the Advanced Analytics component + enabled. For further information on getting access to Advanced Analytics + contact Maxio support. + > Note: The request is at seller level, it means `<>` variable + will be replaced by `app` Args: seller_id (str): The Chargify id of your seller account sales_rep_id (str): The Advanced Billing id of sales rep. - authorization (str, optional): For authorization use user API key. - See details - [here](https://developers.chargify.com/docs/developer-docs/ZG9j - OjMyNzk5NTg0-2020-04-20-new-api-authentication). - live_mode (bool, optional): This parameter indicates if records - should be fetched from live mode sites. Default value is true. - page (int, optional): Result records are organized in pages. By - default, the first page of results is displayed. The page - parameter specifies a page number of results to fetch. You can - start navigating through the pages to consume the results. You - do this by passing in a page parameter. Retrieve the next page - by adding ?page=2 to the query string. If there are no results - to return, then an empty result set will be returned. Use in - query `page=1`. - per_page (int, optional): This parameter indicates how many - records to fetch in each request. Default value is 100. + authorization (str, optional): For authorization use user API key. See + details + [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk + 5NTg0-2020-04-20-new-api-authentication). + live_mode (bool, optional): This parameter indicates if records should be + fetched from live mode sites. Default value is true. + page (int, optional): Result records are organized in pages. By default, + the first page of results is displayed. The page parameter specifies + a page number of results to fetch. You can start navigating through + the pages to consume the results. You do this by passing in a page + parameter. Retrieve the next page by adding ?page=2 to the query + string. If there are no results to return, then an empty result set + will be returned. Use in query `page=1`. + per_page (int, optional): This parameter indicates how many records to + fetch in each request. Default value is 100. Returns: SaleRep: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/sellers/{seller_id}/sales_reps/{sales_rep_id}.json') + .path("/sellers/{seller_id}/sales_reps/{sales_rep_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('seller_id') - .value(seller_id) - .is_required(True) - .should_encode(True)) + .key("seller_id") + .value(seller_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('sales_rep_id') - .value(sales_rep_id) - .is_required(True) - .should_encode(True)) + .key("sales_rep_id") + .value(sales_rep_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Authorization') - .value(authorization)) + .key("Authorization") + .value(authorization)) .query_param(Parameter() - .key('live_mode') - .value(live_mode)) + .key("live_mode") + .value(live_mode)) .query_param(Parameter() - .key('page') - .value(page)) + .key("page") + .value(page)) .query_param(Parameter() - .key('per_page') - .value(per_page)) + .key("per_page") + .value(per_page)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SaleRep.from_dictionary) + .deserialize_into(SaleRep.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/sites_controller.py b/advancedbilling/controllers/sites_controller.py index 22331ba3..09e1340a 100644 --- a/advancedbilling/controllers/sites_controller.py +++ b/advancedbilling/controllers/sites_controller.py @@ -1,41 +1,49 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.site_response import SiteResponse -from advancedbilling.models.list_public_keys_response import ListPublicKeysResponse + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_public_keys_response import ( + ListPublicKeysResponse, +) +from advancedbilling.models.site_response import ( + SiteResponse, +) class SitesController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SitesController object.""" super(SitesController, self).__init__(config) def read_site(self): - """Does a GET request to /site.json. + """Perform a GET request to /site.json. This endpoint allows you to fetch some site data. Full documentation on Sites in the Advanced Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites - ). + [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). Specifically, the [Clearing Site - Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Cleari - ng-Site-Data) section is extremely relevant to this endpoint - documentation. + Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site + -Data) section is extremely relevant to this endpoint documentation. #### Relationship invoicing enabled If site has RI enabled then you will see more settings like: "customer_hierarchy_enabled": true, @@ -43,130 +51,120 @@ def read_site(self): "whopays_default_payer": "self" You can read more about these settings here: [Who Pays & Customer - Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-C - ustomer-Hierarchies-WhoPays) + Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer + -Hierarchies-WhoPays) Returns: SiteResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/site.json') + .path("/site.json") .http_method(HttpMethodEnum.GET) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SiteResponse.from_dictionary) + .deserialize_into(SiteResponse.from_dictionary), ).execute() def clear_site(self, - cleanup_scope='all'): - """Does a POST request to /sites/clear_data.json. + cleanup_scope="all"): + """Perform a POST request to /sites/clear_data.json. - This call is asynchronous and there may be a delay before the site - data is fully deleted. If you are clearing site data for an automated - test, you will need to build in a delay and/or check that there are no - products, etc., in the site before proceeding. + This call is asynchronous and there may be a delay before the site data is + fully deleted. If you are clearing site data for an automated test, you will + need to build in a delay and/or check that there are no products, etc., in + the site before proceeding. **This functionality will only work on sites in TEST mode. Attempts to perform this on sites in “live” mode will result in a response of 403 FORBIDDEN.** Args: - cleanup_scope (CleanupScope, optional): `all`: Will clear all - products, customers, and related subscriptions from the site. - `customers`: Will clear only customers and related - subscriptions (leaving the products untouched) for the site. - Revenue will also be reset to 0. Use in query - `cleanup_scope=all`. + cleanup_scope (CleanupScope, optional): `all`: Will clear all products, + customers, and related subscriptions from the site. `customers`: + Will clear only customers and related subscriptions (leaving the + products untouched) for the site. Revenue will also be reset to 0. + Use in query `cleanup_scope=all`. Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/sites/clear_data.json') + .path("/sites/clear_data.json") .http_method(HttpMethodEnum.POST) .query_param(Parameter() - .key('cleanup_scope') - .value(cleanup_scope)) - .auth(Single('BasicAuth')) + .key("cleanup_scope") + .value(cleanup_scope)) + .auth(Single("BasicAuth")), ).execute() def list_chargify_js_public_keys(self, options=dict()): - """Does a GET request to /chargify_js_keys.json. + """Perform a GET request to /chargify_js_keys.json. This endpoint returns public keys used for Chargify.js. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. Returns: ListPublicKeysResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/chargify_js_keys.json') + .path("/chargify_js_keys.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListPublicKeysResponse.from_dictionary) + .deserialize_into(ListPublicKeysResponse.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/subscription_components_controller.py b/advancedbilling/controllers/subscription_components_controller.py index a2c43b62..4f2e6e5c 100644 --- a/advancedbilling/controllers/subscription_components_controller.py +++ b/advancedbilling/controllers/subscription_components_controller.py @@ -1,52 +1,84 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController -from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.subscription_component_response import SubscriptionComponentResponse -from advancedbilling.models.bulk_components_price_point_assignment import BulkComponentsPricePointAssignment -from advancedbilling.models.subscription_response import SubscriptionResponse -from advancedbilling.models.allocation_response import AllocationResponse -from advancedbilling.models.allocation_preview_response import AllocationPreviewResponse -from advancedbilling.models.usage_response import UsageResponse -from advancedbilling.models.list_subscription_components_response import ListSubscriptionComponentsResponse -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.component_price_point_error_exception import ComponentPricePointErrorException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.component_allocation_error_exception import ComponentAllocationErrorException -from advancedbilling.exceptions.subscription_component_allocation_error_exception import SubscriptionComponentAllocationErrorException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.component_allocation_error_exception import ( + ComponentAllocationErrorException, +) +from advancedbilling.exceptions.component_price_point_error_exception import ( + ComponentPricePointErrorException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.allocation_preview_response import ( + AllocationPreviewResponse, +) +from advancedbilling.models.allocation_response import ( + AllocationResponse, +) +from advancedbilling.models.bulk_components_price_point_assignment import ( + BulkComponentsPricePointAssignment, +) +from advancedbilling.models.list_subscription_components_response import ( + ListSubscriptionComponentsResponse, +) +from advancedbilling.models.subscription_component_response import ( + SubscriptionComponentResponse, +) +from advancedbilling.models.subscription_response import ( + SubscriptionResponse, +) +from advancedbilling.models.usage_response import ( + UsageResponse, +) +from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, +) -class SubscriptionComponentsController(BaseController): +class SubscriptionComponentsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionComponentsController object.""" super(SubscriptionComponentsController, self).__init__(config) def read_subscription_component(self, subscription_id, component_id): - """Does a GET request to /subscriptions/{subscription_id}/components/{component_id}.json. + """Perform a GET request to + /subscriptions/{subscription_id}/components/{component_id}.json. - This request will list information regarding a specific component - owned by a subscription. + This request will list information regarding a specific component owned by a + subscription. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. component_id (int): The Advanced Billing id of the component. Alternatively, the component's handle prefixed by `handle:` @@ -54,587 +86,547 @@ def read_subscription_component(self, SubscriptionComponentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components/{component_id}.json') + .path("/subscriptions/{subscription_id}/components/{component_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionComponentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def list_subscription_components(self, options=dict()): - """Does a GET request to /subscriptions/{subscription_id}/components.json. + """Perform a GET request to + /subscriptions/{subscription_id}/components.json. This request will list a subscription's applied components. ## Archived Components When requesting to list components for a given subscription, if the - subscription contains **archived** components they will be listed in - the server response. + subscription contains **archived** components they will be listed in the + server response. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - subscription_id -- int -- The Chargify id of the - subscription - date_field -- SubscriptionListDateField -- The type of - filter you'd like to apply to your search. Use in - query `date_field=updated_at`. - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. - filter -- ListSubscriptionComponentsFilter -- Filter to - use for List Subscription Components operation - end_date -- str -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns components - with a timestamp up to and including 11:59:59PM in - your site’s time zone on the date specified. - end_datetime -- str -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site''s time zone - will be used. If provided, this parameter will be used - instead of end_date. - price_point_ids -- IncludeNotNull -- Allows fetching - components allocation only if price point id is - present. Use in query `price_point_ids=not_null`. - product_family_ids -- List[int] -- Allows fetching - components allocation with matching product family id - based on provided ids. Use in query - `product_family_ids=1,2,3`. - sort -- ListSubscriptionComponentsSort -- The attribute by - which to sort. Use in query `sort=updated_at`. - start_date -- str -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns - components with a timestamp at or after midnight - (12:00:00 AM) in your site’s time zone on the date - specified. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + subscription_id -- int -- The Chargify id of the subscription. + date_field -- SubscriptionListDateField -- The type of filter + you'd like to apply to your search. Use in query + `date_field=updated_at`. + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. + filter -- ListSubscriptionComponentsFilter -- Filter to use for + List Subscription Components operation + end_date -- str -- The end date (format YYYY-MM-DD) with which to + filter the date_field. Returns components with a timestamp up + to and including 11:59:59PM in your site’s time zone on the + date specified. + end_datetime -- str -- The end date and time (format YYYY-MM-DD + HH:MM:SS) with which to filter the date_field. Returns + components with a timestamp at or before exact time provided + in query. You can specify timezone in query - otherwise your + site''s time zone will be used. If provided, this parameter + will be used instead of end_date. + price_point_ids -- IncludeNotNull -- Allows fetching components + allocation only if price point id is present. Use in query + `price_point_ids=not_null`. + product_family_ids -- List[int] -- Allows fetching components + allocation with matching product family id based on provided + ids. Use in query `product_family_ids=1,2,3`. + sort -- ListSubscriptionComponentsSort -- The attribute by which + to sort. Use in query `sort=updated_at`. + start_date -- str -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns components with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. start_datetime -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site''s time zone - will be used. If provided, this parameter will be used - instead of start_date. - include -- List[ListSubscriptionComponentsInclude] -- - Allows including additional data in the response. Use - in query `include=subscription,historic_usages`. - in_use -- bool -- If in_use is set to true, it returns - only components that are currently in use. However, if - it's set to false or not provided, it returns all - components connected with the subscription. + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns components with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site''s time zone will be used. If provided, + this parameter will be used instead of start_date. + include -- List[ListSubscriptionComponentsInclude] -- Allows + including additional data in the response. Use in query + `include=subscription,historic_usages`. + in_use -- bool -- If in_use is set to true, it returns only + components that are currently in use. However, if it's set to + false or not provided, it returns all components connected + with the subscription. Returns: List[SubscriptionComponentResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components.json') + .path("/subscriptions/{subscription_id}/components.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None)) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(options.get("subscription_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('end_datetime') - .value(options.get('end_datetime', None))) + .key("end_datetime") + .value(options.get("end_datetime", None))) .query_param(Parameter() - .key('price_point_ids') - .value(options.get('price_point_ids', None))) + .key("price_point_ids") + .value(options.get("price_point_ids", None))) .query_param(Parameter() - .key('product_family_ids') - .value(options.get('product_family_ids', None))) + .key("product_family_ids") + .value(options.get("product_family_ids", None))) .query_param(Parameter() - .key('sort') - .value(options.get('sort', None))) + .key("sort") + .value(options.get("sort", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(options.get('start_datetime', None))) + .key("start_datetime") + .value(options.get("start_datetime", None))) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .query_param(Parameter() - .key('in_use') - .value(options.get('in_use', None))) + .key("in_use") + .value(options.get("in_use", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionComponentResponse.from_dictionary) + .deserialize_into(SubscriptionComponentResponse.from_dictionary), ).execute() def bulk_update_subscription_components_price_points(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/price_points.json. + """Perform a POST request to + /subscriptions/{subscription_id}/price_points.json. Updates the price points on one or more of a subscription's components. The `price_point` key can take either a: 1. Price point id (integer) 2. Price point handle (string) - 3. `"_default"` string, which will reset the price point to the - component's current default price point. + 3. `"_default"` string, which will reset the price point to the component's + current default price point. Args: - subscription_id (int): The Chargify id of the subscription - body (BulkComponentsPricePointAssignment, optional): The request - body parameter. + subscription_id (int): The Chargify id of the subscription. + body (BulkComponentsPricePointAssignment, optional): The request body + parameter. Returns: BulkComponentsPricePointAssignment: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/price_points.json') + .path("/subscriptions/{subscription_id}/price_points.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BulkComponentsPricePointAssignment.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ComponentPricePointErrorException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ComponentPricePointErrorException), ).execute() def bulk_reset_subscription_components_price_points(self, subscription_id): - """Does a POST request to /subscriptions/{subscription_id}/price_points/reset.json. + """Perform a POST request to + /subscriptions/{subscription_id}/price_points/reset.json. Resets all of a subscription's components to use the current default. - **Note**: this will update the price point for all of the - subscription's components, even ones that have not been allocated yet. + **Note**: this will update the price point for all of the subscription's + components, even ones that have not been allocated yet. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: SubscriptionResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/price_points/reset.json') + .path("/subscriptions/{subscription_id}/price_points/reset.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionResponse.from_dictionary) + .deserialize_into(SubscriptionResponse.from_dictionary), ).execute() def allocate_component(self, subscription_id, component_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/components/{component_id}/allocations.json. + """Perform a POST request to + /subscriptions/{subscription_id}/components/{component_id}/allocations.json. - This endpoint creates a new allocation, setting the current allocated - quantity for the Component and recording a memo. - **Notice**: Allocations can only be updated for Quantity, On/Off, and + Creates an allocation, sets the current allocated quantity for the component, + and records a memo. Allocations can only be updated for Quantity, On/Off, and Prepaid Components. - ## Allocations Documentation - Full documentation on how to record Allocations in the Advanced - Billing UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Compo - nent-Allocations-Overview). It is focused on how allocations operate - within the Advanced Billing UI.It goes into greater detail on how the - user interface will react when recording allocations. - This documentation also goes into greater detail on how proration is - taken into consideration when applying component allocations. - ## Proration Schemes - Changing the allocated quantity of a component mid-period can result - in either a Charge or Credit being applied to the subscription. When - creating an allocation via the API, you can pass the `upgrade_charge`, + When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. - **Notice:** These proration and accural fields will be ignored for - Prepaid Components since this component type always generate charges - immediately without proration. - For background information on prorated components and - upgrade/downgrade schemes, see [Setting Component - Allocations.](https://maxio.zendesk.com/hc/en-us/articles/2425190616513 - 3-Component-Allocations-Proration). - See the tables below for valid values. - | upgrade_charge | Definition                                         - | - |----------------|----------------------------------------------------- - --------------| - | `full`         | A charge is added for the full price of the - component.            | - | `prorated`     | A charge is added for the prorated price of the - component change. | - | `none`         | No charge is added.                                 - | - | downgrade_credit | Definition                                       - | - |------------------|--------------------------------------------------- - | - | `full`           | A full price credit is added for the amount owed. - | - | `prorated`       | A prorated credit is added for the amount owed.   - | - | `none`           | No charge is added.                               - | - | accrue_charge | Definition                                           - | - |---------------|------------------------------------------------------ - ------------------------------------------------------| - | `true`        | Attempt to charge the customer at next renewal. - | - | `false`       | Attempt to charge the customer right away. If it - fails, the charge will be accrued until the next renewal. | + > **Note:** These proration and accural fields are ignored for Prepaid + Components since this component type always generate charges immediately + without proration. + For information on prorated components and upgrade/downgrade schemes, see + [Setting Component + Allocations.](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Compo + nent-Allocations-Proration) ### Order of Resolution for upgrade_charge and downgrade_credit 1. Per allocation in API call (within a single allocation of the `allocations` array) 2. [Component-level default - value](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Compo - nent-Allocations-Overview) + value](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Al + locations-Overview) 3. Allocation API call top level (outside of the `allocations` array) 4. [Site-level default - value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Compo - nent-Allocations-Proration#proration-schemes) + value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Al + locations-Proration#proration-schemes) ### Order of Resolution for accrue charge 1. Allocation API call top level (outside of the `allocations` array) 2. [Site-level default - value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Compo - nent-Allocations-Proration#proration-schemes) - **NOTE: Proration uses the current price of the component as well as - the current tax rates. Changes to either may cause the prorated - charge/credit to be wrong.** + value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Al + locations-Proration#proration-schemes) + > **Note:** Proration uses the current price of the component as well as the + current tax rates. Changes to either may cause the prorated charge/credit to + be wrong. + For more informaiton see the [Component + Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Compon + ent-Allocations-Overview) product Documentation. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. component_id (int): The Advanced Billing id of the component - body (CreateAllocationRequest, optional): The request body - parameter. + body (CreateAllocationRequest, optional): The request body parameter. Returns: AllocationResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components/{component_id}/allocations.json') + .path("/subscriptions/{subscription_id}/components/{component_id}/allocations.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(AllocationResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_allocations(self, subscription_id, component_id, page=1): - """Does a GET request to /subscriptions/{subscription_id}/components/{component_id}/allocations.json. + """Perform a GET request to + /subscriptions/{subscription_id}/components/{component_id}/allocations.json. - This endpoint returns the 50 most recent Allocations, ordered by most - recent first. + This endpoint returns the 50 most recent Allocations, ordered by most recent + first. ## On/Off Components - When a subscription's on/off component has been toggled to on (`1`) or - off (`0`), usage will be logged in this response. - ## Querying data via Advanced Billing gem - You can also query the current quantity via the [official Advanced - Billing Gem.](http://github.com/chargify/chargify_api_ares) - ```# First way - component = Chargify::Subscription::Component.find(1, :params => - {:subscription_id => 7}) - puts component.allocated_quantity - # => 23 - # Second way - component = Chargify::Subscription.find(7).component(1) - puts component.allocated_quantity - # => 23 - ``` + When a subscription's on/off component has been toggled to on (`1`) or off + (`0`), usage will be logged in this response. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. component_id (int): The Advanced Billing id of the component - page (int, optional): Result records are organized in pages. By - default, the first page of results is displayed. The page - parameter specifies a page number of results to fetch. You can - start navigating through the pages to consume the results. You - do this by passing in a page parameter. Retrieve the next page - by adding ?page=2 to the query string. If there are no results - to return, then an empty result set will be returned. Use in - query `page=1`. + page (int, optional): Result records are organized in pages. By default, + the first page of results is displayed. The page parameter specifies + a page number of results to fetch. You can start navigating through + the pages to consume the results. You do this by passing in a page + parameter. Retrieve the next page by adding ?page=2 to the query + string. If there are no results to return, then an empty result set + will be returned. Use in query `page=1`. Returns: List[AllocationResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components/{component_id}/allocations.json') + .path("/subscriptions/{subscription_id}/components/{component_id}/allocations.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(page)) + .key("page") + .value(page)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(AllocationResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def allocate_components(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/allocations.json. - - Creates multiple allocations, setting the current allocated quantity - for each of the components and recording a memo. The charges and/or - credits that are created will be rolled up into a single total which - is used to determine whether this is an upgrade or a downgrade. Be - aware of the Order of Resolutions explained below in determining the - proration scheme. - A `component_id` is required for each allocation. - This endpoint only responds to JSON. It is not available for XML. + """Perform a POST request to + /subscriptions/{subscription_id}/allocations.json. + + Creates multiple allocations, sets the current allocated quantity for each of + the components, and recording a memo. A `component_id` is required for each + allocation. + The charges and/or credits that are created will be rolled up into a single + total which is used to determine whether this is an upgrade or a downgrade. + ### Order of Resolution for upgrade_charge and downgrade_credit + 1. Per allocation in API call (within a single allocation of the + `allocations` array) + 2. [Component-level default + value](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Al + locations-Overview) + 3. Allocation API call top level (outside of the `allocations` array) + 4. [Site-level default + value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Al + locations-Proration#proration-schemes) + ### Order of Resolution for accrue charge + 1. Allocation API call top level (outside of the `allocations` array) + 2. [Site-level default + value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Al + locations-Proration#proration-schemes) + > **Note:** Proration uses the current price of the component as well as the + current tax rates. Changes to either may cause the prorated charge/credit to + be wrong. + For more informaiton see the [Component + Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Compon + ent-Allocations-Overview) product Documentation. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (AllocateComponents, optional): The request body parameter. Returns: List[AllocationResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/allocations.json') + .path("/subscriptions/{subscription_id}/allocations.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(AllocationResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def preview_allocations(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/allocations/preview.json. - - Advanced Billing offers the ability to preview a potential - subscription's **quantity-based** or **on/off** component allocation - in the middle of the current billing period. This is useful if you - want users to be able to see the effect of a component operation - before actually doing it. - ## Fine-grained Component Control: Use with multiple `upgrade_charge`s - or `downgrade_credits` - When the allocation uses multiple different types of `upgrade_charge`s - or `downgrade_credit`s, the Allocation is viewed as an Allocation - which uses "Fine-Grained Component Control". As a result, the response - will not include `direction` and `proration` within the - `allocation_preview`, but at the `line_items` and `allocations` level - respectfully. + """Perform a POST request to + /subscriptions/{subscription_id}/allocations/preview.json. + + Advanced Billing offers the ability to preview a potential subscription's + **quantity-based** or **on/off** component allocation in the middle of the + current billing period. This is useful if you want users to be able to see + the effect of a component operation before actually doing it. + ## Fine-grained Component Control: Use with multiple `upgrade_charge`s or + `downgrade_credits` + When the allocation uses multiple different types of `upgrade_charge`s or + `downgrade_credit`s, the Allocation is viewed as an Allocation which uses + "Fine-Grained Component Control". As a result, the response will not include + `direction` and `proration` within the `allocation_preview`, but at the + `line_items` and `allocations` level respectfully. See example below for Fine-Grained Component Control response. Args: - subscription_id (int): The Chargify id of the subscription - body (PreviewAllocationsRequest, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (PreviewAllocationsRequest, optional): The request body parameter. Returns: AllocationPreviewResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/allocations/preview.json') + .path("/subscriptions/{subscription_id}/allocations/preview.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(AllocationPreviewResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ComponentAllocationErrorException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ComponentAllocationErrorException), ).execute() def update_prepaid_usage_allocation_expiration_date(self, @@ -642,27 +634,26 @@ def update_prepaid_usage_allocation_expiration_date(self, component_id, allocation_id, body=None): - """Does a PUT request to /subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json. + """Perform a PUT request to + /subscriptions/{subscription_id}/components/{component_id}/allocations/{allocat + ion_id}.json. When the expiration interval options are selected on a prepaid usage - component price point, all allocations will be created with an - expiration date. This expiration date can be changed after the fact to - allow for extending or shortening the allocation's active window. - In order to change a prepaid usage allocation's expiration date, a PUT - call must be made to the allocation's endpoint with a new expiration - date. + component price point, all allocations will be created with an expiration + date. This expiration date can be changed after the fact to allow for + extending or shortening the allocation's active window. + In order to change a prepaid usage allocation's expiration date, a PUT call + must be made to the allocation's endpoint with a new expiration date. ## Limitations A few limitations exist when changing an allocation's expiration date: - - An expiration date can only be changed for an allocation that - belongs to a price point with expiration interval options explicitly - set. - - An expiration date can be changed towards the future with no - limitations. - - An expiration date can be changed towards the past (essentially - expiring it) up to the subscription's current period beginning date. + - An expiration date can only be changed for an allocation that belongs to a + price point with expiration interval options explicitly set. + - An expiration date can be changed towards the future with no limitations. + - An expiration date can be changed towards the past (essentially expiring + it) up to the subscription's current period beginning date. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. component_id (int): The Advanced Billing id of the component allocation_id (int): The Advanced Billing id of the allocation body (UpdateAllocationExpirationDate, optional): The request body @@ -672,39 +663,37 @@ def update_prepaid_usage_allocation_expiration_date(self, void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json') + .path("/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('allocation_id') - .value(allocation_id) - .is_required(True) - .should_encode(True)) + .key("allocation_id") + .value(allocation_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def delete_prepaid_usage_allocation(self, @@ -712,26 +701,28 @@ def delete_prepaid_usage_allocation(self, component_id, allocation_id, body=None): - """Does a DELETE request to /subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json. - - Prepaid Usage components are unique in that their allocations are - always additive. In order to reduce a subscription's allocated - quantity for a prepaid usage component each allocation must be - destroyed individually via this endpoint. + """Perform a DELETE request to + /subscriptions/{subscription_id}/components/{component_id}/allocations/{allocat + ion_id}.json. + + Prepaid Usage components are unique in that their allocations are always + additive. In order to reduce a subscription's allocated quantity for a + prepaid usage component each allocation must be destroyed individually via + this endpoint. ## Credit Scheme - By default, destroying an allocation will generate a service credit on - the subscription. This behavior can be modified with the optional - `credit_scheme` parameter on this endpoint. The accepted values are: - 1. `none`: The allocation will be destroyed and the balances will be - updated but no service credit or refund will be created. + By default, destroying an allocation will generate a service credit on the + subscription. This behavior can be modified with the optional `credit_scheme` + parameter on this endpoint. The accepted values are: + 1. `none`: The allocation will be destroyed and the balances will be updated + but no service credit or refund will be created. 2. `credit`: The allocation will be destroyed and the balances will be - updated and a service credit will be generated. This is also the - default behavior if the `credit_scheme` param is not passed. + updated and a service credit will be generated. This is also the default + behavior if the `credit_scheme` param is not passed. 3. `refund`: The allocation will be destroyed and the balances will be updated and a refund will be issued along with a Credit Note. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. component_id (int): The Advanced Billing id of the component allocation_id (int): The Advanced Billing id of the allocation body (CreditSchemeRequest, optional): The request body parameter. @@ -740,85 +731,84 @@ def delete_prepaid_usage_allocation(self, void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json') + .path("/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('allocation_id') - .value(allocation_id) - .is_required(True) - .should_encode(True)) + .key("allocation_id") + .value(allocation_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def create_usage(self, subscription_id_or_reference, component_id, body=None): - """Does a POST request to /subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json. + """Perform a POST request to + /subscriptions/{subscription_id_or_reference}/components/{component_id}/usages. + json. Records an instance of metered or prepaid usage for a subscription. - You can report metered or prepaid usage to Advanced Billing as often - as you wish. You can report usage as it happens or periodically, such - as each night or once per billing period. - Full documentation on how to create Components in the Advanced Billing - UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Creat - e-Edit-and-Archive-Components). Additionally, for information on how - to record component usage against a subscription, see the following - resources: - It is not possible to record metered usage for more than one component - at a time Usage should be reported as one API call per component on a - single subscription. For example, to record that a subscriber has sent - both an SMS Message and an Email, send an API call for each. + You can report metered or prepaid usage to Advanced Billing as often as you + wish. You can report usage as it happens or periodically, such as each night + or once per billing period. + Full documentation on how to create Components in the Advanced Billing UI can + be located + [here](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit- + and-Archive-Components). Additionally, for information on how to record + component usage against a subscription, see the following resources: + It is not possible to record metered usage for more than one component at a + time Usage should be reported as one API call per component on a single + subscription. For example, to record that a subscriber has sent both an SMS + Message and an Email, send an API call for each. See the following product documention articles for more information: - [Create and Manage - Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501- - Create-Edit-and-Archive-Components). A + Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create- + Edit-and-Archive-Components). A - [Recording Metered Component - Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Repor - ting-Component-Allocations#reporting-metered-component-usage) + Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Co + mponent-Allocations#reporting-metered-component-usage) - [Reporting Prepaid Component - Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Repo - rting-Component-Allocations#reporting-prepaid-component-status) + Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-C + omponent-Allocations#reporting-prepaid-component-status) The `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component Line Item]($e/Subscription%20Components/readSubscriptionComponent) for the subscription. ## Price Point ID usage - If you are using price points, for metered and prepaid usage - components Advanced Billing gives you the option to specify a price - point in your request. + If you are using price points, for metered and prepaid usage components + Advanced Billing gives you the option to specify a price point in your + request. You do not need to specify a price point ID. If a price point is not - included, the default price point for the component will be used when - the usage is recorded. + included, the default price point for the component will be used when the + usage is recorded. ## Deducting Usage - If you need to reverse a previous usage report or otherwise deduct - from the current usage balance, you can provide a negative quantity. + If you need to reverse a previous usage report or otherwise deduct from the + current usage balance, you can provide a negative quantity. Example: Previously recorded quantity was 5000: ```json @@ -838,19 +828,18 @@ def create_usage(self, } } ``` - The `unit_balance` has a floor of `0`; negative unit balances are - never allowed. For example, if the usage balance is 100 and you deduct - 200 units, the unit balance would then be `0`, not `-100`. + The `unit_balance` has a floor of `0`; negative unit balances are never + allowed. For example, if the usage balance is 100 and you deduct 200 units, + the unit balance would then be `0`, not `-100`. Args: - subscription_id_or_reference (int | str): Either the Advanced - Billing subscription ID (integer) or the subscription - reference (string). Important: In cases where a numeric string - value matches both an existing subscription ID and an existing - subscription reference, the system will prioritize the - subscription ID lookup. For example, if both subscription ID - 123 and subscription reference "123" exist, passing "123" will - return the subscription with ID 123. + subscription_id_or_reference (int | str): Either the Advanced Billing + subscription ID (integer) or the subscription reference (string). + Important: In cases where a numeric string value matches both an + existing subscription ID and an existing subscription reference, the + system will prioritize the subscription ID lookup. For example, if + both subscription ID 123 and subscription reference "123" exist, + passing "123" will return the subscription with ID 123. component_id (int | str): Either the Advanced Billing id for the component or the component's handle prefixed by `handle:` body (CreateUsageRequest, optional): The request body parameter. @@ -859,234 +848,233 @@ def create_usage(self, UsageResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json') + .path("/subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id_or_reference') - .value(subscription_id_or_reference) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('CreateUsageSubscriptionIdOrReference').validate(value))) + .key("subscription_id_or_reference") + .value(subscription_id_or_reference) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("CreateUsageSubscriptionIdOrReference").validate(value))) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('CreateUsageComponentId').validate(value))) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("CreateUsageComponentId").validate(value))) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(UsageResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_usages(self, options=dict()): - """Does a GET request to /subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json. + """Perform a GET request to + /subscriptions/{subscription_id_or_reference}/components/{component_id}/usages. + json. - This request will return a list of the usages associated with a - subscription for a particular metered component. This will display the - previously recorded components for a subscription. + This request will return a list of the usages associated with a subscription + for a particular metered component. This will display the previously recorded + components for a subscription. This endpoint is not compatible with quantity-based components. ## Since Date and Until Date Usage - Note: The `since_date` and `until_date` attributes each default to - midnight on the date specified. For example, in order to list usages - for January 20th, you would need to append the following to the URL. + Note: The `since_date` and `until_date` attributes each default to midnight + on the date specified. For example, in order to list usages for January 20th, + you would need to append the following to the URL. ``` ?since_date=2016-01-20&until_date=2016-01-21 ``` ## Read Usage by Handle Use this endpoint to read the previously recorded components for a - subscription. You can now specify either the component id (integer) - or the component handle prefixed by "handle:" to specify the unique - identifier for the component you are working with. + subscription. You can now specify either the component id (integer) or the + component handle prefixed by "handle:" to specify the unique identifier for + the component you are working with. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - subscription_id_or_reference -- int | str -- Either the - Advanced Billing subscription ID (integer) or the - subscription reference (string). Important: In cases - where a numeric string value matches both an existing - subscription ID and an existing subscription - reference, the system will prioritize the subscription - ID lookup. For example, if both subscription ID 123 - and subscription reference "123" exist, passing "123" + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + subscription_id_or_reference -- int | str -- Either the Advanced + Billing subscription ID (integer) or the subscription + reference (string). Important: In cases where a numeric + string value matches both an existing subscription ID and an + existing subscription reference, the system will prioritize + the subscription ID lookup. For example, if both subscription + ID 123 and subscription reference "123" exist, passing "123" will return the subscription with ID 123. - component_id -- int | str -- Either the Advanced Billing - id for the component or the component's handle - prefixed by `handle:` - since_id -- int -- Returns usages with an id greater than - or equal to the one specified - max_id -- int -- Returns usages with an id less than or + component_id -- int | str -- Either the Advanced Billing id for + the component or the component's handle prefixed by `handle:` + since_id -- int -- Returns usages with an id greater than or equal to the one specified - since_date -- date -- Returns usages with a created_at - date greater than or equal to midnight (12:00 AM) on - the date specified. - until_date -- date -- Returns usages with a created_at - date less than or equal to midnight (12:00 AM) on the - date specified. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + max_id -- int -- Returns usages with an id less than or equal to + the one specified + since_date -- date -- Returns usages with a created_at date + greater than or equal to midnight (12:00 AM) on the date + specified. + until_date -- date -- Returns usages with a created_at date less + than or equal to midnight (12:00 AM) on the date specified. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. Returns: List[UsageResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json') + .path("/subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id_or_reference') - .value(options.get('subscription_id_or_reference', None)) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ListUsagesInputSubscriptionIdOrReference').validate(value))) + .key("subscription_id_or_reference") + .value(options.get("subscription_id_or_reference", None)) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ListUsagesInputSubscriptionIdOrReference").validate(value))) .template_param(Parameter() - .key('component_id') - .value(options.get('component_id', None)) - .is_required(True) - .should_encode(True) - .validator(lambda value: UnionTypeLookUp.get('ListUsagesInputComponentId').validate(value))) + .key("component_id") + .value(options.get("component_id", None)) + .is_required(True) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp + .get("ListUsagesInputComponentId").validate(value))) .query_param(Parameter() - .key('since_id') - .value(options.get('since_id', None))) + .key("since_id") + .value(options.get("since_id", None))) .query_param(Parameter() - .key('max_id') - .value(options.get('max_id', None))) + .key("max_id") + .value(options.get("max_id", None))) .query_param(Parameter() - .key('since_date') - .value(options.get('since_date', None))) + .key("since_date") + .value(options.get("since_date", None))) .query_param(Parameter() - .key('until_date') - .value(options.get('until_date', None))) + .key("until_date") + .value(options.get("until_date", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(UsageResponse.from_dictionary) + .deserialize_into(UsageResponse.from_dictionary), ).execute() def activate_event_based_component(self, subscription_id, component_id, body=None): - """Does a POST request to /event_based_billing/subscriptions/{subscription_id}/components/{component_id}/activate.json. + """Perform a POST request to + /event_based_billing/subscriptions/{subscription_id}/components/{component_id}/ + activate.json. - In order to bill your subscribers on your Events data under the - Events-Based Billing feature, the components must be activated for the - subscriber. + In order to bill your subscribers on your Events data under the Events-Based + Billing feature, the components must be activated for the subscriber. Learn more about the role of activation in the [Events-Based Billing - docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events - -Based-Billing-Overview). + docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based- + Billing-Overview). Use this endpoint to activate an event-based component for a single - subscription. Activating an event-based component causes Advanced - Billing to bill for events when the subscription is renewed. + subscription. Activating an event-based component causes Advanced Billing to + bill for events when the subscription is renewed. *Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only - determines if the subscription should be billed for event-based - component usage at renewal.* + determines if the subscription should be billed for event-based component + usage at renewal.* Args: subscription_id (int): The Advanced Billing id of the subscription component_id (int): The Advanced Billing id of the component - body (ActivateEventBasedComponent, optional): The request body - parameter. + body (ActivateEventBasedComponent, optional): The request body parameter. Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/activate.json') + .path("/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/activate.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def deactivate_event_based_component(self, subscription_id, component_id): - """Does a POST request to /event_based_billing/subscriptions/{subscription_id}/components/{component_id}/deactivate.json. + """Perform a POST request to + /event_based_billing/subscriptions/{subscription_id}/components/{component_id}/ + deactivate.json. Use this endpoint to deactivate an event-based component for a single - subscription. Deactivating the event-based component causes Advanced - Billing to ignore related events at subscription renewal. + subscription. Deactivating the event-based component causes Advanced Billing + to ignore related events at subscription renewal. Args: subscription_id (int): The Advanced Billing id of the subscription @@ -1096,294 +1084,273 @@ def deactivate_event_based_component(self, void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/deactivate.json') + .path("/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/deactivate.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('component_id') - .value(component_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("component_id") + .value(component_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def record_event(self, api_handle, store_uid=None, body=None): - """Does a POST request to /events/{api_handle}.json. + """Perform a POST request to /events/{api_handle}.json. ## Documentation - Events-Based Billing is an evolved form of metered billing that is - based on data-rich events streamed in real-time from your system to - Advanced Billing. - These events can then be transformed, enriched, or analyzed to form - the computed totals of usage charges billed to your customers. - This API allows you to stream events into the Advanced Billing data - ingestion engine. - Learn more about the feature in general in the [Events-Based Billing - help - docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events - -Based-Billing-Overview). + Events-Based Billing is an evolved form of metered billing that is based on + data-rich events streamed in real-time from your system to Advanced Billing. + These events can then be transformed, enriched, or analyzed to form the + computed totals of usage charges billed to your customers. + This API allows you to stream events into the Advanced Billing data ingestion + engine. + Learn more about the feature in general in the [Events-Based Billing help + docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based- + Billing-Overview). ## Record Event Use this endpoint to record a single event. - *Note: this endpoint differs from the standard Chargify API endpoints - in that the URL subdomain will be `events` and your site subdomain - will be included in the URL path. For example:* + *Note: this endpoint differs from the standard Chargify API endpoints in that + the URL subdomain will be `events` and your site subdomain will be included + in the URL path. For example:* ``` - https://events.chargify.com/my-site-subdomain/events/my-stream-api-hand - le + https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle ``` Args: - api_handle (str): Identifies the Stream for which the event should - be published. - store_uid (str, optional): If you've attached your own Keen - project as an Advanced Billing event data-store, use this - parameter to indicate the data-store. + api_handle (str): Identifies the Stream for which the event should be + published. + store_uid (str, optional): If you've attached your own Keen project as an + Advanced Billing event data-store, use this parameter to indicate the + data-store. body (EBBEvent, optional): The request body parameter. Returns: void: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.EBB) - .path('/events/{api_handle}.json') + .path("/events/{api_handle}.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('api_handle') - .value(api_handle) - .is_required(True) - .should_encode(True)) + .key("api_handle") + .value(api_handle) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .query_param(Parameter() - .key('store_uid') - .value(store_uid)) + .key("store_uid") + .value(store_uid)) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def bulk_record_events(self, api_handle, store_uid=None, body=None): - """Does a POST request to /events/{api_handle}/bulk.json. + """Perform a POST request to /events/{api_handle}/bulk.json. Use this endpoint to record a collection of events. - *Note: this endpoint differs from the standard Chargify API endpoints - in that the subdomain will be `events` and your site subdomain will be - included in the URL path.* - A maximum of 1000 events can be published in a single request. A 422 - will be returned if this limit is exceeded. + *Note: this endpoint differs from the standard Chargify API endpoints in that + the subdomain will be `events` and your site subdomain will be included in + the URL path.* + A maximum of 1000 events can be published in a single request. A 422 will be + returned if this limit is exceeded. Args: - api_handle (str): Identifies the Stream for which the events - should be published. - store_uid (str, optional): If you've attached your own Keen - project as an Advanced Billing event data-store, use this - parameter to indicate the data-store. + api_handle (str): Identifies the Stream for which the events should be + published. + store_uid (str, optional): If you've attached your own Keen project as an + Advanced Billing event data-store, use this parameter to indicate the + data-store. body (List[EBBEvent], optional): The request body parameter. Returns: void: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.EBB) - .path('/events/{api_handle}/bulk.json') + .path("/events/{api_handle}/bulk.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('api_handle') - .value(api_handle) - .is_required(True) - .should_encode(True)) + .key("api_handle") + .value(api_handle) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .query_param(Parameter() - .key('store_uid') - .value(store_uid)) + .key("store_uid") + .value(store_uid)) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def list_subscription_components_for_site(self, options=dict()): - """Does a GET request to /subscriptions_components.json. + """Perform a GET request to /subscriptions_components.json. This request will list components applied to each subscription. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - sort -- ListSubscriptionComponentsSort -- The attribute by - which to sort. Use in query: `sort=updated_at`. - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. - filter -- ListSubscriptionComponentsForSiteFilter -- - Filter to use for List Subscription Components For - Site operation - date_field -- SubscriptionListDateField -- The type of - filter you'd like to apply to your search. Use in - query: `date_field=updated_at`. - start_date -- str -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns - components with a timestamp at or after midnight - (12:00:00 AM) in your site’s time zone on the date - specified. Use in query `start_date=2011-12-15`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + sort -- ListSubscriptionComponentsSort -- The attribute by which + to sort. Use in query: `sort=updated_at`. + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. + filter -- ListSubscriptionComponentsForSiteFilter -- Filter to + use for List Subscription Components For Site operation + date_field -- SubscriptionListDateField -- The type of filter + you'd like to apply to your search. Use in query: + `date_field=updated_at`. + start_date -- str -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns components with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. Use in query + `start_date=2011-12-15`. start_datetime -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - after exact time provided in query. You can specify - timezone in query - otherwise your site''s time zone - will be used. If provided, this parameter will be used - instead of start_date. Use in query - `start_datetime=2022-07-01 09:00:05`. - end_date -- str -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns components - with a timestamp up to and including 11:59:59PM in - your site’s time zone on the date specified. Use in - query `end_date=2011-12-16`. - end_datetime -- str -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns components with a timestamp at or - before exact time provided in query. You can specify - timezone in query - otherwise your site''s time zone - will be used. If provided, this parameter will be used - instead of end_date. Use in query + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns components with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site''s time zone will be used. If provided, + this parameter will be used instead of start_date. Use in + query `start_datetime=2022-07-01 09:00:05`. + end_date -- str -- The end date (format YYYY-MM-DD) with which to + filter the date_field. Returns components with a timestamp up + to and including 11:59:59PM in your site’s time zone on the + date specified. Use in query `end_date=2011-12-16`. + end_datetime -- str -- The end date and time (format YYYY-MM-DD + HH:MM:SS) with which to filter the date_field. Returns + components with a timestamp at or before exact time provided + in query. You can specify timezone in query - otherwise your + site''s time zone will be used. If provided, this parameter + will be used instead of end_date. Use in query `end_datetime=2022-07-01 09:00:05`. - subscription_ids -- List[int] -- Allows fetching - components allocation with matching subscription id - based on provided ids. Use in query - `subscription_ids=1,2,3`. - price_point_ids -- IncludeNotNull -- Allows fetching - components allocation only if price point id is - present. Use in query `price_point_ids=not_null`. - product_family_ids -- List[int] -- Allows fetching - components allocation with matching product family id - based on provided ids. Use in query - `product_family_ids=1,2,3`. - include -- ListSubscriptionComponentsInclude -- Allows - including additional data in the response. Use in - query `include=subscription,historic_usages`. + subscription_ids -- List[int] -- Allows fetching components + allocation with matching subscription id based on provided + ids. Use in query `subscription_ids=1,2,3`. + price_point_ids -- IncludeNotNull -- Allows fetching components + allocation only if price point id is present. Use in query + `price_point_ids=not_null`. + product_family_ids -- List[int] -- Allows fetching components + allocation with matching product family id based on provided + ids. Use in query `product_family_ids=1,2,3`. + include -- ListSubscriptionComponentsInclude -- Allows including + additional data in the response. Use in query + `include=subscription,historic_usages`. Returns: ListSubscriptionComponentsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions_components.json') + .path("/subscriptions_components.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('sort') - .value(options.get('sort', None))) + .key("sort") + .value(options.get("sort", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(options.get('start_datetime', None))) + .key("start_datetime") + .value(options.get("start_datetime", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('end_datetime') - .value(options.get('end_datetime', None))) + .key("end_datetime") + .value(options.get("end_datetime", None))) .query_param(Parameter() - .key('subscription_ids') - .value(options.get('subscription_ids', None))) + .key("subscription_ids") + .value(options.get("subscription_ids", None))) .query_param(Parameter() - .key('price_point_ids') - .value(options.get('price_point_ids', None))) + .key("price_point_ids") + .value(options.get("price_point_ids", None))) .query_param(Parameter() - .key('product_family_ids') - .value(options.get('product_family_ids', None))) + .key("product_family_ids") + .value(options.get("product_family_ids", None))) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListSubscriptionComponentsResponse.from_dictionary) + .deserialize_into(ListSubscriptionComponentsResponse.from_dictionary), ).execute() diff --git a/advancedbilling/controllers/subscription_group_invoice_account_controller.py b/advancedbilling/controllers/subscription_group_invoice_account_controller.py index 516c9656..1dc0ac0d 100644 --- a/advancedbilling/controllers/subscription_group_invoice_account_controller.py +++ b/advancedbilling/controllers/subscription_group_invoice_account_controller.py @@ -1,115 +1,134 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.subscription_group_prepayment_response import SubscriptionGroupPrepaymentResponse -from advancedbilling.models.list_subscription_group_prepayment_response import ListSubscriptionGroupPrepaymentResponse -from advancedbilling.models.service_credit_response import ServiceCreditResponse -from advancedbilling.models.service_credit import ServiceCredit -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.list_subscription_group_prepayment_response import ( + ListSubscriptionGroupPrepaymentResponse, +) +from advancedbilling.models.service_credit import ( + ServiceCredit, +) +from advancedbilling.models.service_credit_response import ( + ServiceCreditResponse, +) +from advancedbilling.models.subscription_group_prepayment_response import ( + SubscriptionGroupPrepaymentResponse, +) -class SubscriptionGroupInvoiceAccountController(BaseController): +class SubscriptionGroupInvoiceAccountController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionGroupInvoiceAccountController object.""" super(SubscriptionGroupInvoiceAccountController, self).__init__(config) def create_subscription_group_prepayment(self, uid, body=None): - """Does a POST request to /subscription_groups/{uid}/prepayments.json. + """Perform a POST request to + /subscription_groups/{uid}/prepayments.json. - A prepayment can be added for a subscription group identified by the - group's `uid`. This endpoint requires a `amount`, `details`, `method`, - and `memo`. On success, the prepayment will be added to the group's - prepayment balance. + A prepayment can be added for a subscription group identified by the group's + `uid`. This endpoint requires a `amount`, `details`, `method`, and `memo`. On + success, the prepayment will be added to the group's prepayment balance. Args: uid (str): The uid of the subscription group - body (SubscriptionGroupPrepaymentRequest, optional): The request - body parameter. + body (SubscriptionGroupPrepaymentRequest, optional): The request body + parameter. Returns: SubscriptionGroupPrepaymentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/prepayments.json') + .path("/subscription_groups/{uid}/prepayments.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionGroupPrepaymentResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_prepayments_for_subscription_group(self, options=dict()): - """Does a GET request to /subscription_groups/{uid}/prepayments.json. + """Perform a GET request to + /subscription_groups/{uid}/prepayments.json. This request will list a subscription group's prepayments. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: uid -- str -- The uid of the subscription group - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. filter -- ListPrepaymentsFilter -- Filter to use for List Prepayments operations @@ -117,142 +136,142 @@ def list_prepayments_for_subscription_group(self, ListSubscriptionGroupPrepaymentResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/prepayments.json') + .path("/subscription_groups/{uid}/prepayments.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('uid') - .value(options.get('uid', None)) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(options.get("uid", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListSubscriptionGroupPrepaymentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def issue_subscription_group_service_credit(self, uid, body=None): - """Does a POST request to /subscription_groups/{uid}/service_credits.json. + """Perform a POST request to + /subscription_groups/{uid}/service_credits.json. - Credit can be issued for a subscription group identified by the - group's `uid`. Credit will be added to the group in the amount - specified in the request body. The credit will be applied to group - member invoices as they are generated. + Credit can be issued for a subscription group identified by the group's + `uid`. Credit will be added to the group in the amount specified in the + request body. The credit will be applied to group member invoices as they are + generated. Args: uid (str): The uid of the subscription group - body (IssueServiceCreditRequest, optional): The request body - parameter. + body (IssueServiceCreditRequest, optional): The request body parameter. Returns: ServiceCreditResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/service_credits.json') + .path("/subscription_groups/{uid}/service_credits.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ServiceCreditResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def deduct_subscription_group_service_credit(self, uid, body=None): - """Does a POST request to /subscription_groups/{uid}/service_credit_deductions.json. + """Perform a POST request to + /subscription_groups/{uid}/service_credit_deductions.json. - Credit can be deducted for a subscription group identified by the - group's `uid`. Credit will be deducted from the group in the amount - specified in the request body. + Credit can be deducted for a subscription group identified by the group's + `uid`. Credit will be deducted from the group in the amount specified in the + request body. Args: uid (str): The uid of the subscription group - body (DeductServiceCreditRequest, optional): The request body - parameter. + body (DeductServiceCreditRequest, optional): The request body parameter. Returns: ServiceCredit: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/service_credit_deductions.json') + .path("/subscription_groups/{uid}/service_credit_deductions.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ServiceCredit.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/controllers/subscription_group_status_controller.py b/advancedbilling/controllers/subscription_group_status_controller.py index d14fd73c..33571dbc 100644 --- a/advancedbilling/controllers/subscription_group_status_controller.py +++ b/advancedbilling/controllers/subscription_group_status_controller.py @@ -1,88 +1,95 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.reactivate_subscription_group_response import ReactivateSubscriptionGroupResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.reactivate_subscription_group_response import ( + ReactivateSubscriptionGroupResponse, +) -class SubscriptionGroupStatusController(BaseController): +class SubscriptionGroupStatusController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionGroupStatusController object.""" super(SubscriptionGroupStatusController, self).__init__(config) def cancel_subscriptions_in_group(self, uid, body=None): - """Does a POST request to /subscription_groups/{uid}/cancel.json. + """Perform a POST request to /subscription_groups/{uid}/cancel.json. - Cancels all subscriptions within the specified group immediately. The - group is identified by the `uid` that is passed in the URL. To - successfully cancel the group, the primary subscription must be on - automatic billing. The group members must be on automatic billing or - prepaid. - To cancel a subscription group while also charging for any unbilled - usage on metered or prepaid components, the - `charge_unbilled_usage=true` parameter must be included in the request. + Cancels all subscriptions within the specified group immediately. The group + is identified by the `uid` that is passed in the URL. To successfully cancel + the group, the primary subscription must be on automatic billing. The group + members must be on automatic billing or prepaid. + To cancel a subscription group while also charging for any unbilled usage on + metered or prepaid components, the `charge_unbilled_usage=true` parameter + must be included in the request. Args: uid (str): The uid of the subscription group - body (CancelGroupedSubscriptionsRequest, optional): The request - body parameter. + body (CancelGroupedSubscriptionsRequest, optional): The request body + parameter. Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/cancel.json') + .path("/subscription_groups/{uid}/cancel.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def initiate_delayed_cancellation_for_group(self, uid): - """Does a POST request to /subscription_groups/{uid}/delayed_cancel.json. + """Perform a POST request to + /subscription_groups/{uid}/delayed_cancel.json. - This endpoint will schedule all subscriptions within the specified - group to be canceled at the end of their billing period. The group is - identified by its uid passed in the URL. - All subscriptions in the group must be on automatic billing in order - to successfully cancel them, and the group must not be in a "past_due" - state. + This endpoint will schedule all subscriptions within the specified group to + be canceled at the end of their billing period. The group is identified by + its uid passed in the URL. + All subscriptions in the group must be on automatic billing in order to + successfully cancel them, and the group must not be in a "past_due" state. Args: uid (str): The uid of the subscription group @@ -91,33 +98,32 @@ def initiate_delayed_cancellation_for_group(self, void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/delayed_cancel.json') + .path("/subscription_groups/{uid}/delayed_cancel.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def cancel_delayed_cancellation_for_group(self, uid): - """Does a DELETE request to /subscription_groups/{uid}/delayed_cancel.json. + """Perform a DELETE request to + /subscription_groups/{uid}/delayed_cancel.json. - Removing the delayed cancellation on a subscription group will ensure - that the subscriptions do not get canceled at the end of the period. - The request will reset the `cancel_at_end_of_period` flag to false on - each member in the group. + Removing the delayed cancellation on a subscription group will ensure that + the subscriptions do not get canceled at the end of the period. The request + will reset the `cancel_at_end_of_period` flag to false on each member in the + group. Args: uid (str): The uid of the subscription group @@ -126,105 +132,101 @@ def cancel_delayed_cancellation_for_group(self, void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/delayed_cancel.json') + .path("/subscription_groups/{uid}/delayed_cancel.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() def reactivate_subscription_group(self, uid, body=None): - """Does a POST request to /subscription_groups/{uid}/reactivate.json. - - This endpoint will attempt to reactivate or resume a cancelled - subscription group. Upon reactivation, any canceled invoices created - after the beginning of the primary subscription's billing period will - be reopened and payment will be attempted on them. If the subscription - group is being reactivated (as opposed to resumed), new charges will - also be assessed for the new billing period. - Whether a subscription group is reactivated (a new billing period is - created) or resumed (the current billing period is respected) will - depend on the parameters that are sent with the request as well as the - date of the request relative to the primary subscription's period. + """Perform a POST request to + /subscription_groups/{uid}/reactivate.json. + + This endpoint will attempt to reactivate or resume a cancelled subscription + group. Upon reactivation, any canceled invoices created after the beginning + of the primary subscription's billing period will be reopened and payment + will be attempted on them. If the subscription group is being reactivated (as + opposed to resumed), new charges will also be assessed for the new billing + period. + Whether a subscription group is reactivated (a new billing period is created) + or resumed (the current billing period is respected) will depend on the + parameters that are sent with the request as well as the date of the request + relative to the primary subscription's period. ## Reactivating within the current period - If a subscription group is cancelled and reactivated within the - primary subscription's current period, we can choose to either start a - new billing period or maintain the existing one. If we want to - maintain the existing billing period the `resume=true` option must be - passed in request parameters. - An exception to the above are subscriptions that are on calendar - billing. These subscriptions cannot be reactivated within the current - period. If the `resume=true` option is not passed the request will - return an error. - The `resume_members` option is ignored in this case. All eligible - group members will be automatically resumed. + If a subscription group is cancelled and reactivated within the primary + subscription's current period, we can choose to either start a new billing + period or maintain the existing one. If we want to maintain the existing + billing period the `resume=true` option must be passed in request parameters. + An exception to the above are subscriptions that are on calendar billing. + These subscriptions cannot be reactivated within the current period. If the + `resume=true` option is not passed the request will return an error. + The `resume_members` option is ignored in this case. All eligible group + members will be automatically resumed. ## Reactivating beyond the current period - In this case, a subscription group can only be reactivated with a new - billing period. If the `resume=true` option is passed it will be - ignored. + In this case, a subscription group can only be reactivated with a new billing + period. If the `resume=true` option is passed it will be ignored. Member subscriptions can have billing periods that are longer than the - primary (e.g. a monthly primary with annual group members). If the - primary subscription in a group cannot be reactivated within the - current period, but other group members can be, passing - `resume_members=true` will resume the existing billing period for - eligible group members. The primary subscription will begin a new - billing period. - For calendar billing subscriptions, the new billing period created - will be a partial one, spanning from the date of reactivation to the - next corresponding calendar renewal date. + primary (e.g. a monthly primary with annual group members). If the primary + subscription in a group cannot be reactivated within the current period, but + other group members can be, passing `resume_members=true` will resume the + existing billing period for eligible group members. The primary subscription + will begin a new billing period. + For calendar billing subscriptions, the new billing period created will be a + partial one, spanning from the date of reactivation to the next corresponding + calendar renewal date. Args: uid (str): The uid of the subscription group - body (ReactivateSubscriptionGroupRequest, optional): The request - body parameter. + body (ReactivateSubscriptionGroupRequest, optional): The request body + parameter. Returns: ReactivateSubscriptionGroupResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}/reactivate.json') + .path("/subscription_groups/{uid}/reactivate.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ReactivateSubscriptionGroupResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/controllers/subscription_groups_controller.py b/advancedbilling/controllers/subscription_groups_controller.py index 52402425..e5339eb0 100644 --- a/advancedbilling/controllers/subscription_groups_controller.py +++ b/advancedbilling/controllers/subscription_groups_controller.py @@ -1,62 +1,84 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.subscription_group_signup_response import SubscriptionGroupSignupResponse -from advancedbilling.models.subscription_group_response import SubscriptionGroupResponse -from advancedbilling.models.list_subscription_groups_response import ListSubscriptionGroupsResponse -from advancedbilling.models.full_subscription_group_response import FullSubscriptionGroupResponse -from advancedbilling.models.delete_subscription_group_response import DeleteSubscriptionGroupResponse -from advancedbilling.exceptions.subscription_group_signup_error_response_exception import SubscriptionGroupSignupErrorResponseException -from advancedbilling.exceptions.subscription_group_create_error_response_exception import SubscriptionGroupCreateErrorResponseException -from advancedbilling.exceptions.subscription_group_update_error_response_exception import SubscriptionGroupUpdateErrorResponseException -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.subscription_group_create_error_response_exception import ( # noqa: E501 + SubscriptionGroupCreateErrorResponseException, +) +from advancedbilling.exceptions.subscription_group_signup_error_response_exception import ( # noqa: E501 + SubscriptionGroupSignupErrorResponseException, +) +from advancedbilling.exceptions.subscription_group_update_error_response_exception import ( # noqa: E501 + SubscriptionGroupUpdateErrorResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.delete_subscription_group_response import ( + DeleteSubscriptionGroupResponse, +) +from advancedbilling.models.full_subscription_group_response import ( + FullSubscriptionGroupResponse, +) +from advancedbilling.models.list_subscription_groups_response import ( + ListSubscriptionGroupsResponse, +) +from advancedbilling.models.subscription_group_response import ( + SubscriptionGroupResponse, +) +from advancedbilling.models.subscription_group_signup_response import ( + SubscriptionGroupSignupResponse, +) -class SubscriptionGroupsController(BaseController): +class SubscriptionGroupsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionGroupsController object.""" super(SubscriptionGroupsController, self).__init__(config) def signup_with_subscription_group(self, body=None): - """Does a POST request to /subscription_groups/signup.json. + """Perform a POST request to /subscription_groups/signup.json. - Create multiple subscriptions at once under the same customer and - consolidate them into a subscription group. + Create multiple subscriptions at once under the same customer and consolidate + them into a subscription group. You must provide one and only one of the - `payer_id`/`payer_reference`/`payer_attributes` for the customer - attached to the group. + `payer_id`/`payer_reference`/`payer_attributes` for the customer attached to + the group. You must provide one and only one of the - `payment_profile_id`/`credit_card_attributes`/`bank_account_attributes` - for the payment profile attached to the group. - Only one of the `subscriptions` can have `"primary": true` attribute - set. - When passing product to a subscription you can use either `product_id` - or `product_handle` or `offer_id`. You can also use `custom_price` - instead. - The subscription request examples below will be split into two - sections. + `payment_profile_id`/`credit_card_attributes`/`bank_account_attributes` for + the payment profile attached to the group. + Only one of the `subscriptions` can have `"primary": true` attribute set. + When passing product to a subscription you can use either `product_id` or + `product_handle` or `offer_id`. You can also use `custom_price` instead. + The subscription request examples below will be split into two sections. The first section, "Subscription Customization", will focus on passing - different information with a subscription, such as components, - calendar billing, and custom fields. These examples will presume you - are using a secure chargify_token generated by Chargify.js. + different information with a subscription, such as components, calendar + billing, and custom fields. These examples will presume you are using a + secure chargify_token generated by Chargify.js. Args: body (SubscriptionGroupSignupRequest, optional): The request body @@ -66,37 +88,38 @@ def signup_with_subscription_group(self, SubscriptionGroupSignupResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/signup.json') + .path("/subscription_groups/signup.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionGroupSignupResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SubscriptionGroupSignupErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SubscriptionGroupSignupErrorResponseException), ).execute() def create_subscription_group(self, body=None): - """Does a POST request to /subscription_groups.json. + """Perform a POST request to /subscription_groups.json. Creates a subscription group with given members. @@ -108,171 +131,163 @@ def create_subscription_group(self, SubscriptionGroupResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups.json') + .path("/subscription_groups.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionGroupResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SubscriptionGroupCreateErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SubscriptionGroupCreateErrorResponseException), ).execute() def list_subscription_groups(self, options=dict()): - """Does a GET request to /subscription_groups.json. + """Perform a GET request to /subscription_groups.json. Returns an array of subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. #### Account Balance Information - Account balance information for the subscription groups is not - returned by default. If this information is desired, the - `include[]=account_balances` parameter must be provided with the - request. + Account balance information for the subscription groups is not returned by + default. If this information is desired, the `include[]=account_balances` + parameter must be provided with the request. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - include -- List[SubscriptionGroupsListInclude] -- A list - of additional information to include in the response. - The following values are supported: - - `account_balances`: Account balance information for - the subscription groups. Use in query: - `include[]=account_balances` + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + include -- List[SubscriptionGroupsListInclude] -- A list of + additional information to include in the response. The + following values are supported: - `account_balances`: + Account balance information for the subscription groups. Use + in query: `include[]=account_balances` Returns: ListSubscriptionGroupsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups.json') + .path("/subscription_groups.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.UN_INDEXED) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ListSubscriptionGroupsResponse.from_dictionary) + .deserialize_into(ListSubscriptionGroupsResponse.from_dictionary), ).execute() def read_subscription_group(self, uid, include=None): - """Does a GET request to /subscription_groups/{uid}.json. + """Perform a GET request to /subscription_groups/{uid}.json. Use this endpoint to find subscription group details. #### Current Billing Amount in Cents - Current billing amount for the subscription group is not returned by - default. If this information is desired, the - `include[]=current_billing_amount_in_cents` parameter must be provided - with the request. + Current billing amount for the subscription group is not returned by default. + If this information is desired, the + `include[]=current_billing_amount_in_cents` parameter must be provided with + the request. Args: uid (str): The uid of the subscription group - include (List[SubscriptionGroupInclude], optional): Allows - including additional data in the response. Use in query: + include (List[SubscriptionGroupInclude], optional): Allows including + additional data in the response. Use in query: `include[]=current_billing_amount_in_cents`. Returns: FullSubscriptionGroupResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}.json') + .path("/subscription_groups/{uid}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('include') - .value(include)) + .key("include") + .value(include)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.UN_INDEXED) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(FullSubscriptionGroupResponse.from_dictionary) + .deserialize_into(FullSubscriptionGroupResponse.from_dictionary), ).execute() def update_subscription_group_members(self, uid, body=None): - """Does a PUT request to /subscription_groups/{uid}.json. + """Perform a PUT request to /subscription_groups/{uid}.json. Use this endpoint to update subscription group members. - `"member_ids"` should contain an array of both subscription IDs to set - as group members and subscription IDs already present in the groups. - Not including them will result in removing them from subscription - group. To clean up members, just leave the array empty. + `"member_ids"` should contain an array of both subscription IDs to set as + group members and subscription IDs already present in the groups. Not + including them will result in removing them from subscription group. To clean + up members, just leave the array empty. Args: uid (str): The uid of the subscription group @@ -283,45 +298,46 @@ def update_subscription_group_members(self, SubscriptionGroupResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}.json') + .path("/subscription_groups/{uid}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionGroupResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SubscriptionGroupUpdateErrorResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SubscriptionGroupUpdateErrorResponseException), ).execute() def delete_subscription_group(self, uid): - """Does a DELETE request to /subscription_groups/{uid}.json. + """Perform a DELETE request to /subscription_groups/{uid}.json. - Use this endpoint to delete subscription group. - Only groups without members can be deleted + Deletes a subscription group. + Only groups without members can be deleted. Args: uid (str): The uid of the subscription group @@ -330,39 +346,36 @@ def delete_subscription_group(self, DeleteSubscriptionGroupResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/{uid}.json') + .path("/subscription_groups/{uid}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('uid') - .value(uid) - .is_required(True) - .should_encode(True)) + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(DeleteSubscriptionGroupResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def find_subscription_group(self, subscription_id): - """Does a GET request to /subscription_groups/lookup.json. + """Perform a GET request to /subscription_groups/lookup.json. - Use this endpoint to find subscription group associated with - subscription. + Use this endpoint to find subscription group associated with subscription. If the subscription is not in a group endpoint will return 404 code. Args: @@ -373,58 +386,57 @@ def find_subscription_group(self, FullSubscriptionGroupResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscription_groups/lookup.json') + .path("/subscription_groups/lookup.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(FullSubscriptionGroupResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def add_subscription_to_group(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/group.json. + """Perform a POST request to + /subscriptions/{subscription_id}/group.json. For sites making use of the [Relationship - Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Adv - anced-Billing-Invoices-Overview) and [Customer - Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-C - ustomer-Hierarchies-WhoPays#customer-hierarchies) features, it is - possible to add existing subscriptions to subscription groups. - Passing `group` parameters with a `target` containing a `type` and - optional `id` is all that's needed. When the `target` parameter - specifies a `"customer"` or `"subscription"` that is already part of a - hierarchy, the subscription will become a member of the customer's - subscription group. If the target customer or subscription is not - part of a subscription group, a new group will be created and the - subscription will become part of the group with the specified target - customer set as the responsible payer for the group's subscriptions. - **Note:** In order to add an existing subscription to a subscription - group, it must belong to either the same customer record as the - target, or be within the same customer hierarchy. - Rather than specifying a customer, the `target` parameter could - instead simply have a value of - * `"self"` which indicates the subscription will be paid for not by - some other customer, but by the subscribing customer, + Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-B + illing-Invoices-Overview) and [Customer + Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer + -Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add + existing subscriptions to subscription groups. + Passing `group` parameters with a `target` containing a `type` and optional + `id` is all that's needed. When the `target` parameter specifies a + `"customer"` or `"subscription"` that is already part of a hierarchy, the + subscription will become a member of the customer's subscription group. If + the target customer or subscription is not part of a subscription group, a + new group will be created and the subscription will become part of the group + with the specified target customer set as the responsible payer for the + group's subscriptions. + **Note:** In order to add an existing subscription to a subscription group, + it must belong to either the same customer record as the target, or be within + the same customer hierarchy. + Rather than specifying a customer, the `target` parameter could instead + simply have a value of + * `"self"` which indicates the subscription will be paid for not by some + other customer, but by the subscribing customer, * `"parent"` which indicates the subscription will be paid for by the subscribing customer's parent within a customer hierarchy, or * `"eldest"` which indicates the subscription will be paid for by the @@ -432,83 +444,79 @@ def add_subscription_to_group(self, To create a new subscription into a subscription group, reference the following: [Create Subscription in a Subscription - Group](https://developers.chargify.com/docs/api-docs/d571659cf0f24-crea - te-subscription#subscription-in-a-subscription-group) + Group](https://developers.chargify.com/docs/api-docs/d571659cf0f24-create-subs + cription#subscription-in-a-subscription-group) Args: - subscription_id (int): The Chargify id of the subscription - body (AddSubscriptionToAGroup, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (AddSubscriptionToAGroup, optional): The request body parameter. Returns: SubscriptionGroupResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/group.json') + .path("/subscriptions/{subscription_id}/group.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionGroupResponse.from_dictionary) + .deserialize_into(SubscriptionGroupResponse.from_dictionary), ).execute() def remove_subscription_from_group(self, subscription_id): - """Does a DELETE request to /subscriptions/{subscription_id}/group.json. + """Perform a DELETE request to + /subscriptions/{subscription_id}/group.json. For sites making use of the [Relationship - Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Adv - anced-Billing-Invoices-Overview) and [Customer - Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-C - ustomer-Hierarchies-WhoPays#customer-hierarchies) features, it is - possible to remove existing subscription from subscription group. + Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-B + illing-Invoices-Overview) and [Customer + Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer + -Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove + existing subscription from subscription group. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/group.json') + .path("/subscriptions/{subscription_id}/group.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() diff --git a/advancedbilling/controllers/subscription_invoice_account_controller.py b/advancedbilling/controllers/subscription_invoice_account_controller.py index 608c8831..dfd92c8a 100644 --- a/advancedbilling/controllers/subscription_invoice_account_controller.py +++ b/advancedbilling/controllers/subscription_invoice_account_controller.py @@ -1,164 +1,187 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.account_balances import AccountBalances -from advancedbilling.models.create_prepayment_response import CreatePrepaymentResponse -from advancedbilling.models.prepayments_response import PrepaymentsResponse -from advancedbilling.models.service_credit import ServiceCredit -from advancedbilling.models.list_service_credits_response import ListServiceCreditsResponse -from advancedbilling.models.prepayment_response import PrepaymentResponse -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.refund_prepayment_base_errors_response_exception import RefundPrepaymentBaseErrorsResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.exceptions.refund_prepayment_base_errors_response_exception import ( # noqa: E501 + RefundPrepaymentBaseErrorsResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.account_balances import ( + AccountBalances, +) +from advancedbilling.models.create_prepayment_response import ( + CreatePrepaymentResponse, +) +from advancedbilling.models.list_service_credits_response import ( + ListServiceCreditsResponse, +) +from advancedbilling.models.prepayment_response import ( + PrepaymentResponse, +) +from advancedbilling.models.prepayments_response import ( + PrepaymentsResponse, +) +from advancedbilling.models.service_credit import ( + ServiceCredit, +) -class SubscriptionInvoiceAccountController(BaseController): +class SubscriptionInvoiceAccountController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionInvoiceAccountController object.""" super(SubscriptionInvoiceAccountController, self).__init__(config) def read_account_balances(self, subscription_id): - """Does a GET request to /subscriptions/{subscription_id}/account_balances.json. + """Perform a GET request to + /subscriptions/{subscription_id}/account_balances.json. Returns the `balance_in_cents` of the Subscription's Pending Discount, Service Credit, and Prepayment accounts, as well as the sum of the Subscription's open, payable invoices. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: AccountBalances: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/account_balances.json') + .path("/subscriptions/{subscription_id}/account_balances.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(AccountBalances.from_dictionary) + .deserialize_into(AccountBalances.from_dictionary), ).execute() def create_prepayment(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/prepayments.json. + """Perform a POST request to + /subscriptions/{subscription_id}/prepayments.json. ## Create Prepayment - In order to specify a prepayment made against a subscription, specify - the `amount, memo, details, method`. - When the `method` specified is `"credit_card_on_file"`, the prepayment - amount will be collected using the default credit card payment profile - and applied to the prepayment account balance. This is especially - useful for manual replenishment of prepaid subscriptions. + In order to specify a prepayment made against a subscription, specify the + `amount, memo, details, method`. + When the `method` specified is `"credit_card_on_file"`, the prepayment amount + will be collected using the default credit card payment profile and applied + to the prepayment account balance. This is especially useful for manual + replenishment of prepaid subscriptions. Note that passing `amount_in_cents` is now allowed. Args: - subscription_id (int): The Chargify id of the subscription - body (CreatePrepaymentRequest, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (CreatePrepaymentRequest, optional): The request body parameter. Returns: CreatePrepaymentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/prepayments.json') + .path("/subscriptions/{subscription_id}/prepayments.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(CreatePrepaymentResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + APIException), ).execute() def list_prepayments(self, options=dict()): - """Does a GET request to /subscriptions/{subscription_id}/prepayments.json. + """Perform a GET request to + /subscriptions/{subscription_id}/prepayments.json. This request will list a subscription's prepayments. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - subscription_id -- int -- The Chargify id of the - subscription - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + subscription_id -- int -- The Chargify id of the subscription. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. filter -- ListPrepaymentsFilter -- Filter to use for List Prepayments operations @@ -166,135 +189,132 @@ def list_prepayments(self, PrepaymentsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/prepayments.json') + .path("/subscriptions/{subscription_id}/prepayments.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None)) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(options.get("subscription_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('filter') - .value(options.get('filter', None))) + .key("filter") + .value(options.get("filter", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PrepaymentsResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def issue_service_credit(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/service_credits.json. + """Perform a POST request to + /subscriptions/{subscription_id}/service_credits.json. - Credit will be added to the subscription in the amount specified in - the request body. The credit is subsequently applied to the next - generated invoice. + Credit will be added to the subscription in the amount specified in the + request body. The credit is subsequently applied to the next generated + invoice. Args: - subscription_id (int): The Chargify id of the subscription - body (IssueServiceCreditRequest, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (IssueServiceCreditRequest, optional): The request body parameter. Returns: ServiceCredit: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/service_credits.json') + .path("/subscriptions/{subscription_id}/service_credits.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ServiceCredit.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + APIException), ).execute() def deduct_service_credit(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/service_credit_deductions.json. + """Perform a POST request to + /subscriptions/{subscription_id}/service_credit_deductions.json. - Credit will be removed from the subscription in the amount specified - in the request body. The credit amount being deducted must be equal to - or less than the current credit balance. + Credit will be removed from the subscription in the amount specified in the + request body. The credit amount being deducted must be equal to or less than + the current credit balance. Args: - subscription_id (int): The Chargify id of the subscription - body (DeductServiceCreditRequest, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (DeductServiceCreditRequest, optional): The request body parameter. Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/service_credit_deductions.json') + .path("/subscriptions/{subscription_id}/service_credit_deductions.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def list_service_credits(self, @@ -302,127 +322,132 @@ def list_service_credits(self, page=1, per_page=20, direction=None): - """Does a GET request to /subscriptions/{subscription_id}/service_credits/list.json. + """Perform a GET request to + /subscriptions/{subscription_id}/service_credits/list.json. This request will list a subscription's service credits. Args: - subscription_id (int): The Chargify id of the subscription - page (int, optional): Result records are organized in pages. By - default, the first page of results is displayed. The page - parameter specifies a page number of results to fetch. You can - start navigating through the pages to consume the results. You - do this by passing in a page parameter. Retrieve the next page - by adding ?page=2 to the query string. If there are no results - to return, then an empty result set will be returned. Use in - query `page=1`. - per_page (int, optional): This parameter indicates how many - records to fetch in each request. Default value is 20. The - maximum allowed values is 200; any per_page value over 200 - will be changed to 200. Use in query `per_page=200`. - direction (SortingDirection, optional): Controls the order in - which results are returned. Use in query `direction=asc`. + subscription_id (int): The Chargify id of the subscription. + page (int, optional): Result records are organized in pages. By default, + the first page of results is displayed. The page parameter specifies + a page number of results to fetch. You can start navigating through + the pages to consume the results. You do this by passing in a page + parameter. Retrieve the next page by adding ?page=2 to the query + string. If there are no results to return, then an empty result set + will be returned. Use in query `page=1`. + per_page (int, optional): This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum allowed + values is 200; any per_page value over 200 will be changed to 200. + Use in query `per_page=200`. + direction (SortingDirection, optional): Controls the order in which + results are returned. Use in query `direction=asc`. Returns: ListServiceCreditsResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/service_credits/list.json') + .path("/subscriptions/{subscription_id}/service_credits/list.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(page)) + .key("page") + .value(page)) .query_param(Parameter() - .key('per_page') - .value(per_page)) + .key("per_page") + .value(per_page)) .query_param(Parameter() - .key('direction') - .value(direction)) + .key("direction") + .value(direction)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ListServiceCreditsResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def refund_prepayment(self, subscription_id, prepayment_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/prepayments/{prepayment_id}/refunds.json. + """Perform a POST request to + /subscriptions/{subscription_id}/prepayments/{prepayment_id}/refunds.json. - This endpoint will refund, completely or partially, a particular - prepayment applied to a subscription. The `prepayment_id` will be the - account transaction ID of the original payment. The prepayment must - have some amount remaining in order to be refunded. - The amount may be passed either as a decimal, with `amount`, or an - integer in cents, with `amount_in_cents`. + This endpoint will refund, completely or partially, a particular prepayment + applied to a subscription. The `prepayment_id` will be the account + transaction ID of the original payment. The prepayment must have some amount + remaining in order to be refunded. + The amount may be passed either as a decimal, with `amount`, or an integer in + cents, with `amount_in_cents`. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. prepayment_id (int): id of prepayment - body (RefundPrepaymentRequest, optional): The request body - parameter. + body (RefundPrepaymentRequest, optional): The request body parameter. Returns: PrepaymentResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/prepayments/{prepayment_id}/refunds.json') + .path("/subscriptions/{subscription_id}/prepayments/{prepayment_id}/refunds.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('prepayment_id') - .value(prepayment_id) - .is_required(True) - .should_encode(True)) + .key("prepayment_id") + .value(prepayment_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PrepaymentResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('400', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', RefundPrepaymentBaseErrorsResponseException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("400", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + RefundPrepaymentBaseErrorsResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + APIException), ).execute() diff --git a/advancedbilling/controllers/subscription_notes_controller.py b/advancedbilling/controllers/subscription_notes_controller.py index 254362c6..56d2095b 100644 --- a/advancedbilling/controllers/subscription_notes_controller.py +++ b/advancedbilling/controllers/subscription_notes_controller.py @@ -1,48 +1,59 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.subscription_note_response import SubscriptionNoteResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.subscription_note_response import ( + SubscriptionNoteResponse, +) -class SubscriptionNotesController(BaseController): +class SubscriptionNotesController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionNotesController object.""" super(SubscriptionNotesController, self).__init__(config) def create_subscription_note(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/notes.json. + """Perform a POST request to + /subscriptions/{subscription_id}/notes.json. Use the following method to create a note for a subscription. ## How to Use Subscription Notes - Notes allow you to record information about a particular Subscription - in a free text format. - If you have structured data such as birth date, color, etc., consider - using Metadata instead. - Full documentation on how to use Notes in the Advanced Billing UI can - be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subsc - ription-Summary-Overview). + Notes allow you to record information about a particular Subscription in a + free text format. + If you have structured data such as birth date, color, etc., consider using + Metadata instead. + Full documentation on how to use Notes in the Advanced Billing UI can be + located + [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscription + -Summary-Overview). Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (UpdateSubscriptionNoteRequest, optional): The request body parameter. @@ -50,164 +61,163 @@ def create_subscription_note(self, SubscriptionNoteResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/notes.json') + .path("/subscriptions/{subscription_id}/notes.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionNoteResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_subscription_notes(self, options=dict()): - """Does a GET request to /subscriptions/{subscription_id}/notes.json. + """Perform a GET request to + /subscriptions/{subscription_id}/notes.json. - Use this method to retrieve a list of Notes associated with a - Subscription. The response will be an array of Notes. + Use this method to retrieve a list of Notes associated with a Subscription. + The response will be an array of Notes. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - subscription_id -- int -- The Chargify id of the - subscription - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + subscription_id -- int -- The Chargify id of the subscription. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. Returns: List[SubscriptionNoteResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/notes.json') + .path("/subscriptions/{subscription_id}/notes.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None)) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(options.get("subscription_id", None)) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionNoteResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_subscription_note(self, subscription_id, note_id): - """Does a GET request to /subscriptions/{subscription_id}/notes/{note_id}.json. + """Perform a GET request to + /subscriptions/{subscription_id}/notes/{note_id}.json. - Once you have obtained the ID of the note you wish to read, use this - method to show a particular note attached to a subscription. + Once you have obtained the ID of the note you wish to read, use this method + to show a particular note attached to a subscription. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. note_id (int): The Advanced Billing id of the note Returns: SubscriptionNoteResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/notes/{note_id}.json') + .path("/subscriptions/{subscription_id}/notes/{note_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('note_id') - .value(note_id) - .is_required(True) - .should_encode(True)) + .key("note_id") + .value(note_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionNoteResponse.from_dictionary) + .deserialize_into(SubscriptionNoteResponse.from_dictionary), ).execute() def update_subscription_note(self, subscription_id, note_id, body=None): - """Does a PUT request to /subscriptions/{subscription_id}/notes/{note_id}.json. + """Perform a PUT request to + /subscriptions/{subscription_id}/notes/{note_id}.json. Use the following method to update a note for a Subscription. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. note_id (int): The Advanced Billing id of the note body (UpdateSubscriptionNoteRequest, optional): The request body parameter. @@ -216,79 +226,79 @@ def update_subscription_note(self, SubscriptionNoteResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/notes/{note_id}.json') + .path("/subscriptions/{subscription_id}/notes/{note_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('note_id') - .value(note_id) - .is_required(True) - .should_encode(True)) + .key("note_id") + .value(note_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionNoteResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def delete_subscription_note(self, subscription_id, note_id): - """Does a DELETE request to /subscriptions/{subscription_id}/notes/{note_id}.json. + """Perform a DELETE request to + /subscriptions/{subscription_id}/notes/{note_id}.json. - Use the following method to delete a note for a Subscription. + Deletes a note for a Subscription. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. note_id (int): The Advanced Billing id of the note Returns: void: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/notes/{note_id}.json') + .path("/subscriptions/{subscription_id}/notes/{note_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .template_param(Parameter() - .key('note_id') - .value(note_id) - .is_required(True) - .should_encode(True)) - .auth(Single('BasicAuth')) + .key("note_id") + .value(note_id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), ).execute() diff --git a/advancedbilling/controllers/subscription_products_controller.py b/advancedbilling/controllers/subscription_products_controller.py index 2324df8e..7ed82084 100644 --- a/advancedbilling/controllers/subscription_products_controller.py +++ b/advancedbilling/controllers/subscription_products_controller.py @@ -1,68 +1,79 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.subscription_response import SubscriptionResponse -from advancedbilling.models.subscription_migration_preview_response import SubscriptionMigrationPreviewResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.subscription_migration_preview_response import ( + SubscriptionMigrationPreviewResponse, +) +from advancedbilling.models.subscription_response import ( + SubscriptionResponse, +) -class SubscriptionProductsController(BaseController): +class SubscriptionProductsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionProductsController object.""" super(SubscriptionProductsController, self).__init__(config) def migrate_subscription_product(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/migrations.json. + """Perform a POST request to + /subscriptions/{subscription_id}/migrations.json. In order to create a migration, you must pass the `product_id` or - `product_handle` in the object when you send a POST request. You may - also pass either a `product_price_point_id` or - `product_price_point_handle` to choose which price point the - subscription is moved to. If no price point identifier is passed the - subscription will be moved to the products default price point. The - response will be the updated subscription. + `product_handle` in the object when you send a POST request. You may also + pass either a `product_price_point_id` or `product_price_point_handle` to + choose which price point the subscription is moved to. If no price point + identifier is passed the subscription will be moved to the products default + price point. The response will be the updated subscription. ## Valid Subscriptions - Subscriptions should be in the `active` or `trialing` state in order - to be migrated. + Subscriptions should be in the `active` or `trialing` state in order to be + migrated. (For backwards compatibility reasons, it is possible to migrate a - subscription that is in the `trial_ended` state via the API, however - this is not recommended. Since `trial_ended` is an end-of-life state, - the subscription should be canceled, the product changed, and then the + subscription that is in the `trial_ended` state via the API, however this is + not recommended. Since `trial_ended` is an end-of-life state, the + subscription should be canceled, the product changed, and then the subscription can be reactivated.) ## Migrations Documentation - Full documentation on how to record Migrations in the Advanced Billing - UI can be located - [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data- - Migration-to-Advanced-Billing). + Full documentation on how to record Migrations in the Advanced Billing UI can + be located + [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Migrati + on-to-Advanced-Billing). ## Failed Migrations - Importaint note: One of the most common ways that a migration can fail - is when the attempt is made to migrate a subscription to its current - product. + Importaint note: One of the most common ways that a migration can fail is + when the attempt is made to migrate a subscription to its current product. ## Migration 3D Secure - Stripe - When a payment requires 3D Secure Authentication to adhear to Strong - Customer Authentication (SCA) when the subscription is migrated to a - new product, the request enters a [post-authentication - flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testin - g-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authent - ication). The server returns `422 Unprocessable Entity` in this case - with the following response: + When a payment requires 3D Secure Authentication to adhear to Strong Customer + Authentication (SCA) when the subscription is migrated to a new product, the + request enters a [post-authentication + flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Imple + menting-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). The + server returns `422 Unprocessable Entity` in this case with the following + response: ```json { "errors": [ @@ -70,157 +81,157 @@ def migrate_subscription_product(self, authentication." ], "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", - "description": "This card requires 3D secure authentication. - Redirect the customer to the URL from the action_link attribute to - authenticate. Attach callback_url param to this URL if you want to be - notified about the result of 3D Secure authentication. Attach - redirect_url param to this URL if you want to redirect a customer back - to your page after 3D Secure authentication. Example: - https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_t - ime_token_id=128&callback_url=https://localhost:4000&redirect_url=https - ://yourpage.com will do a POST request to https://localhost:4000 after - payment is authenticated and will redirect a customer to - https://yourpage.com after 3DS authentication.", + "description": "This card requires 3D secure authentication. Redirect the + customer to the URL from the action_link attribute to authenticate. Attach + callback_url param to this URL if you want to be notified about the result of + 3D Secure authentication. Attach redirect_url param to this URL if you want + to redirect a customer back to your page after 3D Secure authentication. + Example: + https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_tok + en_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.co + m will do a POST request to https://localhost:4000 after payment is + authenticated and will redirect a customer to https://yourpage.com after 3DS + authentication.", "action_link": - "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_tim - e_token_id=242" + "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_token + _id=242" } ``` - To let the customer go through 3D Secure Authentication, they need to - be redirected to the URL specified in `action_link`. - Optionally, you can specify `callback_url` parameter in the - `action_link` URL if you’d like to be notified about the result of 3D - Secure Authentication. The `callback_url` will return the following - information: + To let the customer go through 3D Secure Authentication, they need to be + redirected to the URL specified in `action_link`. + Optionally, you can specify `callback_url` parameter in the `action_link` URL + if you’d like to be notified about the result of 3D Secure Authentication. + The `callback_url` will return the following information: - whether the authentication was successful (`success`) - the gateway ID for the payment (`gateway_payment_id`) - the subscription ID (`subscription_id`) - Lastly, you can also specify a `redirect_url` within the `action_link` - URL if you’d like to redirect a customer back to your site. + Lastly, you can also specify a `redirect_url` within the `action_link` URL if + you’d like to redirect a customer back to your site. It is not possible to use `action_link` in an iframe inside a custom - application. You have to redirect the customer directly to the - `action_link`, then, to be notified about the result, use - `redirect_url` or `callback_url`. - The final URL that you send a customer to to complete 3D Secure may - resemble the following, where the first half is the `action_link` and - the second half contains a `redirect_url` and `callback_url`: - `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_ - time_token_id=128&callback_url=https://localhost:4000&redirect_url=http - s://yourpage.com` + application. You have to redirect the customer directly to the `action_link`, + then, to be notified about the result, use `redirect_url` or `callback_url`. + The final URL that you send a customer to to complete 3D Secure may resemble + the following, where the first half is the `action_link` and the second half + contains a `redirect_url` and `callback_url`: + `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_to + ken_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.c + om` ### Example Redirect Flow - You may wish to redirect customers to different pages depending on - whether SCA was performed successfully. Here's an example flow to use - as a reference: + You may wish to redirect customers to different pages depending on whether + SCA was performed successfully. Here's an example flow to use as a reference: 1. Create a migration via API; it requires 3DS - 2. You receive a `gateway_payment_id` in the `action_link` along other - params in the response. - 3. Use this `gateway_payment_id` to, for example, connect with your - internal resources or generate a session_id - 4. Include 1 of those attributes inside the `callback_url` and - `redirect_url` to be aware which “session” this applies to + 2. You receive a `gateway_payment_id` in the `action_link` along other params + in the response. + 3. Use this `gateway_payment_id` to, for example, connect with your internal + resources or generate a session_id + 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` + to be aware which “session” this applies to 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied - 6. After the customer finishes 3DS authentication, we let you know the - result by making a request to applied `callback_url`. - 7. After that, we redirect the customer to the `redirect_url`; at this - point the result of authentication is known - 8. Optionally, you can use the applied "msg" param in the - `redirect_url` to determine whether it was successful or not. + 6. After the customer finishes 3DS authentication, we let you know the result + by making a request to applied `callback_url`. + 7. After that, we redirect the customer to the `redirect_url`; at this point + the result of authentication is known + 8. Optionally, you can use the applied "msg" param in the `redirect_url` to + determine whether it was successful or not. Args: - subscription_id (int): The Chargify id of the subscription - body (SubscriptionProductMigrationRequest, optional): The request - body parameter. + subscription_id (int): The Chargify id of the subscription. + body (SubscriptionProductMigrationRequest, optional): The request body + parameter. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/migrations.json') + .path("/subscriptions/{subscription_id}/migrations.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def preview_subscription_product_migration(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/migrations/preview.json. + """Perform a POST request to + /subscriptions/{subscription_id}/migrations/preview.json. ## Previewing a future date - It is also possible to preview the migration for a date in the future, - as long as it's still within the subscription's current billing - period, by passing a `proration_date` along with the request (eg: - `"proration_date": "2020-12-18T18:25:43.511Z"`). - This will calculate the prorated adjustment, charge, payment and - credit applied values assuming the migration is done at that date in - the future as opposed to right now. + It is also possible to preview the migration for a date in the future, as + long as it's still within the subscription's current billing period, by + passing a `proration_date` along with the request (eg: `"proration_date": + "2020-12-18T18:25:43.511Z"`). + This will calculate the prorated adjustment, charge, payment and credit + applied values assuming the migration is done at that date in the future as + opposed to right now. Args: - subscription_id (int): The Chargify id of the subscription - body (SubscriptionMigrationPreviewRequest, optional): The request - body parameter. + subscription_id (int): The Chargify id of the subscription. + body (SubscriptionMigrationPreviewRequest, optional): The request body + parameter. Returns: SubscriptionMigrationPreviewResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/migrations/preview.json') + .path("/subscriptions/{subscription_id}/migrations/preview.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionMigrationPreviewResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/controllers/subscription_renewals_controller.py b/advancedbilling/controllers/subscription_renewals_controller.py new file mode 100644 index 00000000..fed8d38f --- /dev/null +++ b/advancedbilling/controllers/subscription_renewals_controller.py @@ -0,0 +1,614 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) +from apimatic_core.request_builder import RequestBuilder +from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.parameter import Parameter + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.scheduled_renewal_configuration_item_response import ( + ScheduledRenewalConfigurationItemResponse, +) +from advancedbilling.models.scheduled_renewal_configuration_response import ( + ScheduledRenewalConfigurationResponse, +) +from advancedbilling.models.scheduled_renewal_configurations_response import ( + ScheduledRenewalConfigurationsResponse, +) + + +class SubscriptionRenewalsController(BaseController): + """A Controller to access Endpoints in the advancedbilling API.""" + + def __init__(self, config): + """Initialize SubscriptionRenewalsController object.""" + super(SubscriptionRenewalsController, self).__init__(config) + + def create_scheduled_renewal_configuration(self, + subscription_id, + body=None): + """Perform a POST request to + /subscriptions/{subscription_id}/scheduled_renewals.json. + + Creates a scheduled renewal configuration for a subscription. The scheduled + renewal is based on the subscription’s current product and component setup. + + Args: + subscription_id (int): The Chargify id of the subscription. + body (ScheduledRenewalConfigurationRequest, optional): The request body + parameter. + + Returns: + ScheduledRenewalConfigurationResponse: Response from the API. Created + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals.json") + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def list_scheduled_renewal_configurations(self, + subscription_id, + status=None): + """Perform a GET request to + /subscriptions/{subscription_id}/scheduled_renewals.json. + + Lists scheduled renewal configurations for the subscription and permits an + optional status query filter. + + Args: + subscription_id (int): The Chargify id of the subscription. + status (Status, optional): (Optional) Status filter for scheduled renewal + configurations. + + Returns: + ScheduledRenewalConfigurationsResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals.json") + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .query_param(Parameter() + .key("status") + .value(status)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationsResponse.from_dictionary), + ).execute() + + def read_scheduled_renewal_configuration(self, + subscription_id, + id): + """Perform a GET request to + /subscriptions/{subscription_id}/scheduled_renewals/{id}.json. + + Retrieves the configuration settings for the scheduled renewal. + + Args: + subscription_id (int): The Chargify id of the subscription. + id (int): The renewal id. + + Returns: + ScheduledRenewalConfigurationResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{id}.json") + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationResponse.from_dictionary), + ).execute() + + def update_scheduled_renewal_configuration(self, + subscription_id, + id, + body=None): + """Perform a PUT request to + /subscriptions/{subscription_id}/scheduled_renewals/{id}.json. + + Updates an existing configuration. + + Args: + subscription_id (int): The Chargify id of the subscription. + id (int): The renewal id. + body (ScheduledRenewalConfigurationRequest, optional): The request body + parameter. + + Returns: + ScheduledRenewalConfigurationResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{id}.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def schedule_scheduled_renewal_lock_in(self, + subscription_id, + id, + body=None): + """Perform a PUT request to + /subscriptions/{subscription_id}/scheduled_renewals/{id}/schedule_lock_in.json. + + Schedules a future lock-in date for the renewal. + + Args: + subscription_id (int): The Chargify id of the subscription. + id (int): The renewal id. + body (ScheduledRenewalLockInRequest, optional): The request body + parameter. + + Returns: + ScheduledRenewalConfigurationResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{id}/schedule_lock_in.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def lock_in_scheduled_renewal_immediately(self, + subscription_id, + id): + """Perform a PUT request to + /subscriptions/{subscription_id}/scheduled_renewals/{id}/immediate_lock_in.json + . + + Locks in the renewal immediately. + + Args: + subscription_id (int): The Chargify id of the subscription. + id (int): The renewal id. + + Returns: + ScheduledRenewalConfigurationResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{id}/immediate_lock_in.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def unpublish_scheduled_renewal_configuration(self, + subscription_id, + id): + """Perform a PUT request to + /subscriptions/{subscription_id}/scheduled_renewals/{id}/unpublish.json. + + Returns a scheduled renewal configuration to an editable state. + + Args: + subscription_id (int): The Chargify id of the subscription. + id (int): The renewal id. + + Returns: + ScheduledRenewalConfigurationResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{id}/unpublish.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def cancel_scheduled_renewal_configuration(self, + subscription_id, + id): + """Perform a PUT request to + /subscriptions/{subscription_id}/scheduled_renewals/{id}/cancel.json. + + Cancels a scheduled renewal configuration. + + Args: + subscription_id (int): The Chargify id of the subscription. + id (int): The renewal id. + + Returns: + ScheduledRenewalConfigurationResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{id}/cancel.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def create_scheduled_renewal_configuration_item(self, + subscription_id, + scheduled_renewals_configuration_id, + body=None): + """Perform a POST request to + /subscriptions/{subscription_id}/scheduled_renewals/{scheduled_renewals_configu + ration_id}/configuration_items.json. + + Adds product and component line items to the scheduled renewal. + + Args: + subscription_id (int): The Chargify id of the subscription. + scheduled_renewals_configuration_id (int): The scheduled renewal + configuration id. + body (ScheduledRenewalConfigurationItemRequest, optional): The request + body parameter. + + Returns: + ScheduledRenewalConfigurationItemResponse: Response from the API. Created + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{scheduled_renewals_configuration_id}/configuration_items.json") + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("scheduled_renewals_configuration_id") + .value(scheduled_renewals_configuration_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationItemResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def update_scheduled_renewal_configuration_item(self, + subscription_id, + scheduled_renewals_configuration_id, + id, + body=None): + """Perform a PUT request to + /subscriptions/{subscription_id}/scheduled_renewals/{scheduled_renewals_configu + ration_id}/configuration_items/{id}.json. + + Updates an existing configuration item’s pricing and quantity. + + Args: + subscription_id (int): The Chargify id of the subscription. + scheduled_renewals_configuration_id (int): The scheduled renewal + configuration id. + id (int): The scheduled renewal configuration item id. + body (ScheduledRenewalUpdateRequest, optional): The request body + parameter. + + Returns: + ScheduledRenewalConfigurationItemResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{scheduled_renewals_configuration_id}/configuration_items/{id}.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("scheduled_renewals_configuration_id") + .value(scheduled_renewals_configuration_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(ScheduledRenewalConfigurationItemResponse.from_dictionary) + .local_error("422", + "Unprocessable Entity (WebDAV)", + ErrorListResponseException), + ).execute() + + def delete_scheduled_renewal_configuration_item(self, + subscription_id, + scheduled_renewals_configuration_id, + id): + """Perform a DELETE request to + /subscriptions/{subscription_id}/scheduled_renewals/{scheduled_renewals_configu + ration_id}/configuration_items/{id}.json. + + Removes an item from the pending renewal configuration. + + Args: + subscription_id (int): The Chargify id of the subscription. + scheduled_renewals_configuration_id (int): The scheduled renewal + configuration id. + id (int): The scheduled renewal configuration item id. + + Returns: + void: Response from the API. No Content + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/scheduled_renewals/{scheduled_renewals_configuration_id}/configuration_items/{id}.json") + .http_method(HttpMethodEnum.DELETE) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("scheduled_renewals_configuration_id") + .value(scheduled_renewals_configuration_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("id") + .value(id) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), + ).execute() diff --git a/advancedbilling/controllers/subscription_status_controller.py b/advancedbilling/controllers/subscription_status_controller.py index 5d7297d2..70f98eb2 100644 --- a/advancedbilling/controllers/subscription_status_controller.py +++ b/advancedbilling/controllers/subscription_status_controller.py @@ -1,322 +1,351 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.subscription_response import SubscriptionResponse -from advancedbilling.models.delayed_cancellation_response import DelayedCancellationResponse -from advancedbilling.models.renewal_preview_response import RenewalPreviewResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.api_exception import APIException + +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.delayed_cancellation_response import ( + DelayedCancellationResponse, +) +from advancedbilling.models.renewal_preview_response import ( + RenewalPreviewResponse, +) +from advancedbilling.models.subscription_response import ( + SubscriptionResponse, +) class SubscriptionStatusController(BaseController): - """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionStatusController object.""" super(SubscriptionStatusController, self).__init__(config) def retry_subscription(self, subscription_id): - """Does a PUT request to /subscriptions/{subscription_id}/retry.json. + """Perform a PUT request to + /subscriptions/{subscription_id}/retry.json. - Advanced Billing offers the ability to retry collecting the balance - due on a past due Subscription without waiting for the next scheduled - attempt. + Advanced Billing offers the ability to retry collecting the balance due on a + past due Subscription without waiting for the next scheduled attempt. ## Successful Reactivation The response will be `200 OK` with the updated Subscription. ## Failed Reactivation The response will be `422 "Unprocessable Entity`. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/retry.json') + .path("/subscriptions/{subscription_id}/retry.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def cancel_subscription(self, subscription_id, body=None): - """Does a DELETE request to /subscriptions/{subscription_id}.json. + """Perform a DELETE request to /subscriptions/{subscription_id}.json. - The DELETE action causes the cancellation of the Subscription. This - means, the method sets the Subscription state to "canceled". + Cancels the Subscription. The Delete method sets the Subscription state to + `canceled`. + To cancel the subscription immediately, omit any schedule parameters from the + request. To use the schedule options, the Schedule Subscription Cancellation + feature must be enabled on your site. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (CancellationRequest, optional): The request body parameter. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}.json') + .path("/subscriptions/{subscription_id}.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + APIException), ).execute() def resume_subscription(self, subscription_id, - calendar_billing_resumption_charge='prorated'): - """Does a POST request to /subscriptions/{subscription_id}/resume.json. + calendar_billing_resumption_charge="prorated"): + """Perform a POST request to + /subscriptions/{subscription_id}/resume.json. - Resume a paused (on-hold) subscription. If the normal next renewal - date has not passed, the subscription will return to active and will - renew on that date. Otherwise, it will behave like a reactivation, - setting the billing date to 'now' and charging the subscriber. + Resume a paused (on-hold) subscription. If the normal next renewal date has + not passed, the subscription will return to active and will renew on that + date. Otherwise, it will behave like a reactivation, setting the billing + date to 'now' and charging the subscriber. Args: - subscription_id (int): The Chargify id of the subscription - calendar_billing_resumption_charge (ResumptionCharge, optional): - (For calendar billing subscriptions only) The way that the - resumed subscription's charge should be handled + subscription_id (int): The Chargify id of the subscription. + calendar_billing_resumption_charge (ResumptionCharge, optional): (For + calendar billing subscriptions only) The way that the resumed + subscription's charge should be handled. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/resume.json') + .path("/subscriptions/{subscription_id}/resume.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('calendar_billing[\'resumption_charge\']') - .value(calendar_billing_resumption_charge)) + .key("calendar_billing['resumption_charge']") + .value(calendar_billing_resumption_charge)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def pause_subscription(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/hold.json. + """Perform a POST request to + /subscriptions/{subscription_id}/hold.json. - This will place the subscription in the on_hold state and it will not - renew. + This will place the subscription in the on_hold state and it will not renew. ## Limitations - You may not place a subscription on hold if the `next_billing_at` date - is within 24 hours. + You may not place a subscription on hold if the `next_billing_at` date is + within 24 hours. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (PauseRequest, optional): The request body parameter. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/hold.json') + .path("/subscriptions/{subscription_id}/hold.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def update_automatic_subscription_resumption(self, subscription_id, body=None): - """Does a PUT request to /subscriptions/{subscription_id}/hold.json. + """Perform a PUT request to /subscriptions/{subscription_id}/hold.json. - Once a subscription has been paused / put on hold, you can update the - date which was specified to automatically resume the subscription. - To update a subscription's resume date, use this method to change or - update the `automatically_resume_at` date. + Once a subscription has been paused / put on hold, you can update the date + which was specified to automatically resume the subscription. + To update a subscription's resume date, use this method to change or update + the `automatically_resume_at` date. ### Remove the resume date - Alternately, you can change the `automatically_resume_at` to `null` if - you would like the subscription to not have a resume date. + Alternately, you can change the `automatically_resume_at` to `null` if you + would like the subscription to not have a resume date. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (PauseRequest, optional): The request body parameter. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/hold.json') + .path("/subscriptions/{subscription_id}/hold.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def reactivate_subscription(self, subscription_id, body=None): - """Does a PUT request to /subscriptions/{subscription_id}/reactivate.json. - - Advanced Billing offers the ability to reactivate a previously - canceled subscription. For details on how the reactivation works, and - how to reactivate subscriptions through the application, see - [reactivation](https://maxio.zendesk.com/hc/en-us/articles/242521095036 - 29-Reactivating-and-Resuming). - **Note: The term "resume" is used also during another process in - Advanced Billing. This occurs when an on-hold subscription is - "resumed". This returns the subscription to an active state.** - + The response returns the subscription object in the `active` or - `trialing` state. - + The `canceled_at` and `cancellation_message` fields do not have - values. + """Perform a PUT request to + /subscriptions/{subscription_id}/reactivate.json. + + Reactivate a previously canceled subscription. For details on how the + reactivation works, and how to reactivate subscriptions through the + application, see + [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reac + tivating-and-Resuming). + **Note: The term "resume" is used also during another process in Advanced + Billing. This occurs when an on-hold subscription is "resumed". This returns + the subscription to an active state.** + + The response returns the subscription object in the `active` or `trialing` + state. + + The `canceled_at` and `cancellation_message` fields do not have values. + The method works for "Canceled" or "Trial Ended" subscriptions. - + It will not work for items not marked as "Canceled", "Unpaid", or - "Trial Ended". + + It will not work for items not marked as "Canceled", "Unpaid", or "Trial + Ended". ## Resume the current billing period for a subscription - A subscription is considered "resumable" if you are attempting to - reactivate within the billing period the subscription was canceled in. - A resumed subscription's billing date remains the same as before it - was canceled. In other words, it does not start a new billing period. - Payment may or may not be collected for a resumed subscription, - depending on whether or not the subscription had a balance when it was - canceled (for example, if it was canceled because of dunning). - Consider a subscription which was created on June 1st, and would renew - on July 1st. The subscription is then canceled on June 15. - If a reactivation with `resume: true` were attempted _before_ what - would have been the next billing date of July 1st, then Advanced - Billing would resume the subscription. - If a reactivation with `resume: true` were attempted _after_ what - would have been the next billing date of July 1st, then Advanced - Billing would not resume the subscription, and instead it would be - reactivated with a new billing period. + A subscription is considered "resumable" if you are attempting to reactivate + within the billing period the subscription was canceled in. + A resumed subscription's billing date remains the same as before it was + canceled. In other words, it does not start a new billing period. Payment may + or may not be collected for a resumed subscription, depending on whether or + not the subscription had a balance when it was canceled (for example, if it + was canceled because of dunning). + Consider a subscription which was created on June 1st, and would renew on + July 1st. The subscription is then canceled on June 15. + If a reactivation with `resume: true` were attempted _before_ what would have + been the next billing date of July 1st, then Advanced Billing would resume + the subscription. + If a reactivation with `resume: true` were attempted _after_ what would have + been the next billing date of July 1st, then Advanced Billing would not + resume the subscription, and instead it would be reactivated with a new + billing period. + If a reactivation with `resume: false`, or where 'resume" is omited were + attempted, then Advanced Billing would reactivate the subscription with a new + billing period regardless of whether or not resuming the previous billing + period were possible. | Canceled | Reactivation | Resumable? | |---|---|---| | Jun 15 | June 28 | Yes | @@ -327,8 +356,8 @@ def reactivate_subscription(self, + Given you have a canceled subscription to the $20 product + 1 charge should exist for $20 + 1 payment should exist for $20 - + When the subscription has canceled due to dunning, it retained a - negative balance of $20 + + When the subscription has canceled due to dunning, it retained a negative + balance of $20 #### Results The resulting charges upon reactivation will be: + 1 charge for $20 for the new product @@ -342,8 +371,8 @@ def reactivate_subscription(self, + You have a coupon code "EARLYBIRD" + The coupon is set to recur for 6 periods PUT request sent to: - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son?coupon_code=EARLYBIRD` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?cou + pon_code=EARLYBIRD` #### Results + The subscription will transition to active + The subscription should have applied a coupon with code "EARLYBIRD" @@ -352,54 +381,50 @@ def reactivate_subscription(self, + Given you have a canceled subscription + The product associated with the subscription has a trial + PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` #### Results + The subscription will transition to active - ### Reactivating Canceled Subscription With Trial, With the - include_trial Flag + ### Reactivating Canceled Subscription With Trial, With the include_trial Flag + Given you have a canceled subscription + The product associated with the subscription has a trial + Send a PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son?include_trial=1` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?inc + lude_trial=1` #### Results + The subscription will transition to trialing ### Reactivating Trial Ended Subscription + Given you have a trial_ended subscription + Send a PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` #### Results + The subscription will transition to active ### Resuming a Canceled Subscription + Given you have a `canceled` subscription and it is resumable + Send a PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son?resume=true` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?res + ume=true` #### Results + The subscription will transition to active + The next billing date should not have changed ### Attempting to resume a subscription which is not resumable + Given you have a `canceled` subscription, and it is not resumable + Send a PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son?resume=true` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?res + ume=true` #### Results - + The subscription will transition to active, with a new billing - period. - ### Attempting to resume but not reactivate a subscription which is - not resumable + + The subscription will transition to active, with a new billing period. + ### Attempting to resume but not reactivate a subscription which is not + resumable + Given you have a `canceled` subscription, and it is not resumable + Send a PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son?resume[require_resume]=true` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?res + ume[require_resume]=true` + The response status should be "422 UNPROCESSABLE ENTITY" + The subscription should be canceled with the following response ``` { - "errors": ["Request was 'resume only', but this subscription - cannot be resumed."] + "errors": ["Request was 'resume only', but this subscription cannot be + resumed."] } ``` #### Results @@ -410,23 +435,23 @@ def reactivate_subscription(self, + And the subscription was canceled in the middle of a trial + And there is still time left on the trial + Send a PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son?resume=true` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?res + ume=true` #### Results + The subscription will transition to trialing + The next billing date should not have changed ### Resuming Subscription Which Was trial_ended + Given you have a `trial_ended` subscription, and it is resumable + Send a PUT request to - `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.j - son?resume=true` + `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?res + ume=true` #### Results + The subscription will transition to active + The next billing date should not have changed + Any product-related charges should have been collected Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (ReactivateSubscriptionRequest, optional): The request body parameter. @@ -434,255 +459,257 @@ def reactivate_subscription(self, SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/reactivate.json') + .path("/subscriptions/{subscription_id}/reactivate.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def initiate_delayed_cancellation(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/delayed_cancel.json. + """Perform a POST request to + /subscriptions/{subscription_id}/delayed_cancel.json. - Advanced Billing offers the ability to cancel a subscription at the - end of the current billing period. This period is set by its current - product. - Requesting to cancel the subscription at the end of the period sets - the `cancel_at_end_of_period` flag to true. - Note that you cannot set `cancel_at_end_of_period` at subscription - creation, or if the subscription is past due. + Cancels a subscription at the end of the current billing period based on the + subscription's current product. You cannot set `cancel_at_end_of_period` at + subscription creation, or if the subscription is past due. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (CancellationRequest, optional): The request body parameter. Returns: DelayedCancellationResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/delayed_cancel.json') + .path("/subscriptions/{subscription_id}/delayed_cancel.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(DelayedCancellationResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def cancel_delayed_cancellation(self, subscription_id): - """Does a DELETE request to /subscriptions/{subscription_id}/delayed_cancel.json. + """Perform a DELETE request to + /subscriptions/{subscription_id}/delayed_cancel.json. - Removing the delayed cancellation on a subscription will ensure that - it doesn't get canceled at the end of the period that it is in. The - request will reset the `cancel_at_end_of_period` flag to `false`. - This endpoint is idempotent. If the subscription was not set to cancel - in the future, removing the delayed cancellation has no effect and the - call will be successful. + Removing the delayed cancellation on a subscription will ensure that it + doesn't get canceled at the end of the period that it is in. The request will + reset the `cancel_at_end_of_period` flag to `false`. + This endpoint is idempotent. If the subscription was not set to cancel in the + future, removing the delayed cancellation has no effect and the call will be + successful. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: DelayedCancellationResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/delayed_cancel.json') + .path("/subscriptions/{subscription_id}/delayed_cancel.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(DelayedCancellationResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def cancel_dunning(self, subscription_id): - """Does a POST request to /subscriptions/{subscription_id}/cancel_dunning.json. + """Perform a POST request to + /subscriptions/{subscription_id}/cancel_dunning.json. - If a subscription is currently in dunning, the subscription will be - set to active and the active Dunner will be resolved. + If a subscription is currently in dunning, the subscription will be set to + active and the active Dunner will be resolved. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/cancel_dunning.json') + .path("/subscriptions/{subscription_id}/cancel_dunning.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def preview_renewal(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/renewals/preview.json. - - The Chargify API allows you to preview a renewal by posting to the - renewals endpoint. Renewal Preview is an object representing a - subscription’s next assessment. You can retrieve it to see a snapshot - of how much your customer will be charged on their next renewal. - The "Next Billing" amount and "Next Billing" date are already - represented in the UI on each Subscriber's Summary. For more - information, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subsc - riber-Interface-Overview). + """Perform a POST request to + /subscriptions/{subscription_id}/renewals/preview.json. + + The Chargify API allows you to preview a renewal by posting to the renewals + endpoint. Renewal Preview is an object representing a subscription’s next + assessment. You can retrieve it to see a snapshot of how much your customer + will be charged on their next renewal. + The "Next Billing" amount and "Next Billing" date are already represented in + the UI on each Subscriber's Summary. For more information, see our + documentation + [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-I + nterface-Overview). ## Optional Component Fields - This endpoint is particularly useful due to the fact that it will - return the computed billing amount for the base product and the - components which are in use by a subscriber. - By default, the preview will include billing details for all - components _at their **current** quantities_. This means: + This endpoint is particularly useful due to the fact that it will return the + computed billing amount for the base product and the components which are in + use by a subscriber. + By default, the preview will include billing details for all components _at + their **current** quantities_. This means: * Current `allocated_quantity` for quantity-based components * Current enabled/disabled status for on/off components * Current metered usage `unit_balance` for metered components - * Current metric quantity value for events recorded thus far for - events-based components - In the above statements, "current" means the quantity or value as of - the call to the renewal preview endpoint. We do not predict - end-of-period values for components, so metered or events-based usage - may be less than it will eventually be at the end of the period. - Optionally, **you may provide your own custom quantities** for any - component to see a billing preview for non-current quantities. This is - accomplished by sending a request body with data under the - `components` key. See the request body documentation below. + * Current metric quantity value for events recorded thus far for events-based + components + In the above statements, "current" means the quantity or value as of the call + to the renewal preview endpoint. We do not predict end-of-period values for + components, so metered or events-based usage may be less than it will + eventually be at the end of the period. + Optionally, **you may provide your own custom quantities** for any component + to see a billing preview for non-current quantities. This is accomplished by + sending a request body with data under the `components` key. See the request + body documentation below. ## Subscription Side Effects - You can request a `POST` to obtain this data from the endpoint without - any side effects. Plain and simple, this will preview data, not log - any changes against a subscription. + You can request a `POST` to obtain this data from the endpoint without any + side effects. This method allows you to preview data, but does not log any + changes against a subscription. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. body (RenewalPreviewRequest, optional): The request body parameter. Returns: RenewalPreviewResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/renewals/preview.json') + .path("/subscriptions/{subscription_id}/renewals/preview.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(RenewalPreviewResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/controllers/subscriptions_controller.py b/advancedbilling/controllers/subscriptions_controller.py index 3298084d..96542c5e 100644 --- a/advancedbilling/controllers/subscriptions_controller.py +++ b/advancedbilling/controllers/subscriptions_controller.py @@ -1,419 +1,419 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler +from apimatic_core.types.array_serialization_format import ( + SerializationFormats, +) from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.types.array_serialization_format import SerializationFormats -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.subscription_response import SubscriptionResponse -from advancedbilling.models.prepaid_configuration_response import PrepaidConfigurationResponse -from advancedbilling.models.subscription_preview_response import SubscriptionPreviewResponse -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.single_error_response_exception import SingleErrorResponseException -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.subscription_response_error_exception import SubscriptionResponseErrorException -from advancedbilling.exceptions.subscription_add_coupon_error_exception import SubscriptionAddCouponErrorException -from advancedbilling.exceptions.subscription_remove_coupon_errors_exception import SubscriptionRemoveCouponErrorsException -from advancedbilling.exceptions.error_array_map_response_exception import ErrorArrayMapResponseException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_array_map_response_exception import ( + ErrorArrayMapResponseException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.exceptions.subscription_add_coupon_error_exception import ( + SubscriptionAddCouponErrorException, +) +from advancedbilling.exceptions.subscription_remove_coupon_errors_exception import ( + SubscriptionRemoveCouponErrorsException, +) +from advancedbilling.exceptions.subscription_response_error_exception import ( + SubscriptionResponseErrorException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.prepaid_configuration_response import ( + PrepaidConfigurationResponse, +) +from advancedbilling.models.subscription_preview_response import ( + SubscriptionPreviewResponse, +) +from advancedbilling.models.subscription_response import ( + SubscriptionResponse, +) -class SubscriptionsController(BaseController): +class SubscriptionsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize SubscriptionsController object.""" super(SubscriptionsController, self).__init__(config) def create_subscription(self, body=None): - """Does a POST request to /subscriptions.json. + """Perform a POST request to /subscriptions.json. Creates a Subscription for a customer and product - Specify the product with `product_id` or `product_handle`. To set a - specific product pricepPoint, use `product_price_point_handle` or + Specify the product with `product_id` or `product_handle`. To set a specific + product pricepPoint, use `product_price_point_handle` or `product_price_point_id`. - Identify an existing customer with `customer_id` or - `customer_reference`. Optionally, include an existing payment profile - using `payment_profile_id`. To create a new customer, pass - customer_attributes. - Select an option from the **Request Examples** drop-down on the right - side of the portal to see examples of common scenarios for creating - subscriptions. - Payment information may be required to create a subscription, - depending on the options for the Product being subscribed. See - [product - options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-P - roducts) for more information. See the [Payments - Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for - details on payment parameters. - Do not use real card information for testing. See the Sites articles - that cover [testing your site - setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing- - Overview#testing-overview-0-0) for more details on testing in your - sandbox. - Note that collecting and sending raw card details in production - requires [PCI - compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI - -Compliance#pci-compliance-0-0) on your end. If your business is not - PCI compliant, use - [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C - hargify-js-Overview#chargify-js-overview-0-0) to collect credit card - or bank account information. + Identify an existing customer with `customer_id` or `customer_reference`. + Optionally, include an existing payment profile using `payment_profile_id`. + To create a new customer, pass customer_attributes. + Select an option from the **Request Examples** drop-down on the right side of + the portal to see examples of common scenarios for creating subscriptions. + Payment information may be required to create a subscription, depending on + the options for the Product being subscribed. See [product + options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products + ) for more information. See the [Payments + Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for details on + payment parameters. + Do not use real card information for testing. See the Sites articles that + cover [testing your site + setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overvie + w#testing-overview-0-0) for more details on testing in your sandbox. + Note that collecting and sending raw card details in production requires [PCI + compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compli + ance#pci-compliance-0-0) on your end. If your business is not PCI compliant, + use + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify + -js-Overview#chargify-js-overview-0-0) to collect credit card or bank account + information. See the [Subscription - Signups](page:introduction/basic-concepts/subscription-signup) article - for more information on working with subscriptions in Advanced Billing. + Signups](page:introduction/basic-concepts/subscription-signup) article for + more information on working with subscriptions in Advanced Billing. Args: - body (CreateSubscriptionRequest, optional): The request body - parameter. + body (CreateSubscriptionRequest, optional): The request body parameter. Returns: SubscriptionResponse: Response from the API. Created Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions.json') + .path("/subscriptions.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_subscriptions(self, options=dict()): - """Does a GET request to /subscriptions.json. + """Perform a GET request to /subscriptions.json. - This method will return an array of subscriptions from a Site. Pay - close attention to query string filters and pagination in order to - control responses from the server. + returns an array of subscriptions from a Site. Pay close attention to query + string filters and pagination in order to control responses from the server. ## Search for a subscription - Use the query strings below to search for a subscription using the - criteria available. The return value will be an array. + Use the query strings below to search for a subscription using the criteria + available. The return value will be an array. ## Self-Service Page token - Self-Service Page token for the subscriptions is not returned by - default. If this information is desired, the - include[]=self_service_page_token parameter must be provided with the - request. + Self-Service Page token for the subscriptions is not returned by default. If + this information is desired, the include[]=self_service_page_token parameter + must be provided with the request. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - state -- SubscriptionStateFilter -- The current state of - the subscription - product -- int -- The product id of the subscription. - (Note that the product handle cannot be used.) - product_price_point_id -- int -- The ID of the product - price point. If supplied, product is required - coupon -- int -- The numeric id of the coupon currently - applied to the subscription. (This can be found in the - URL when editing a coupon. Note that the coupon code - cannot be used.) - coupon_code -- str -- The coupon code currently applied to - the subscription - date_field -- SubscriptionDateField -- The type of filter - you'd like to apply to your search. Allowed Values: , - current_period_ends_at, current_period_starts_at, - created_at, activated_at, canceled_at, expires_at, - trial_started_at, trial_ended_at, updated_at - start_date -- date -- The start date (format YYYY-MM-DD) - with which to filter the date_field. Returns - subscriptions with a timestamp at or after midnight - (12:00:00 AM) in your site’s time zone on the date - specified. Use in query `start_date=2022-07-01`. - end_date -- date -- The end date (format YYYY-MM-DD) with - which to filter the date_field. Returns subscriptions - with a timestamp up to and including 11:59:59PM in - your site’s time zone on the date specified. Use in - query `end_date=2022-08-01`. - start_datetime -- datetime -- The start date and time - (format YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns subscriptions with a timestamp at - or after exact time provided in query. You can specify - timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used - instead of start_date. Use in query - `start_datetime=2022-07-01 09:00:05`. + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + state -- SubscriptionStateFilter -- The current state of the + subscription + product -- int -- The product id of the subscription. (Note that + the product handle cannot be used.) + product_price_point_id -- int -- The ID of the product price + point. If supplied, product is required + coupon -- int -- The numeric id of the coupon currently applied + to the subscription. (This can be found in the URL when + editing a coupon. Note that the coupon code cannot be used.) + coupon_code -- str -- The coupon code currently applied to the + subscription + date_field -- SubscriptionDateField -- The type of filter you'd + like to apply to your search. Allowed Values: , + current_period_ends_at, current_period_starts_at, created_at, + activated_at, canceled_at, expires_at, trial_started_at, + trial_ended_at, updated_at + start_date -- date -- The start date (format YYYY-MM-DD) with + which to filter the date_field. Returns subscriptions with a + timestamp at or after midnight (12:00:00 AM) in your site’s + time zone on the date specified. Use in query + `start_date=2022-07-01`. + end_date -- date -- The end date (format YYYY-MM-DD) with which + to filter the date_field. Returns subscriptions with a + timestamp up to and including 11:59:59PM in your site’s time + zone on the date specified. Use in query + `end_date=2022-08-01`. + start_datetime -- datetime -- The start date and time (format + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns subscriptions with a timestamp at or after exact time + provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of start_date. Use in + query `start_datetime=2022-07-01 09:00:05`. end_datetime -- datetime -- The end date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the - date_field. Returns subscriptions with a timestamp at - or before exact time provided in query. You can - specify timezone in query - otherwise your site's time - zone will be used. If provided, this parameter will be - used instead of end_date. Use in query + YYYY-MM-DD HH:MM:SS) with which to filter the date_field. + Returns subscriptions with a timestamp at or before exact + time provided in query. You can specify timezone in query - + otherwise your site's time zone will be used. If provided, + this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. - metadata -- Dict[str, str] -- The value of the metadata - field specified in the parameter. Use in query - `metadata[my-field]=value&metadata[other-field]=another - _value`. - direction -- SortingDirection -- Controls the order in - which results are returned. Use in query - `direction=asc`. + metadata -- Dict[str, str] -- The value of the metadata field + specified in the parameter. Use in query + `metadata[my-field]=value&metadata[other-field]=another_value` + . + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. sort -- SubscriptionSort -- The attribute by which to sort - include -- List[SubscriptionListInclude] -- Allows - including additional data in the response. Use in - query: `include[]=self_service_page_token`. + include -- List[SubscriptionListInclude] -- Allows including + additional data in the response. Use in query: + `include[]=self_service_page_token`. Returns: List[SubscriptionResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions.json') + .path("/subscriptions.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('state') - .value(options.get('state', None))) + .key("state") + .value(options.get("state", None))) .query_param(Parameter() - .key('product') - .value(options.get('product', None))) + .key("product") + .value(options.get("product", None))) .query_param(Parameter() - .key('product_price_point_id') - .value(options.get('product_price_point_id', None))) + .key("product_price_point_id") + .value(options.get("product_price_point_id", None))) .query_param(Parameter() - .key('coupon') - .value(options.get('coupon', None))) + .key("coupon") + .value(options.get("coupon", None))) .query_param(Parameter() - .key('coupon_code') - .value(options.get('coupon_code', None))) + .key("coupon_code") + .value(options.get("coupon_code", None))) .query_param(Parameter() - .key('date_field') - .value(options.get('date_field', None))) + .key("date_field") + .value(options.get("date_field", None))) .query_param(Parameter() - .key('start_date') - .value(options.get('start_date', None))) + .key("start_date") + .value(options.get("start_date", None))) .query_param(Parameter() - .key('end_date') - .value(options.get('end_date', None))) + .key("end_date") + .value(options.get("end_date", None))) .query_param(Parameter() - .key('start_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('start_datetime', None)))) + .key("start_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("start_datetime", None)))) .query_param(Parameter() - .key('end_datetime') - .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('end_datetime', None)))) + .key("end_datetime") + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, + options.get("end_datetime", None)))) .query_param(Parameter() - .key('metadata') - .value(options.get('metadata', None))) + .key("metadata") + .value(options.get("metadata", None))) .query_param(Parameter() - .key('direction') - .value(options.get('direction', None))) + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() - .key('sort') - .value(options.get('sort', None))) + .key("sort") + .value(options.get("sort", None))) .query_param(Parameter() - .key('include') - .value(options.get('include', None))) + .key("include") + .value(options.get("include", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.UN_INDEXED) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionResponse.from_dictionary) + .deserialize_into(SubscriptionResponse.from_dictionary), ).execute() def update_subscription(self, subscription_id, body=None): - """Does a PUT request to /subscriptions/{subscription_id}.json. + """Perform a PUT request to /subscriptions/{subscription_id}.json. Updates one or more attributes of a subscription. ## Update Subscription Payment Method - Change the card that your subscriber uses for their subscription. You - can also use this method to change the expiration date of the card - **if your gateway allows**. - Do not use real card information for testing. See the Sites articles - that cover [testing your site - setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing- - Overview#testing-overview-0-0) for more details on testing in your - sandbox. - Note that collecting and sending raw card details in production - requires [PCI - compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI - -Compliance#pci-compliance-0-0) on your end. If your business is not - PCI compliant, use - [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C - hargify-js-Overview#chargify-js-overview-0-0) to collect credit card - or bank account information. - > Note: Partial card updates for **Authorize.Net** are not allowed via - this endpoint. The existing Payment Profile must be directly updated - instead. + Change the card that your subscriber uses for their subscription. You can + also use this method to change the expiration date of the card **if your + gateway allows**. + Do not use real card information for testing. See the Sites articles that + cover [testing your site + setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overvie + w#testing-overview-0-0) for more details on testing in your sandbox. + Note that collecting and sending raw card details in production requires [PCI + compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compli + ance#pci-compliance-0-0) on your end. If your business is not PCI compliant, + use + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify + -js-Overview#chargify-js-overview-0-0) to collect credit card or bank account + information. + > Note: Partial card updates for **Authorize.Net** are not allowed via this + endpoint. The existing Payment Profile must be directly updated instead. ## Update Product - You also use this method to change the subscription to a different - product by setting a new value for product_handle. A product change - can be done in two different ways, **product change** or **delayed - product change**. + You also use this method to change the subscription to a different product by + setting a new value for product_handle. A product change can be done in two + different ways, **product change** or **delayed product change**. ### Product Change - You can change a subscription's product. The new payment amount is - calculated and charged at the normal start of the next period. If you - require complex product changes or prorated upgrades and downgrades - instead, please see the documentation on [Migrating Subscription - Products](https://docs.maxio.com/hc/en-us/articles/24252069837581-Produ - ct-Changes-and-Migrations#product-changes-and-migrations-0-0). - To perform a product change, set either the `product_handle` or - `product_id` attribute to that of a different product from the same - site as the subscription. You can also change the price point by - passing in either `product_price_point_id` or - `product_price_point_handle` - otherwise the new product's default - price point is used. + You can change a subscription's product. The new payment amount is calculated + and charged at the normal start of the next period. If you require complex + product changes or prorated upgrades and downgrades instead, please see the + documentation on [Migrating Subscription + Products](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Chan + ges-and-Migrations#product-changes-and-migrations-0-0). + To perform a product change, set either the `product_handle` or `product_id` + attribute to that of a different product from the same site as the + subscription. You can also change the price point by passing in either + `product_price_point_id` or `product_price_point_handle` - otherwise the new + product's default price point is used. ### Delayed Product Change - This method also changes the product and/or price point, and the new - payment amount is calculated and charged at the normal start of the - next period. - This method schedules the product change to happen automatically at - the subscription’s next renewal date. To perform a delayed product - change, set the `product_handle` attribute as you would in a regular - product change, but also set the `product_change_delayed` attribute to - `true`. No proration applies in this case. - You can also perform a delayed change to the price point by passing in - either `product_price_point_id` or `product_price_point_handle` - > **Note:** To cancel a delayed product change, set `next_product_id` - to an empty string. + This method also changes the product and/or price point, and the new payment + amount is calculated and charged at the normal start of the next period. + This method schedules the product change to happen automatically at the + subscription’s next renewal date. To perform a delayed product change, set + the `product_handle` attribute as you would in a regular product change, but + also set the `product_change_delayed` attribute to `true`. No proration + applies in this case. + You can also perform a delayed change to the price point by passing in either + `product_price_point_id` or `product_price_point_handle` + > **Note:** To cancel a delayed product change, set `next_product_id` to an + empty string. ## Billing Date Changes - You can update dates for a subscrption. + You can update dates for a subscrption. ### Regular Billing Date Changes - Send the `next_billing_at` to set the next billing date for the - subscription. After that date passes and the subscription is - processed, the following billing date will be set according to the - subscription's product period. - > Note: If you pass an invalid date, the correct date is automatically - set to he correct date. For example, if February 30 is passed, the - next billing would be set to March 2nd in a non-leap year. + Send the `next_billing_at` to set the next billing date for the subscription. + After that date passes and the subscription is processed, the following + billing date will be set according to the subscription's product period. + > Note: If you pass an invalid date, the correct date is automatically set to + he correct date. For example, if February 30 is passed, the next billing + would be set to March 2nd in a non-leap year. The server response will not return data under the key/value pair of - `next_billing_at`. View the key/value pair of `current_period_ends_at` - to verify that the `next_billing_at` date has been changed - successfully. + `next_billing_at`. View the key/value pair of `current_period_ends_at` to + verify that the `next_billing_at` date has been changed successfully. ### Calendar Billing and Snap Day Changes - For a subscription using Calendar Billing, setting the next billing - date is a bit different. Send the `snap_day` attribute to change the - calendar billing date for **a subscription using a product eligible - for calendar billing**. + For a subscription using Calendar Billing, setting the next billing date is a + bit different. Send the `snap_day` attribute to change the calendar billing + date for **a subscription using a product eligible for calendar billing**. > Note: If you change the product associated with a subscription that - contains a `snap_day` and immediately `READ/GET` the subscription - data, it will still contain original `snap_day`. The `snap_day`will - will reset to 'null on the next billing cycle. This is because a - product change is instantanous and only affects the product associated - with a subscription. + contains a `snap_day` and immediately `READ/GET` the subscription data, it + will still contain original `snap_day`. The `snap_day`will will reset to + 'null on the next billing cycle. This is because a product change is + instantanous and only affects the product associated with a subscription. Args: - subscription_id (int): The Chargify id of the subscription - body (UpdateSubscriptionRequest, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (UpdateSubscriptionRequest, optional): The request body parameter. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}.json') + .path("/subscriptions/{subscription_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def read_subscription(self, subscription_id, include=None): - """Does a GET request to /subscriptions/{subscription_id}.json. + """Perform a GET request to /subscriptions/{subscription_id}.json. - Use this endpoint to find subscription details. + Retrieves subscription details. ## Self-Service Page token - Self-Service Page token for the subscription is not returned by - default. If this information is desired, the - include[]=self_service_page_token parameter must be provided with the - request. + Self-Service Page token for the subscription is not returned by default. If + this information is desired, the include[]=self_service_page_token parameter + must be provided with the request. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. include (List[SubscriptionInclude], optional): Allows including additional data in the response. Use in query: `include[]=coupons&include[]=self_service_page_token`. @@ -422,113 +422,108 @@ def read_subscription(self, SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}.json') + .path("/subscriptions/{subscription_id}.json") .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('include') - .value(include)) + .key("include") + .value(include)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.UN_INDEXED) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionResponse.from_dictionary) + .deserialize_into(SubscriptionResponse.from_dictionary), ).execute() def override_subscription(self, subscription_id, body=None): - """Does a PUT request to /subscriptions/{subscription_id}/override.json. + """Perform a PUT request to + /subscriptions/{subscription_id}/override.json. - This API endpoint allows you to set certain subscription fields that - are usually managed for you automatically. Some of the fields can be - set via the normal Subscriptions Update API, but others can only be - set using this endpoint. + This API endpoint allows you to set certain subscription fields that are + usually managed for you automatically. Some of the fields can be set via the + normal Subscriptions Update API, but others can only be set using this + endpoint. This endpoint is provided for cases where you need to “align” Advanced - Billing data with data that happened in your system, perhaps before - you started using Advanced Billing. For example, you may choose to - import your historical subscription data, and would like the - activation and cancellation dates in Advanced Billing to match your - existing historical dates. Advanced Billing does not backfill - historical events (i.e. from the Events API), but some static data can - be changed via this API. - Why are some fields only settable from this endpoint, and not the - normal subscription create and update endpoints? Because we want users - of this endpoint to be aware that these fields are usually managed by - Advanced Billing, and using this API means **you are stepping out on - your own.** - Changing these fields will not affect any other attributes. For - example, adding an expiration date will not affect the next assessment - date on the subscription. + Billing data with data that happened in your system, perhaps before you + started using Advanced Billing. For example, you may choose to import your + historical subscription data, and would like the activation and cancellation + dates in Advanced Billing to match your existing historical dates. Advanced + Billing does not backfill historical events (i.e. from the Events API), but + some static data can be changed via this API. + Why are some fields only settable from this endpoint, and not the normal + subscription create and update endpoints? Because we want users of this + endpoint to be aware that these fields are usually managed by Advanced + Billing, and using this API means **you are stepping out on your own.** + Changing these fields will not affect any other attributes. For example, + adding an expiration date will not affect the next assessment date on the + subscription. If you regularly need to override the current_period_starts_at for new subscriptions, this can also be accomplished by setting both - `previous_billing_at` and `next_billing_at` at subscription creation. - See the documentation on [Importing - Subscriptions](./b3A6MTQxMDgzODg-create-subscription#subscriptions-impo - rt) for more information. + `previous_billing_at` and `next_billing_at` at subscription creation. See the + documentation on [Importing + Subscriptions](./b3A6MTQxMDgzODg-create-subscription#subscriptions-import) + for more information. ## Limitations When passing `current_period_starts_at` some validations are made: 1. The subscription needs to be unbilled (no statements or invoices). - 2. The value passed must be a valid date/time. We recommend using the - iso 8601 format. + 2. The value passed must be a valid date/time. We recommend using the iso + 8601 format. 3. The value passed must be before the current date/time. - If unpermitted parameters are sent, a 400 HTTP response is sent along - with a string giving the reason for the problem. + If unpermitted parameters are sent, a 400 HTTP response is sent along with a + string giving the reason for the problem. Args: - subscription_id (int): The Chargify id of the subscription - body (OverrideSubscriptionRequest, optional): Only these fields - are available to be set. + subscription_id (int): The Chargify id of the subscription. + body (OverrideSubscriptionRequest, optional): Only these fields are + available to be set. Returns: void: Response from the API. No Content Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/override.json') + .path("/subscriptions/{subscription_id}/override.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).execute() def find_subscription(self, reference=None): - """Does a GET request to /subscriptions/lookup.json. + """Perform a GET request to /subscriptions/lookup.json. Use this endpoint to find a subscription by its reference. @@ -539,357 +534,357 @@ def find_subscription(self, SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/lookup.json') + .path("/subscriptions/lookup.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('reference') - .value(reference)) + .key("reference") + .value(reference)) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException), ).execute() def purge_subscription(self, subscription_id, ack, cascade=None): - """Does a POST request to /subscriptions/{subscription_id}/purge.json. + """Perform a POST request to + /subscriptions/{subscription_id}/purge.json. For sites in test mode, you may purge individual subscriptions. - Provide the subscription ID in the url. To confirm, supply the - customer ID in the query string `ack` parameter. You may also delete - the customer record and/or payment profiles by passing `cascade` - parameters. For example, to delete just the customer record, the query - params would be: `?ack={customer_id}&cascade[]=customer` - If you need to remove subscriptions from a live site, contact support - to discuss your use case. + Provide the subscription ID in the url. To confirm, supply the customer ID + in the query string `ack` parameter. You may also delete the customer record + and/or payment profiles by passing `cascade` parameters. For example, to + delete just the customer record, the query params would be: + `?ack={customer_id}&cascade[]=customer` + If you need to remove subscriptions from a live site, contact support to + discuss your use case. ### Delete customer and payment profile The query params will be: `?ack={customer_id}&cascade[]=customer&cascade[]=payment_profile` Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. ack (int): id of the customer. - cascade (List[SubscriptionPurgeType], optional): Options are - "customer" or "payment_profile". Use in query: + cascade (List[SubscriptionPurgeType], optional): Options are "customer" + or "payment_profile". Use in query: `cascade[]=customer&cascade[]=payment_profile`. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/purge.json') + .path("/subscriptions/{subscription_id}/purge.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('ack') - .value(ack) - .is_required(True)) + .key("ack") + .value(ack) + .is_required(True)) .query_param(Parameter() - .key('cascade') - .value(cascade)) + .key("cascade") + .value(cascade)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .array_serialization_format(SerializationFormats.UN_INDEXED) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('400', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SubscriptionResponseErrorException) + .local_error_template("400", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SubscriptionResponseErrorException), ).execute() def update_prepaid_subscription_configuration(self, subscription_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/prepaid_configurations.json. + """Perform a POST request to + /subscriptions/{subscription_id}/prepaid_configurations.json. Use this endpoint to update a subscription's prepaid configuration. Args: - subscription_id (int): The Chargify id of the subscription - body (UpsertPrepaidConfigurationRequest, optional): The request - body parameter. + subscription_id (int): The Chargify id of the subscription. + body (UpsertPrepaidConfigurationRequest, optional): The request body + parameter. Returns: PrepaidConfigurationResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/prepaid_configurations.json') + .path("/subscriptions/{subscription_id}/prepaid_configurations.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(PrepaidConfigurationResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + APIException), ).execute() def preview_subscription(self, body=None): - """Does a POST request to /subscriptions/preview.json. - - The Chargify API allows you to preview a subscription by POSTing the - same JSON or XML as for a subscription creation. - The "Next Billing" amount and "Next Billing" date are represented in - each Subscriber's Summary. - A subscription will not be created by utilizing this endpoint; it is - meant to serve as a prediction. + """Perform a POST request to /subscriptions/preview.json. + + The Chargify API allows you to preview a subscription by POSTing the same + JSON or XML as for a subscription creation. + The "Next Billing" amount and "Next Billing" date are represented in each + Subscriber's Summary. + A subscription will not be created by utilizing this endpoint; it is meant to + serve as a prediction. For more information, see our documentation - [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subsc - riber-Interface-Overview). + [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-I + nterface-Overview). ## Taxable Subscriptions - This endpoint will preview taxes applicable to a purchase. In order - for taxes to be previewed, the following conditions must be met: + This endpoint will preview taxes applicable to a purchase. In order for taxes + to be previewed, the following conditions must be met: + Taxes must be configured on the subscription - + The preview must be for the purchase of a taxable product or - component, or combination of the two. - + The subscription payload must contain a full billing or shipping - address in order to calculate tax - For more information about creating taxable previews, see our - documentation guide on how to create [taxable - subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349 - 325-Taxes) - You do **not** need to include a card number to generate tax - information when you are previewing a subscription. However, when you - actually want to create the subscription, you must include the credit - card information if you want the billing address to be stored in - Advanced Billing. The billing address and the credit card information - are stored together within the payment profile object. Also, you may - not send a billing address to Advanced Billing without payment profile - information, as the address is stored on the card. - You can pass shipping and billing addresses and still decide not to - calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` - attribute. + + The preview must be for the purchase of a taxable product or component, or + combination of the two. + + The subscription payload must contain a full billing or shipping address in + order to calculate tax + For more information about creating taxable previews, see our documentation + guide on how to create [taxable + subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Tax + es) + You do **not** need to include a card number to generate tax information when + you are previewing a subscription. However, when you actually want to create + the subscription, you must include the credit card information if you want + the billing address to be stored in Advanced Billing. The billing address and + the credit card information are stored together within the payment profile + object. Also, you may not send a billing address to Advanced Billing without + payment profile information, as the address is stored on the card. + You can pass shipping and billing addresses and still decide not to calculate + taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions - If you'd like to calculate subscriptions that do not include tax you - may leave off the billing information. + If you'd like to calculate subscriptions that do not include tax you may + leave off the billing information. Args: - body (CreateSubscriptionRequest, optional): The request body - parameter. + body (CreateSubscriptionRequest, optional): The request body parameter. Returns: SubscriptionPreviewResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/preview.json') + .path("/subscriptions/preview.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(SubscriptionPreviewResponse.from_dictionary) + .deserialize_into(SubscriptionPreviewResponse.from_dictionary), ).execute() def apply_coupons_to_subscription(self, subscription_id, code=None, body=None): - """Does a POST request to /subscriptions/{subscription_id}/add_coupon.json. - - An existing subscription can accommodate multiple discounts/coupon - codes. This is only applicable if each coupon is stackable. For more - information on stackable coupons, we recommend reviewing our [coupon - documentation.](https://maxio.zendesk.com/hc/en-us/articles/24261259337 - 101-Coupons-and-Subscriptions#stackability-rules) + """Perform a POST request to + /subscriptions/{subscription_id}/add_coupon.json. + + An existing subscription can accommodate multiple discounts/coupon codes. + This is only applicable if each coupon is stackable. For more information on + stackable coupons, we recommend reviewing our [coupon + documentation.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Cou + pons-and-Subscriptions#stackability-rules) ## Query Parameters vs Request Body Parameters Passing in a coupon code as a query parameter will add the code to the subscription, completely replacing all existing coupon codes on the subscription. For this reason, using this query parameter on this endpoint has been - deprecated in favor of using the request body parameters as described - below. When passing in request body parameters, the list of coupon - codes will simply be added to any existing list of codes on the - subscription. + deprecated in favor of using the request body parameters as described below. + When passing in request body parameters, the list of coupon codes will simply + be added to any existing list of codes on the subscription. Args: - subscription_id (int): The Chargify id of the subscription - code (str, optional): A code for the coupon that would be applied - to a subscription + subscription_id (int): The Chargify id of the subscription. + code (str, optional): A code for the coupon that would be applied to a + subscription body (AddCouponsRequest, optional): The request body parameter. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/add_coupon.json') + .path("/subscriptions/{subscription_id}/add_coupon.json") .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .query_param(Parameter() - .key('code') - .value(code)) + .key("code") + .value(code)) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SubscriptionAddCouponErrorException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SubscriptionAddCouponErrorException), ).execute() def remove_coupon_from_subscription(self, subscription_id, coupon_code=None): - """Does a DELETE request to /subscriptions/{subscription_id}/remove_coupon.json. + """Perform a DELETE request to + /subscriptions/{subscription_id}/remove_coupon.json. Use this endpoint to remove a coupon from an existing subscription. - For more information on the expected behaviour of removing a coupon - from a subscription, See our documentation - [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coup - ons-and-Subscriptions#removing-a-coupon) + For more information on the expected behaviour of removing a coupon from a + subscription, See our documentation + [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and + -Subscriptions#removing-a-coupon) Args: - subscription_id (int): The Chargify id of the subscription + subscription_id (int): The Chargify id of the subscription. coupon_code (str, optional): The coupon code Returns: str: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/remove_coupon.json') + .path("/subscriptions/{subscription_id}/remove_coupon.json") .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .query_param(Parameter() - .key('coupon_code') - .value(coupon_code)) - .auth(Single('BasicAuth')) + .key("coupon_code") + .value(coupon_code)) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', SubscriptionRemoveCouponErrorsException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + SubscriptionRemoveCouponErrorsException), ).execute() def activate_subscription(self, subscription_id, body=None): - """Does a PUT request to /subscriptions/{subscription_id}/activate.json. - - Advanced Billing offers the ability to activate awaiting signup and - trialing subscriptions. This feature is only available on the - Relationship Invoicing architecture. Subscriptions in a group may not - be activated immediately. - For details on how the activation works, and how to activate - subscriptions through the application, see [activation](#). - The `revert_on_failure` parameter controls the behavior upon - activation failure. - - If set to `true` and something goes wrong i.e. payment fails, then - Advanced Billing will not change the subscription's state. The - subscription’s billing period will also remain the same. + """Perform a PUT request to + /subscriptions/{subscription_id}/activate.json. + + Advanced Billing offers the ability to activate awaiting signup and trialing + subscriptions. This feature is only available on the Relationship Invoicing + architecture. Subscriptions in a group may not be activated immediately. + For details on how the activation works, and how to activate subscriptions + through the application, see [activation](#). + The `revert_on_failure` parameter controls the behavior upon activation + failure. + - If set to `true` and something goes wrong i.e. payment fails, then Advanced + Billing will not change the subscription's state. The subscription’s billing + period will also remain the same. - If set to `false` and something goes wrong i.e. payment fails, then - Advanced Billing will continue through with the activation and enter - an end of life state. For trialing subscriptions, that will either be - trial ended (if the trial is no obligation), past due (if the trial - has an obligation), or canceled (if the site has no dunning strategy, - or has a strategy that says to cancel immediately). For awaiting - signup subscriptions, that will always be canceled. - The default activation failure behavior can be configured per - activation attempt, or you may set a default value under Config > - Settings > Subscription Activation Settings. + Advanced Billing will continue through with the activation and enter an end + of life state. For trialing subscriptions, that will either be trial ended + (if the trial is no obligation), past due (if the trial has an obligation), + or canceled (if the site has no dunning strategy, or has a strategy that says + to cancel immediately). For awaiting signup subscriptions, that will always + be canceled. + The default activation failure behavior can be configured per activation + attempt, or you may set a default value under Config > Settings > + Subscription Activation Settings. ## Activation Scenarios ### Activate Awaiting Signup subscription - Given you have a product without trial @@ -914,51 +909,51 @@ def activate_subscription(self, ``` ### Activate Trialing subscription You can read more about the behavior of trialing subscriptions - [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trial - ing-Subscriptions). - When the `revert_on_failure` parameter is set to `true`, the - subscription's state will remain as Trialing, we will void the invoice - from activation and return any prepayments and credits applied to the - invoice back to the subscription. + [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Sub + scriptions). + When the `revert_on_failure` parameter is set to `true`, the subscription's + state will remain as Trialing, we will void the invoice from activation and + return any prepayments and credits applied to the invoice back to the + subscription. Args: - subscription_id (int): The Chargify id of the subscription - body (ActivateSubscriptionRequest, optional): The request body - parameter. + subscription_id (int): The Chargify id of the subscription. + body (ActivateSubscriptionRequest, optional): The request body parameter. Returns: SubscriptionResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/activate.json') + .path("/subscriptions/{subscription_id}/activate.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) - .is_required(True) - .should_encode(True)) + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) - .local_error_template('400', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) + .local_error_template("400", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), ).execute() diff --git a/advancedbilling/controllers/webhooks_controller.py b/advancedbilling/controllers/webhooks_controller.py index b4452af1..1b1a0c5b 100644 --- a/advancedbilling/controllers/webhooks_controller.py +++ b/advancedbilling/controllers/webhooks_controller.py @@ -1,127 +1,140 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper -from advancedbilling.configuration import Server -from advancedbilling.controllers.base_controller import BaseController +# ruff: noqa: D410, E501, E101, D206 +from apimatic_core.authentication.multiple.single_auth import ( + Single, +) from apimatic_core.request_builder import RequestBuilder from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter -from advancedbilling.http.http_method_enum import HttpMethodEnum -from apimatic_core.authentication.multiple.single_auth import Single -from advancedbilling.models.webhook_response import WebhookResponse -from advancedbilling.models.enable_webhooks_response import EnableWebhooksResponse -from advancedbilling.models.replay_webhooks_response import ReplayWebhooksResponse -from advancedbilling.models.endpoint_response import EndpointResponse -from advancedbilling.models.endpoint import Endpoint -from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.api_helper import APIHelper +from advancedbilling.configuration import Server +from advancedbilling.controllers.base_controller import ( + BaseController, +) +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.exceptions.error_list_response_exception import ( + ErrorListResponseException, +) +from advancedbilling.http.http_method_enum import ( + HttpMethodEnum, +) +from advancedbilling.models.enable_webhooks_response import ( + EnableWebhooksResponse, +) +from advancedbilling.models.endpoint import ( + Endpoint, +) +from advancedbilling.models.endpoint_response import ( + EndpointResponse, +) +from advancedbilling.models.replay_webhooks_response import ( + ReplayWebhooksResponse, +) +from advancedbilling.models.webhook_response import ( + WebhookResponse, +) -class WebhooksController(BaseController): +class WebhooksController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" + def __init__(self, config): + """Initialize WebhooksController object.""" super(WebhooksController, self).__init__(config) def list_webhooks(self, options=dict()): - """Does a GET request to /webhooks.json. + """Perform a GET request to /webhooks.json. - Allows you to view a list of webhooks. You can pass query parameters - if you want to filter webhooks. See the + Allows you to view a list of webhooks. You can pass query parameters if you + want to filter webhooks. See the [Webhooks](page:introduction/webhooks/webhooks) documentation for more information. Args: - options (dict, optional): Key-value pairs for any of the - parameters to this API Endpoint. All parameters to the - endpoint are supplied through the dictionary with their names - being the key and their desired values being the value. A list - of parameters that can be used are:: - - status -- WebhookStatus -- Webhooks with matching status - would be returned. - since_date -- str -- Format YYYY-MM-DD. Returns Webhooks - with the created_at date greater than or equal to the - one specified. - until_date -- str -- Format YYYY-MM-DD. Returns Webhooks - with the created_at date less than or equal to the one - specified. - page -- int -- Result records are organized in pages. By - default, the first page of results is displayed. The - page parameter specifies a page number of results to - fetch. You can start navigating through the pages to - consume the results. You do this by passing in a page - parameter. Retrieve the next page by adding ?page=2 to - the query string. If there are no results to return, - then an empty result set will be returned. Use in - query `page=1`. - per_page -- int -- This parameter indicates how many - records to fetch in each request. Default value is 20. - The maximum allowed values is 200; any per_page value - over 200 will be changed to 200. Use in query - `per_page=200`. - order -- WebhookOrder -- The order in which the Webhooks - are returned. - subscription -- int -- The Advanced Billing id of a - subscription you'd like to filter for + options (dict, optional): Key-value pairs for any of the parameters to + this API Endpoint. All parameters to the endpoint are supplied + through the dictionary with their names being the key and their + desired values being the value. A list of parameters that can be used + are:: + status -- WebhookStatus -- Webhooks with matching status would be + returned. + since_date -- str -- Format YYYY-MM-DD. Returns Webhooks with the + created_at date greater than or equal to the one specified. + until_date -- str -- Format YYYY-MM-DD. Returns Webhooks with the + created_at date less than or equal to the one specified. + page -- int -- Result records are organized in pages. By default, + the first page of results is displayed. The page parameter + specifies a page number of results to fetch. You can start + navigating through the pages to consume the results. You do + this by passing in a page parameter. Retrieve the next page + by adding ?page=2 to the query string. If there are no + results to return, then an empty result set will be returned. + Use in query `page=1`. + per_page -- int -- This parameter indicates how many records to + fetch in each request. Default value is 20. The maximum + allowed values is 200; any per_page value over 200 will be + changed to 200. Use in query `per_page=200`. + order -- WebhookOrder -- The order in which the Webhooks are + returned. + subscription -- int -- The Advanced Billing id of a subscription + you'd like to filter for Returns: List[WebhookResponse]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/webhooks.json') + .path("/webhooks.json") .http_method(HttpMethodEnum.GET) .query_param(Parameter() - .key('status') - .value(options.get('status', None))) + .key("status") + .value(options.get("status", None))) .query_param(Parameter() - .key('since_date') - .value(options.get('since_date', None))) + .key("since_date") + .value(options.get("since_date", None))) .query_param(Parameter() - .key('until_date') - .value(options.get('until_date', None))) + .key("until_date") + .value(options.get("until_date", None))) .query_param(Parameter() - .key('page') - .value(options.get('page', None))) + .key("page") + .value(options.get("page", None))) .query_param(Parameter() - .key('per_page') - .value(options.get('per_page', None))) + .key("per_page") + .value(options.get("per_page", None))) .query_param(Parameter() - .key('order') - .value(options.get('order', None))) + .key("order") + .value(options.get("order", None))) .query_param(Parameter() - .key('subscription') - .value(options.get('subscription', None))) + .key("subscription") + .value(options.get("subscription", None))) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(WebhookResponse.from_dictionary) + .deserialize_into(WebhookResponse.from_dictionary), ).execute() def enable_webhooks(self, body=None): - """Does a PUT request to /webhooks/settings.json. + """Perform a PUT request to /webhooks/settings.json. Allows you to enable webhooks for your site @@ -132,41 +145,39 @@ def enable_webhooks(self, EnableWebhooksResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/webhooks/settings.json') + .path("/webhooks/settings.json") .http_method(HttpMethodEnum.PUT) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(EnableWebhooksResponse.from_dictionary) + .deserialize_into(EnableWebhooksResponse.from_dictionary), ).execute() def replay_webhooks(self, body=None): - """Does a POST request to /webhooks/replay.json. + """Perform a POST request to /webhooks/replay.json. - Replays webhooks. Posting to this endpoint does not immediately resend - the webhooks. They are added to a queue and sent as soon as possible, - depending on available system resources. You can submit an array of up - to 1000 webhook IDs in the replay request. + Replays webhooks. Posting to this endpoint does not immediately resend the + webhooks. They are added to a queue and sent as soon as possible, depending + on available system resources. You can submit an array of up to 1000 webhook + IDs in the replay request. Args: body (ReplayWebhooksRequest, optional): The request body parameter. @@ -175,42 +186,40 @@ def replay_webhooks(self, ReplayWebhooksResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/webhooks/replay.json') + .path("/webhooks/replay.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ReplayWebhooksResponse.from_dictionary) + .deserialize_into(ReplayWebhooksResponse.from_dictionary), ).execute() def create_endpoint(self, body=None): - """Does a POST request to /endpoints.json. + """Perform a POST request to /endpoints.json. - Creates an endpoint and assigns a list of webhooks subscriptions - (events) to it. + Creates an endpoint and assigns a list of webhooks subscriptions (events) to + it. See the [Webhooks - Reference](page:introduction/webhooks/webhooks-reference#events) page - for available events. + Reference](page:introduction/webhooks/webhooks-reference#events) page for + available events. Args: body (CreateOrUpdateEndpointRequest, optional): The request body @@ -220,36 +229,37 @@ def create_endpoint(self, EndpointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/endpoints.json') + .path("/endpoints.json") .http_method(HttpMethodEnum.POST) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(EndpointResponse.from_dictionary) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() def list_endpoints(self): - """Does a GET request to /endpoints.json. + """Perform a GET request to /endpoints.json. Returns created endpoints for a site. @@ -257,46 +267,43 @@ def list_endpoints(self): List[Endpoint]: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/endpoints.json') + .path("/endpoints.json") .http_method(HttpMethodEnum.GET) .header_param(Parameter() - .key('accept') - .value('application/json')) - .auth(Single('BasicAuth')) + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(Endpoint.from_dictionary) + .deserialize_into(Endpoint.from_dictionary), ).execute() def update_endpoint(self, endpoint_id, body=None): - """Does a PUT request to /endpoints/{endpoint_id}.json. - - Updates an Endpoint. You can change the `url` of your endpoint or the - list of `webhook_subscriptions` to which you are subscribed. See the - [Webhooks - Reference](page:introduction/webhooks/webhooks-reference#events) page - for available events. - Always send a complete list of events to which you want to subscribe. - Sending a PUT request for an existing endpoint with an empty list of + """Perform a PUT request to /endpoints/{endpoint_id}.json. + + Updates an Endpoint. You can change the `url` of your endpoint or the list of + `webhook_subscriptions` to which you are subscribed. See the [Webhooks + Reference](page:introduction/webhooks/webhooks-reference#events) page for + available events. + Always send a complete list of events to which you want to subscribe. Sending + a PUT request for an existing endpoint with an empty list of `webhook_subscriptions` will unsubscribe all events. If you want unsubscribe from a specific event, send a list of `webhook_subscriptions` without the specific event key. Args: - endpoint_id (int): The Advanced Billing id for the endpoint that - should be updated + endpoint_id (int): The Advanced Billing id for the endpoint that should + be updated body (CreateOrUpdateEndpointRequest, optional): The request body parameter. @@ -304,36 +311,37 @@ def update_endpoint(self, EndpointResponse: Response from the API. OK Raises: - APIException: When an error occurs while fetching the data from - the remote API. This exception includes the HTTP Response - code, an error message, and the HTTP body that was received in - the request. + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. """ - return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/endpoints/{endpoint_id}.json') + .path("/endpoints/{endpoint_id}.json") .http_method(HttpMethodEnum.PUT) .template_param(Parameter() - .key('endpoint_id') - .value(endpoint_id) - .is_required(True) - .should_encode(True)) + .key("endpoint_id") + .value(endpoint_id) + .is_required(True) + .should_encode(True)) .header_param(Parameter() - .key('Content-Type') - .value('application/json')) + .key("Content-Type") + .value("application/json")) .body_param(Parameter() - .value(body)) + .value(body)) .header_param(Parameter() - .key('accept') - .value('application/json')) + .key("accept") + .value("application/json")) .body_serializer(APIHelper.json_serialize) - .auth(Single('BasicAuth')) + .auth(Single("BasicAuth")), ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(EndpointResponse.from_dictionary) - .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) - .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorListResponseException) + .local_error_template("404", "Not Found:'{$response.body}'", APIException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), ).execute() diff --git a/advancedbilling/exceptions/__init__.py b/advancedbilling/exceptions/__init__.py index 0cf80bb3..872d5a85 100644 --- a/advancedbilling/exceptions/__init__.py +++ b/advancedbilling/exceptions/__init__.py @@ -1,26 +1,28 @@ +# ruff: noqa: D104 | Missing docstring in public package +# ruff: noqa: RUF022 | `__all__` is not sorted __all__ = [ - 'api_exception', - 'component_allocation_error_exception', - 'component_price_point_error_exception', - 'customer_error_response_exception', - 'error_array_map_response_exception', - 'error_list_response_exception', - 'error_string_map_response_exception', - 'event_based_billing_list_segments_errors_exception', - 'event_based_billing_segment_exception', - 'event_based_billing_segment_errors_exception', - 'product_price_point_error_response_exception', - 'proforma_bad_request_error_response_exception', - 'refund_prepayment_base_errors_response_exception', - 'single_error_response_exception', - 'single_string_error_response_exception', - 'subscription_add_coupon_error_exception', - 'subscription_component_allocation_error_exception', - 'subscription_group_create_error_response_exception', - 'subscription_group_signup_error_response_exception', - 'subscription_group_update_error_response_exception', - 'subscription_remove_coupon_errors_exception', - 'subscription_response_error_exception', - 'subscriptions_mrr_error_response_exception', - 'too_many_management_link_requests_error_exception', + "api_exception", + "component_allocation_error_exception", + "component_price_point_error_exception", + "customer_error_response_exception", + "error_array_map_response_exception", + "error_list_response_exception", + "error_string_map_response_exception", + "event_based_billing_list_segments_errors_exception", + "event_based_billing_segment_errors_exception", + "event_based_billing_segment_exception", + "product_price_point_error_response_exception", + "proforma_bad_request_error_response_exception", + "refund_prepayment_base_errors_response_exception", + "single_error_response_exception", + "single_string_error_response_exception", + "subscription_add_coupon_error_exception", + "subscription_component_allocation_error_exception", + "subscription_group_create_error_response_exception", + "subscription_group_signup_error_response_exception", + "subscription_group_update_error_response_exception", + "subscription_remove_coupon_errors_exception", + "subscription_response_error_exception", + "subscriptions_mrr_error_response_exception", + "too_many_management_link_requests_error_exception", ] diff --git a/advancedbilling/exceptions/api_exception.py b/advancedbilling/exceptions/api_exception.py index 0d5b71cc..6aab9b7e 100644 --- a/advancedbilling/exceptions/api_exception.py +++ b/advancedbilling/exceptions/api_exception.py @@ -1,7 +1,4 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). @@ -9,7 +6,6 @@ class APIException(Exception): - """Class that handles HTTP Exceptions when fetching API Endpoints. Attributes: @@ -21,7 +17,7 @@ class APIException(Exception): def __init__(self, reason, response): - """Constructor for the APIException class + """Initialize APIException object. Args: reason (string): The reason (or error message) for the Exception @@ -35,6 +31,7 @@ def __init__(self, self.response_code = response.status_code def __str__(self): - return (f'{self.__class__.__name__}(' - f'status_code={self.response_code!s}, ' - f'message={self.reason!s})') + """Return a human-readable string representation.""" + return (f"{self.__class__.__name__}(" + f"status_code={self.response_code!s}, " + f"message={self.reason!s})") diff --git a/advancedbilling/exceptions/component_allocation_error_exception.py b/advancedbilling/exceptions/component_allocation_error_exception.py index 9303586d..0bad5ac3 100644 --- a/advancedbilling/exceptions/component_allocation_error_exception.py +++ b/advancedbilling/exceptions/component_allocation_error_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.component_allocation_error_item import ComponentAllocationErrorItem +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.component_allocation_error_item import ( + ComponentAllocationErrorItem, +) class ComponentAllocationErrorException(APIException): def __init__(self, reason, response): - """Constructor for the ComponentAllocationErrorException class + """Initialize ComponentAllocationErrorException object. Args: reason (string): The reason (or error message) for the Exception @@ -28,7 +30,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -37,13 +39,27 @@ def unbox(self, dictionary): """ self.errors = None - if dictionary.get('errors') is not None: - self.errors = [ComponentAllocationErrorItem.from_dictionary(x) for x in dictionary.get('errors')] + if dictionary.get("errors") is not None: + self.errors = [ + ComponentAllocationErrorItem.from_dictionary(x) + for x in dictionary.get("errors") + ] else: self.errors = None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/component_price_point_error_exception.py b/advancedbilling/exceptions/component_price_point_error_exception.py index 07c004b9..c7ed701d 100644 --- a/advancedbilling/exceptions/component_price_point_error_exception.py +++ b/advancedbilling/exceptions/component_price_point_error_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.component_price_point_error_item import ComponentPricePointErrorItem +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.component_price_point_error_item import ( + ComponentPricePointErrorItem, +) class ComponentPricePointErrorException(APIException): def __init__(self, reason, response): - """Constructor for the ComponentPricePointErrorException class + """Initialize ComponentPricePointErrorException object. Args: reason (string): The reason (or error message) for the Exception @@ -28,7 +30,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -37,13 +39,27 @@ def unbox(self, dictionary): """ self.errors = None - if dictionary.get('errors') is not None: - self.errors = [ComponentPricePointErrorItem.from_dictionary(x) for x in dictionary.get('errors')] + if dictionary.get("errors") is not None: + self.errors = [ + ComponentPricePointErrorItem.from_dictionary(x) + for x in dictionary.get("errors") + ] else: self.errors = None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/customer_error_response_exception.py b/advancedbilling/exceptions/customer_error_response_exception.py index a86904ef..707f1025 100644 --- a/advancedbilling/exceptions/customer_error_response_exception.py +++ b/advancedbilling/exceptions/customer_error_response_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class CustomerErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the CustomerErrorResponseException class + """Initialize CustomerErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +36,26 @@ def unbox(self, dictionary): """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - self.errors = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CustomerErrorResponseErrors'), dictionary.get('errors'), False) if dictionary.get('errors') is not None else None + self.errors = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CustomerErrorResponseErrors"), + dictionary.get("errors"), + False)\ + if dictionary.get("errors") is not None\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/error_array_map_response_exception.py b/advancedbilling/exceptions/error_array_map_response_exception.py index fbdd7319..395a3dd7 100644 --- a/advancedbilling/exceptions/error_array_map_response_exception.py +++ b/advancedbilling/exceptions/error_array_map_response_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class ErrorArrayMapResponseException(APIException): def __init__(self, reason, response): - """Constructor for the ErrorArrayMapResponseException class + """Initialize ErrorArrayMapResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,10 +35,24 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = dictionary.get("errors") if dictionary.get("errors") else None + self.errors =\ + dictionary.get("errors")\ + if dictionary.get("errors")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/error_list_response_exception.py b/advancedbilling/exceptions/error_list_response_exception.py index ba2fb0a5..a3602fed 100644 --- a/advancedbilling/exceptions/error_list_response_exception.py +++ b/advancedbilling/exceptions/error_list_response_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class ErrorListResponseException(APIException): def __init__(self, reason, response): - """Constructor for the ErrorListResponseException class + """Initialize ErrorListResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,10 +35,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = dictionary.get("errors") if dictionary.get("errors") else None + self.errors =\ + dictionary.get("errors")\ + if dictionary.get("errors")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={self.errors!s})') + """Return a human-readable string representation.""" + _errors=self.errors + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/error_string_map_response_exception.py b/advancedbilling/exceptions/error_string_map_response_exception.py index ecdbf417..6c0ecbfb 100644 --- a/advancedbilling/exceptions/error_string_map_response_exception.py +++ b/advancedbilling/exceptions/error_string_map_response_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class ErrorStringMapResponseException(APIException): def __init__(self, reason, response): - """Constructor for the ErrorStringMapResponseException class + """Initialize ErrorStringMapResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,10 +35,24 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = dictionary.get("errors") if dictionary.get("errors") else None + self.errors =\ + dictionary.get("errors")\ + if dictionary.get("errors")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/event_based_billing_list_segments_errors_exception.py b/advancedbilling/exceptions/event_based_billing_list_segments_errors_exception.py index 6f641797..c7fd1a62 100644 --- a/advancedbilling/exceptions/event_based_billing_list_segments_errors_exception.py +++ b/advancedbilling/exceptions/event_based_billing_list_segments_errors_exception.py @@ -1,20 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) from advancedbilling.models.errors import Errors class EventBasedBillingListSegmentsErrorsException(APIException): def __init__(self, reason, response): - """Constructor for the EventBasedBillingListSegmentsErrorsException class + """Initialize EventBasedBillingListSegmentsErrorsException object. Args: reason (string): The reason (or error message) for the Exception @@ -22,13 +22,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(EventBasedBillingListSegmentsErrorsException, self).__init__(reason, response) + super(EventBasedBillingListSegmentsErrorsException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +37,25 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = Errors.from_dictionary(dictionary.get('errors')) if 'errors' in dictionary.keys() else None + self.errors =\ + Errors.from_dictionary( + dictionary.get("errors"))\ + if "errors" in dictionary.keys()\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/event_based_billing_segment_errors_exception.py b/advancedbilling/exceptions/event_based_billing_segment_errors_exception.py index 9c3e3970..f2b88af6 100644 --- a/advancedbilling/exceptions/event_based_billing_segment_errors_exception.py +++ b/advancedbilling/exceptions/event_based_billing_segment_errors_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class EventBasedBillingSegmentErrorsException(APIException): def __init__(self, reason, response): - """Constructor for the EventBasedBillingSegmentErrorsException class + """Initialize EventBasedBillingSegmentErrorsException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,10 +35,24 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = dictionary.get("errors") if dictionary.get("errors") else None + self.errors =\ + dictionary.get("errors")\ + if dictionary.get("errors")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/event_based_billing_segment_exception.py b/advancedbilling/exceptions/event_based_billing_segment_exception.py index b5b00dad..7b61ee24 100644 --- a/advancedbilling/exceptions/event_based_billing_segment_exception.py +++ b/advancedbilling/exceptions/event_based_billing_segment_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.event_based_billing_segment_error import EventBasedBillingSegmentError +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.event_based_billing_segment_error import ( + EventBasedBillingSegmentError, +) class EventBasedBillingSegmentException(APIException): def __init__(self, reason, response): - """Constructor for the EventBasedBillingSegmentException class + """Initialize EventBasedBillingSegmentException object. Args: reason (string): The reason (or error message) for the Exception @@ -28,7 +30,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +38,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = EventBasedBillingSegmentError.from_dictionary(dictionary.get('errors')) if dictionary.get('errors') else None + self.errors =\ + EventBasedBillingSegmentError.from_dictionary( + dictionary.get("errors"))\ + if dictionary.get("errors") else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={self.errors!s})') + """Return a human-readable string representation.""" + _errors=self.errors + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/product_price_point_error_response_exception.py b/advancedbilling/exceptions/product_price_point_error_response_exception.py index 17762f09..0eecc86a 100644 --- a/advancedbilling/exceptions/product_price_point_error_response_exception.py +++ b/advancedbilling/exceptions/product_price_point_error_response_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.product_price_point_errors import ProductPricePointErrors +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.product_price_point_errors import ( + ProductPricePointErrors, +) class ProductPricePointErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the ProductPricePointErrorResponseException class + """Initialize ProductPricePointErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -28,7 +30,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +38,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = ProductPricePointErrors.from_dictionary(dictionary.get('errors')) if dictionary.get('errors') else None + self.errors =\ + ProductPricePointErrors.from_dictionary( + dictionary.get("errors"))\ + if dictionary.get("errors") else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={self.errors!s})') + """Return a human-readable string representation.""" + _errors=self.errors + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/proforma_bad_request_error_response_exception.py b/advancedbilling/exceptions/proforma_bad_request_error_response_exception.py index def1c866..7dc472fa 100644 --- a/advancedbilling/exceptions/proforma_bad_request_error_response_exception.py +++ b/advancedbilling/exceptions/proforma_bad_request_error_response_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.proforma_error import ProformaError +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.proforma_error import ( + ProformaError, +) class ProformaBadRequestErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the ProformaBadRequestErrorResponseException class + """Initialize ProformaBadRequestErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -22,13 +24,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(ProformaBadRequestErrorResponseException, self).__init__(reason, response) + super(ProformaBadRequestErrorResponseException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +39,25 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = ProformaError.from_dictionary(dictionary.get('errors')) if 'errors' in dictionary.keys() else None + self.errors =\ + ProformaError.from_dictionary( + dictionary.get("errors"))\ + if "errors" in dictionary.keys()\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/refund_prepayment_base_errors_response_exception.py b/advancedbilling/exceptions/refund_prepayment_base_errors_response_exception.py index bff054b1..f8914fb3 100644 --- a/advancedbilling/exceptions/refund_prepayment_base_errors_response_exception.py +++ b/advancedbilling/exceptions/refund_prepayment_base_errors_response_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.refund_prepayment_base_refund_error import RefundPrepaymentBaseRefundError +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.refund_prepayment_base_refund_error import ( + RefundPrepaymentBaseRefundError, +) class RefundPrepaymentBaseErrorsResponseException(APIException): def __init__(self, reason, response): - """Constructor for the RefundPrepaymentBaseErrorsResponseException class + """Initialize RefundPrepaymentBaseErrorsResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -22,13 +24,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(RefundPrepaymentBaseErrorsResponseException, self).__init__(reason, response) + super(RefundPrepaymentBaseErrorsResponseException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +39,25 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = RefundPrepaymentBaseRefundError.from_dictionary(dictionary.get('errors')) if 'errors' in dictionary.keys() else None + self.errors =\ + RefundPrepaymentBaseRefundError.from_dictionary( + dictionary.get("errors"))\ + if "errors" in dictionary.keys()\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/single_error_response_exception.py b/advancedbilling/exceptions/single_error_response_exception.py index 5dbf32da..975e359d 100644 --- a/advancedbilling/exceptions/single_error_response_exception.py +++ b/advancedbilling/exceptions/single_error_response_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class SingleErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the SingleErrorResponseException class + """Initialize SingleErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,10 +35,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.error = dictionary.get("error") if dictionary.get("error") else None + self.error =\ + dictionary.get("error")\ + if dictionary.get("error")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'error={self.error!s})') + """Return a human-readable string representation.""" + _error=self.error + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"error={_error!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/single_string_error_response_exception.py b/advancedbilling/exceptions/single_string_error_response_exception.py index 8d15e27f..f83f0ff8 100644 --- a/advancedbilling/exceptions/single_string_error_response_exception.py +++ b/advancedbilling/exceptions/single_string_error_response_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class SingleStringErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the SingleStringErrorResponseException class + """Initialize SingleStringErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,10 +35,24 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = dictionary.get("errors") if dictionary.get("errors") else None + self.errors =\ + dictionary.get("errors")\ + if dictionary.get("errors")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscription_add_coupon_error_exception.py b/advancedbilling/exceptions/subscription_add_coupon_error_exception.py index 41c9fad6..0ce7a3f2 100644 --- a/advancedbilling/exceptions/subscription_add_coupon_error_exception.py +++ b/advancedbilling/exceptions/subscription_add_coupon_error_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class SubscriptionAddCouponErrorException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionAddCouponErrorException class + """Initialize SubscriptionAddCouponErrorException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,16 +35,54 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.codes = dictionary.get("codes") if dictionary.get("codes") else None - self.coupon_code = dictionary.get("coupon_code") if dictionary.get("coupon_code") else None - self.coupon_codes = dictionary.get("coupon_codes") if dictionary.get("coupon_codes") else None - self.subscription = dictionary.get("subscription") if dictionary.get("subscription") else None + self.codes =\ + dictionary.get("codes")\ + if dictionary.get("codes")\ + else None + self.coupon_code =\ + dictionary.get("coupon_code")\ + if dictionary.get("coupon_code")\ + else None + self.coupon_codes =\ + dictionary.get("coupon_codes")\ + if dictionary.get("coupon_codes")\ + else None + self.subscription =\ + dictionary.get("subscription")\ + if dictionary.get("subscription")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'codes={(self.codes if hasattr(self, "codes") else None)!s}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!s}, ' - f'coupon_codes={(self.coupon_codes if hasattr(self, "coupon_codes") else None)!s}, ' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!s})') + """Return a human-readable string representation.""" + _codes=( + self.codes + if hasattr(self, "codes") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _coupon_codes=( + self.coupon_codes + if hasattr(self, "coupon_codes") + else None + ) + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"codes={_codes!s}, " + f"coupon_code={_coupon_code!s}, " + f"coupon_codes={_coupon_codes!s}, " + f"subscription={_subscription!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscription_component_allocation_error_exception.py b/advancedbilling/exceptions/subscription_component_allocation_error_exception.py index 5d452e0f..973f91a3 100644 --- a/advancedbilling/exceptions/subscription_component_allocation_error_exception.py +++ b/advancedbilling/exceptions/subscription_component_allocation_error_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.subscription_component_allocation_error_item import SubscriptionComponentAllocationErrorItem +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.subscription_component_allocation_error_item import ( + SubscriptionComponentAllocationErrorItem, +) class SubscriptionComponentAllocationErrorException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionComponentAllocationErrorException class + """Initialize SubscriptionComponentAllocationErrorException object. Args: reason (string): The reason (or error message) for the Exception @@ -22,13 +24,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(SubscriptionComponentAllocationErrorException, self).__init__(reason, response) + super(SubscriptionComponentAllocationErrorException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -37,13 +40,27 @@ def unbox(self, dictionary): """ self.errors = None - if dictionary.get('errors') is not None: - self.errors = [SubscriptionComponentAllocationErrorItem.from_dictionary(x) for x in dictionary.get('errors')] + if dictionary.get("errors") is not None: + self.errors = [ + SubscriptionComponentAllocationErrorItem.from_dictionary(x) + for x in dictionary.get("errors") + ] else: self.errors = None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscription_group_create_error_response_exception.py b/advancedbilling/exceptions/subscription_group_create_error_response_exception.py index 24a46d6f..4cfbc614 100644 --- a/advancedbilling/exceptions/subscription_group_create_error_response_exception.py +++ b/advancedbilling/exceptions/subscription_group_create_error_response_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class SubscriptionGroupCreateErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionGroupCreateErrorResponseException class + """Initialize SubscriptionGroupCreateErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -21,13 +21,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(SubscriptionGroupCreateErrorResponseException, self).__init__(reason, response) + super(SubscriptionGroupCreateErrorResponseException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +37,22 @@ def unbox(self, dictionary): """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - self.errors = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupCreateErrorResponseErrors'), dictionary.get('errors'), False) if dictionary.get('errors') is not None else None + self.errors = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupCreateErrorResponseErrors"), + dictionary.get("errors"), + False)\ + if dictionary.get("errors") is not None\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={self.errors!s})') + """Return a human-readable string representation.""" + _errors=self.errors + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscription_group_signup_error_response_exception.py b/advancedbilling/exceptions/subscription_group_signup_error_response_exception.py index 36b77bf0..3485bbb3 100644 --- a/advancedbilling/exceptions/subscription_group_signup_error_response_exception.py +++ b/advancedbilling/exceptions/subscription_group_signup_error_response_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.subscription_group_signup_error import SubscriptionGroupSignupError +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.subscription_group_signup_error import ( + SubscriptionGroupSignupError, +) class SubscriptionGroupSignupErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionGroupSignupErrorResponseException class + """Initialize SubscriptionGroupSignupErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -22,13 +24,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(SubscriptionGroupSignupErrorResponseException, self).__init__(reason, response) + super(SubscriptionGroupSignupErrorResponseException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +39,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = SubscriptionGroupSignupError.from_dictionary(dictionary.get('errors')) if dictionary.get('errors') else None + self.errors =\ + SubscriptionGroupSignupError.from_dictionary( + dictionary.get("errors"))\ + if dictionary.get("errors") else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={self.errors!s})') + """Return a human-readable string representation.""" + _errors=self.errors + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscription_group_update_error_response_exception.py b/advancedbilling/exceptions/subscription_group_update_error_response_exception.py index f188c661..aa9be5a9 100644 --- a/advancedbilling/exceptions/subscription_group_update_error_response_exception.py +++ b/advancedbilling/exceptions/subscription_group_update_error_response_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.subscription_group_update_error import SubscriptionGroupUpdateError +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.subscription_group_update_error import ( + SubscriptionGroupUpdateError, +) class SubscriptionGroupUpdateErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionGroupUpdateErrorResponseException class + """Initialize SubscriptionGroupUpdateErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -22,13 +24,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(SubscriptionGroupUpdateErrorResponseException, self).__init__(reason, response) + super(SubscriptionGroupUpdateErrorResponseException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +39,25 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = SubscriptionGroupUpdateError.from_dictionary(dictionary.get('errors')) if 'errors' in dictionary.keys() else None + self.errors =\ + SubscriptionGroupUpdateError.from_dictionary( + dictionary.get("errors"))\ + if "errors" in dictionary.keys()\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={(self.errors if hasattr(self, "errors") else None)!s})') + """Return a human-readable string representation.""" + _errors=( + self.errors + if hasattr(self, "errors") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscription_remove_coupon_errors_exception.py b/advancedbilling/exceptions/subscription_remove_coupon_errors_exception.py index df83c319..d44db1a7 100644 --- a/advancedbilling/exceptions/subscription_remove_coupon_errors_exception.py +++ b/advancedbilling/exceptions/subscription_remove_coupon_errors_exception.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.api_exception import ( + APIException, +) class SubscriptionRemoveCouponErrorsException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionRemoveCouponErrorsException class + """Initialize SubscriptionRemoveCouponErrorsException object. Args: reason (string): The reason (or error message) for the Exception @@ -27,7 +27,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -35,10 +35,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.subscription = dictionary.get("subscription") if dictionary.get("subscription") else None + self.subscription =\ + dictionary.get("subscription")\ + if dictionary.get("subscription")\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'subscription={self.subscription!s})') + """Return a human-readable string representation.""" + _subscription=self.subscription + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"subscription={_subscription!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscription_response_error_exception.py b/advancedbilling/exceptions/subscription_response_error_exception.py index e571009e..5a351e77 100644 --- a/advancedbilling/exceptions/subscription_response_error_exception.py +++ b/advancedbilling/exceptions/subscription_response_error_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.subscription import Subscription +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.subscription import ( + Subscription, +) class SubscriptionResponseErrorException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionResponseErrorException class + """Initialize SubscriptionResponseErrorException object. Args: reason (string): The reason (or error message) for the Exception @@ -28,7 +30,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +38,25 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.subscription = Subscription.from_dictionary(dictionary.get('subscription')) if 'subscription' in dictionary.keys() else None + self.subscription =\ + Subscription.from_dictionary( + dictionary.get("subscription"))\ + if "subscription" in dictionary.keys()\ + else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!s})') + """Return a human-readable string representation.""" + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"subscription={_subscription!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/subscriptions_mrr_error_response_exception.py b/advancedbilling/exceptions/subscriptions_mrr_error_response_exception.py index ec5a3c74..e543c13c 100644 --- a/advancedbilling/exceptions/subscriptions_mrr_error_response_exception.py +++ b/advancedbilling/exceptions/subscriptions_mrr_error_response_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.attribute_error import AttributeError +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.attribute_error import ( + AttributeError, +) class SubscriptionsMrrErrorResponseException(APIException): def __init__(self, reason, response): - """Constructor for the SubscriptionsMrrErrorResponseException class + """Initialize SubscriptionsMrrErrorResponseException object. Args: reason (string): The reason (or error message) for the Exception @@ -28,7 +30,7 @@ def __init__(self, reason, response): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +38,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = AttributeError.from_dictionary(dictionary.get('errors')) if dictionary.get('errors') else None + self.errors =\ + AttributeError.from_dictionary( + dictionary.get("errors"))\ + if dictionary.get("errors") else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={self.errors!s})') + """Return a human-readable string representation.""" + _errors=self.errors + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/exceptions/too_many_management_link_requests_error_exception.py b/advancedbilling/exceptions/too_many_management_link_requests_error_exception.py index 1a43608b..f4696415 100644 --- a/advancedbilling/exceptions/too_many_management_link_requests_error_exception.py +++ b/advancedbilling/exceptions/too_many_management_link_requests_error_exception.py @@ -1,20 +1,22 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.models.too_many_management_link_requests import TooManyManagementLinkRequests +from advancedbilling.exceptions.api_exception import ( + APIException, +) +from advancedbilling.models.too_many_management_link_requests import ( + TooManyManagementLinkRequests, +) class TooManyManagementLinkRequestsErrorException(APIException): def __init__(self, reason, response): - """Constructor for the TooManyManagementLinkRequestsErrorException class + """Initialize TooManyManagementLinkRequestsErrorException object. Args: reason (string): The reason (or error message) for the Exception @@ -22,13 +24,14 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(TooManyManagementLinkRequestsErrorException, self).__init__(reason, response) + super(TooManyManagementLinkRequestsErrorException, + self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) def unbox(self, dictionary): - """Populates the properties of this object by extracting them from a dictionary. + """Populate the properties of this object by extracting them from a dictionary. Args: dictionary (dictionary): A dictionary representation of the object as @@ -36,10 +39,20 @@ def unbox(self, dictionary): MUST match property names in the API description. """ - self.errors = TooManyManagementLinkRequests.from_dictionary(dictionary.get('errors')) if dictionary.get('errors') else None + self.errors =\ + TooManyManagementLinkRequests.from_dictionary( + dictionary.get("errors"))\ + if dictionary.get("errors") else None + def __str__(self): - base_str = super().__str__() - return (f'{self.__class__.__name__}(' - f'{base_str[base_str.find("(") + 1:-1]}, ' - f'errors={self.errors!s})') + """Return a human-readable string representation.""" + _errors=self.errors + _base_str = super().__str__() + _base_str = _base_str[_base_str.find("(") + 1:-1] + return ( + f"{self.__class__.__name__}(" + f"base_str={_base_str!s}, " + f"errors={_errors!s}, " + f")" + ) diff --git a/advancedbilling/http/__init__.py b/advancedbilling/http/__init__.py index 45fcc043..e4b63964 100644 --- a/advancedbilling/http/__init__.py +++ b/advancedbilling/http/__init__.py @@ -1,9 +1,11 @@ +# ruff: noqa: D104 | Missing docstring in public package +# ruff: noqa: RUF022 | `__all__` is not sorted __all__ = [ - 'auth', - 'http_method_enum', - 'http_request', - 'http_response', - 'http_call_back', - 'proxy_settings', - 'http_client_provider', + "auth", + "http_call_back", + "http_client_provider", + "http_method_enum", + "http_request", + "http_response", + "proxy_settings", ] diff --git a/advancedbilling/http/auth/__init__.py b/advancedbilling/http/auth/__init__.py index 53946488..a95c17ec 100644 --- a/advancedbilling/http/auth/__init__.py +++ b/advancedbilling/http/auth/__init__.py @@ -1,3 +1,5 @@ +# ruff: noqa: D104 | Missing docstring in public package +# ruff: noqa: RUF022 | `__all__` is not sorted __all__ = [ - 'basic_auth', + "basic_auth", ] diff --git a/advancedbilling/http/auth/basic_auth.py b/advancedbilling/http/auth/basic_auth.py index 4e89fcbb..9691c308 100644 --- a/advancedbilling/http/auth/basic_auth.py +++ b/advancedbilling/http/auth/basic_auth.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ advanced_billing @@ -8,60 +7,119 @@ """ import os + from apimatic_core.authentication.header_auth import HeaderAuth from apimatic_core.utilities.auth_helper import AuthHelper class BasicAuth(HeaderAuth): + """ + An authentication handler that applies `BasicAuth` to + outgoing requests. It constructs the required credential values and integrates + with the core authentication framework. + """ @property def error_message(self): - """Display error message on occurrence of authentication failure - in BasicAuth + """Return reason about the authentication failure.""" + return "BasicAuth: username or password is undefined." + def __init__(self, basic_auth_credentials): """ - return "BasicAuth: BasicAuthUserName or BasicAuthPassword is undefined." + Initialize the authentication handler with credential data. - def __init__(self, basic_auth_credentials): + Args: + basic_auth_credentials: The credentials object used to generate + the authorization header. + + """ auth_params = {} - if basic_auth_credentials is not None \ - and basic_auth_credentials.username and basic_auth_credentials.password: + if (basic_auth_credentials is not None + and basic_auth_credentials.username + and basic_auth_credentials.password): auth_params = {"Authorization": "Basic {}".format( - AuthHelper.get_base64_encoded_value(basic_auth_credentials.username, basic_auth_credentials.password))} + AuthHelper.get_base64_encoded_value( + basic_auth_credentials.username, + basic_auth_credentials.password, + ))} super().__init__(auth_params=auth_params) class BasicAuthCredentials: + """ + A model for authentication credentials. Provides simple validation, + cloning support, and optional construction from environment variables. + Suitable as a pattern for other auth models. + """ @property def username(self): + """ + The username to use with basic authentication. + """ return self._username @property def password(self): + """ + The password to use with basic authentication. + """ return self._password def __init__(self, username, password): + """ + Initialize the credentials. + + Args: + username: The username property value to set. + password: The password property value to set. + + Raises: + ValueError: If any required value is missing. + + """ if username is None: - raise ValueError('username cannot be None') + raise ValueError("username cannot be None") if password is None: - raise ValueError('password cannot be None') + raise ValueError("password cannot be None") self._username = username self._password = password def clone_with(self, username=None, password=None): + """ + Return a new instance with optional value overrides. + + Args: + username: The username property value to set. + password: The password property value to set. + + """ return BasicAuthCredentials(username or self.username, password or self.password) @classmethod def from_environment(cls): - username = os.getenv('USERNAME', None) - password = os.getenv('PASSWORD', None) + """ + Create credentials from environment variables, if available. - if username is None or password is None: + Returns: + A credentials instance or ``None`` if values are missing. + + """ + username = os.getenv( + "USERNAME", + None, + ) + password = os.getenv( + "PASSWORD", + None, + ) + + if (username is None + or password is None): return None return cls( username=username, - password=password - ) \ No newline at end of file + password=password, + ) diff --git a/advancedbilling/http/http_call_back.py b/advancedbilling/http/http_call_back.py index ef436ad7..6d7df068 100644 --- a/advancedbilling/http/http_call_back.py +++ b/advancedbilling/http/http_call_back.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ advanced_billing @@ -7,15 +6,15 @@ https://www.apimatic.io ). """ -from apimatic_core.http.http_callback import HttpCallBack +from apimatic_core.http.http_callback import HttpCallBack as CoreHttpCallback -class HttpCallBack(HttpCallBack): - - """An interface for the callback to be called before and after the +class HttpCallBack(CoreHttpCallback): + """ + An interface for the callback to be called before and after the HTTP call for an endpoint is made. This class should not be instantiated but should be used as a base class for HttpCallBack classes. - """ \ No newline at end of file + """ diff --git a/advancedbilling/http/http_client_provider.py b/advancedbilling/http/http_client_provider.py index 7a550de8..546856d0 100644 --- a/advancedbilling/http/http_client_provider.py +++ b/advancedbilling/http/http_client_provider.py @@ -4,13 +4,13 @@ This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - from abc import ABC from apimatic_core_interfaces.client.http_client_provider import ( - HttpClientProvider as CoreHttpClientProvider + HttpClientProvider as CoreHttpClientProvider, ) + class HttpClientProvider(CoreHttpClientProvider, ABC): """ Defines a contract for providing HTTP client configuration. @@ -22,5 +22,3 @@ class HttpClientProvider(CoreHttpClientProvider, ABC): This allows developers to inject their own custom HTTP clients while maintaining compatibility with the SDK's request/response handling. """ - - pass diff --git a/advancedbilling/http/http_method_enum.py b/advancedbilling/http/http_method_enum.py index e8133312..857b29aa 100644 --- a/advancedbilling/http/http_method_enum.py +++ b/advancedbilling/http/http_method_enum.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ advanced_billing @@ -7,12 +6,14 @@ https://www.apimatic.io ). """ -from apimatic_core_interfaces.types.http_method_enum import HttpMethodEnum +from apimatic_core_interfaces.types.http_method_enum import ( + HttpMethodEnum as CoreHttpMethodEnum, +) -class HttpMethodEnum(HttpMethodEnum): - - """Enumeration of an HTTP Method +class HttpMethodEnum(CoreHttpMethodEnum): + """ + Enumeration of an HTTP Method Attributes: GET: A GET Request @@ -21,4 +22,4 @@ class HttpMethodEnum(HttpMethodEnum): PATCH: A PATCH Request DELETE: A DELETE Request - """ \ No newline at end of file + """ diff --git a/advancedbilling/http/http_request.py b/advancedbilling/http/http_request.py index ff103dff..25ec454b 100644 --- a/advancedbilling/http/http_request.py +++ b/advancedbilling/http/http_request.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ advanced_billing @@ -7,22 +6,25 @@ https://www.apimatic.io ). """ -from apimatic_core.http.request.http_request import HttpRequest +from apimatic_core.http.request.http_request import HttpRequest as CoreHttpRequest -class HttpRequest(HttpRequest): +class HttpRequest(CoreHttpRequest): + """ + Represent an HTTP request to be sent to the server. - """Information about an HTTP Request including its method, headers, - parameters, URL, and Basic Auth details + Encapsulates request details such as the HTTP method, target URL, headers, + query parameters, body parameters, and any files included with the request. Attributes: - http_method (HttpMethodEnum): The HTTP Method that this request should - perform when called. - headers (dict): A dictionary of headers (key : value) that should be - sent along with the request. - query_url (string): The URL that the request should be sent to. - parameters (dict): A dictionary of parameters that are to be sent along - with the request in the form body of the request + http_method: The HTTP method to use for the request. + query_url (str): The URL to which the request will be sent. + headers (dict[str, str] | None): Headers to include with the request. + query_parameters (dict[str, str] | None): Query parameters appended + to the request URL. + parameters (dict[str, str] | None): Form or body parameters sent + with the request. + files (dict | None): Files to be sent with the request. """ @@ -33,17 +35,16 @@ def __init__(self, query_parameters=None, parameters=None, files=None): - """Constructor for the HttpRequest class + """ + Initialize an HttpRequest instance. Args: - http_method (HttpMethodEnum): The HTTP Method. - query_url (string): The URL to send the request to. - headers (dict, optional): The headers for the HTTP Request. - query_parameters (dict, optional): Query parameters to add in the - URL. - parameters (dict, optional): Form or body parameters to be included - in the body. - files (dict, optional): Files to be sent with the request. + http_method: The HTTP method to use for the request. + query_url: The URL to which the request will be sent. + headers: Headers to include with the request. + query_parameters: Query parameters appended to the request URL. + parameters: Form or body parameters sent with the request. + files: Files to be sent with the request. """ super().__init__(http_method, diff --git a/advancedbilling/http/http_response.py b/advancedbilling/http/http_response.py index f295461b..1d958fc4 100644 --- a/advancedbilling/http/http_response.py +++ b/advancedbilling/http/http_response.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ advanced_billing @@ -7,22 +6,22 @@ https://www.apimatic.io ). """ -from apimatic_core.http.response.http_response import HttpResponse +from apimatic_core.http.response.http_response import HttpResponse as CoreHttpResponse -class HttpResponse(HttpResponse): +class HttpResponse(CoreHttpResponse): + """ + Represent an HTTP response returned by the server. - """Information about an HTTP Response including its status code, returned - headers, and raw body + Stores response metadata such as status code, reason phrase, headers, and + the raw response body, along with the originating request. Attributes: - status_code (int): The status code response from the server that - corresponds to this response. - reason_phrase (string): The reason phrase returned by the server. - headers (dict): A dictionary of headers (key : value) that were - returned with the response - text (string): The Raw body of the HTTP Response as a string - request (HttpRequest): The request that resulted in this response. + status_code (int): The HTTP status code returned by the server. + reason_phrase (str): The reason phrase associated with the status code. + headers (dict[str, str]): Response headers as key-value pairs. + text (str): The raw response body as a string. + request: The request object that resulted in this response. """ @@ -32,14 +31,15 @@ def __init__(self, headers, text, request): - """Constructor for the HttpResponse class + """ + Initialize an HttpResponse instance. Args: - status_code (int): The response status code. - reason_phrase (string): The response reason phrase. - headers (dict): The response headers. - text (string): The raw body from the server. - request (HttpRequest): The request that resulted in this response. + status_code: The HTTP status code returned by the server. + reason_phrase: The reason phrase associated with the status code. + headers: Response headers as key-value pairs. + text: The raw response body as a string. + request: The request object that resulted in this response. """ super().__init__(status_code, reason_phrase, headers, text, request) diff --git a/advancedbilling/http/proxy_settings.py b/advancedbilling/http/proxy_settings.py index 0cda245e..013c5391 100644 --- a/advancedbilling/http/proxy_settings.py +++ b/advancedbilling/http/proxy_settings.py @@ -1,4 +1,3 @@ - """ advanced_billing @@ -7,20 +6,36 @@ """ import os -from apimatic_core.http.configurations.proxy_settings import ProxySettings as CoreProxySettings +from typing import Optional + +from apimatic_core.http.configurations.proxy_settings import ( + ProxySettings as CoreProxySettings, +) + class ProxySettings(CoreProxySettings): - """ - A simple data model for configuring HTTP(S) proxy settings. - """ + """A simple data model for configuring HTTP(S) proxy settings.""" @classmethod - def from_environment(cls): - address = os.getenv('PROXY_ADDRESS', None) + def from_environment(cls) -> Optional["ProxySettings"]: + """ + Create an instance of this class using environment-based configuration. + + This method attempts to construct and return an instance using relevant + environment variables, if available. If the required configuration is + not present, it may return `None` to indicate that no valid instance + could be created. + + Returns: + Optional[cls]: A configured instance of this class, or `None` if + configuration data is missing or invalid. + + """ + address = os.getenv("PROXY_ADDRESS", None) if not address: return None - port = os.getenv('PROXY_PORT', None) + port = os.getenv("PROXY_PORT", None) if port is not None: try: port = int(port) @@ -30,6 +45,6 @@ def from_environment(cls): return cls( address=address, port=port, - username=os.getenv('PROXY_USERNAME', None), - password=os.getenv('PROXY_PASSWORD', None), + username=os.getenv("PROXY_USERNAME", None), + password=os.getenv("PROXY_PASSWORD", None), ) diff --git a/advancedbilling/models/__init__.py b/advancedbilling/models/__init__.py index d81a1e1d..7d1896c2 100644 --- a/advancedbilling/models/__init__.py +++ b/advancedbilling/models/__init__.py @@ -1,578 +1,606 @@ +# ruff: noqa: D104 | Missing docstring in public package +# ruff: noqa: RUF022 | `__all__` is not sorted __all__ = [ - 'payment_method_apple_pay', - 'payment_method_bank_account', - 'payment_method_credit_card', - 'payment_method_external', - 'payment_method_paypal', - 'apply_credit_note_event', - 'apply_debit_note_event', - 'apply_payment_event', - 'backport_invoice_event', - 'change_chargeback_status_event', - 'change_invoice_collection_method_event', - 'change_invoice_status_event', - 'create_credit_note_event', - 'create_debit_note_event', - 'failed_payment_event', - 'issue_invoice_event', - 'refund_invoice_event', - 'remove_payment_event', - 'void_invoice_event', - 'void_remainder_event', - 'list_invoice_events_response', - 'apple_pay_payment_profile', - 'bank_account_payment_profile', - 'credit_card_payment_profile', - 'paypal_payment_profile', - 'account_balance', - 'account_balances', - 'ach_agreement', - 'activate_event_based_component', - 'activate_subscription_request', - 'add_coupons_request', - 'add_subscription_to_a_group', - 'address_change', - 'agreement_acceptance', - 'allocate_components', - 'allocation', - 'allocation_expiration_date', - 'allocation_preview', - 'allocation_preview_item', - 'allocation_preview_line_item', - 'allocation_preview_response', - 'allocation_response', - 'allocation_settings', - 'applied_credit_note_data', - 'apply_credit_note_event_data', - 'apply_debit_note_event_data', - 'apply_payment_event_data', - 'attribute_error', - 'auto_resume', - 'bank_account_attributes', - 'bank_account_response', - 'bank_account_verification', - 'bank_account_verification_request', - 'base_refund_error', - 'base_string_error', - 'batch_job_response', - 'batch_job', - 'billing_manifest', - 'billing_manifest_item', - 'billing_schedule', - 'breakouts', - 'bulk_components_price_point_assignment', - 'bulk_create_product_price_points_request', - 'bulk_create_product_price_points_response', - 'bulk_create_segments', - 'bulk_update_segments', - 'bulk_update_segments_item', - 'calendar_billing', - 'cancel_grouped_subscriptions_request', - 'cancellation_options', - 'cancellation_request', - 'change_chargeback_status_event_data', - 'change_invoice_collection_method_event_data', - 'change_invoice_status_event_data', - 'chargify_ebb', - 'component', - 'component_allocation_change', - 'component_allocation_error_item', - 'component_cost_data', - 'component_cost_data_rate_tier', - 'component_currency_price', - 'component_currency_prices_response', - 'component_custom_price', - 'component_price', - 'component_price_point', - 'component_price_point_assignment', - 'component_price_point_item', - 'component_price_point_response', - 'component_price_points_response', - 'component_price_point_error_item', - 'component_response', - 'consolidated_invoice', - 'count_response', - 'coupon', - 'coupon_currency', - 'coupon_currency_request', - 'coupon_currency_response', - 'coupon_payload', - 'coupon_request', - 'coupon_response', - 'coupon_restriction', - 'coupon_subcodes', - 'coupon_subcodes_response', - 'coupon_usage', - 'create_allocation', - 'create_allocation_request', - 'create_component_price_point', - 'create_component_price_point_request', - 'create_component_price_points_request', - 'create_currency_price', - 'create_currency_prices_request', - 'create_customer', - 'create_customer_request', - 'create_ebb_component', - 'create_invoice', - 'create_invoice_address', - 'create_invoice_coupon', - 'create_invoice_item', - 'create_invoice_payment', - 'create_invoice_payment_application', - 'create_invoice_payment_request', - 'create_invoice_request', - 'create_metadata', - 'create_metadata_request', - 'create_metafield', - 'create_metafields_request', - 'create_metered_component', - 'create_multi_invoice_payment', - 'create_multi_invoice_payment_request', - 'create_offer', - 'create_offer_component', - 'create_offer_request', - 'create_on_off_component', - 'create_or_update_endpoint', - 'create_or_update_endpoint_request', - 'create_or_update_product', - 'create_or_update_product_request', - 'create_or_update_segment_price', - 'create_payment', - 'create_payment_profile', - 'create_payment_profile_request', - 'create_prepaid_component', - 'create_prepaid_usage_component_price_point', - 'create_prepayment', - 'create_prepayment_request', - 'create_prepayment_response', - 'create_product_currency_price', - 'create_product_currency_prices_request', - 'create_product_family', - 'create_product_family_request', - 'create_product_price_point', - 'create_product_price_point_request', - 'create_quantity_based_component', - 'create_reason_code', - 'create_reason_code_request', - 'create_segment', - 'create_segment_request', - 'create_subscription', - 'create_subscription_component', - 'create_subscription_group', - 'create_subscription_group_request', - 'create_subscription_request', - 'create_usage', - 'create_usage_request', - 'created_prepayment', - 'credit_account_balance_changed', - 'credit_card_attributes', - 'credit_note', - 'credit_note_application', - 'credit_note_line_item', - 'credit_scheme_request', - 'currency_price', - 'currency_prices_response', - 'custom_field_value_change', - 'customer', - 'customer_attributes', - 'customer_change', - 'customer_changes_preview_response', - 'customer_custom_fields_change', - 'customer_error', - 'customer_payer_change', - 'customer_response', - 'debit_note', - 'deduct_service_credit', - 'deduct_service_credit_request', - 'delayed_cancellation_response', - 'delete_subscription_group_response', - 'dunner_data', - 'dunning_step_data', - 'dunning_step_reached', - 'ebb_component', - 'ebb_event', - 'enable_webhooks_request', - 'enable_webhooks_response', - 'endpoint', - 'endpoint_response', - 'errors', - 'event', - 'event_based_billing_segment_error', - 'event_response', - 'failed_payment_event_data', - 'full_subscription_group_response', - 'get_one_time_token_payment_profile', - 'get_one_time_token_request', - 'group_billing', - 'group_settings', - 'group_target', - 'historic_usage', - 'invoice', - 'invoice_address', - 'invoice_avatax_details', - 'invoice_balance_item', - 'invoice_credit', - 'invoice_custom_field', - 'invoice_customer', - 'invoice_debit', - 'invoice_discount', - 'invoice_discount_breakout', - 'invoice_display_settings', - 'invoice_issued', - 'invoice_line_item', - 'invoice_line_item_component_cost_data', - 'invoice_line_item_event_data', - 'invoice_line_item_pricing_detail', - 'invoice_payer', - 'invoice_payer_change', - 'invoice_payment', - 'invoice_payment_application', - 'invoice_payment_method', - 'invoice_pre_payment', - 'invoice_previous_balance', - 'invoice_refund', - 'invoice_response', - 'invoice_seller', - 'invoice_tax', - 'invoice_tax_breakout', - 'invoice_tax_component_breakout', - 'issue_advance_invoice_request', - 'issue_invoice_event_data', - 'issue_invoice_request', - 'issue_service_credit', - 'issue_service_credit_request', - 'item_price_point_changed', - 'item_price_point_data', - 'list_components_filter', - 'list_components_price_points_response', - 'list_coupons_filter', - 'list_credit_notes_response', - 'list_invoices_response', - 'list_metafields_response', - 'list_mrr_filter', - 'list_mrr_response', - 'list_mrr_response_result', - 'list_offers_response', - 'list_prepayments_filter', - 'list_price_points_filter', - 'list_product_price_points_response', - 'list_products_filter', - 'list_proforma_invoices_meta', - 'list_proforma_invoices_response', - 'list_public_keys_meta', - 'list_public_keys_response', - 'list_sale_rep_item', - 'list_segments_filter', - 'list_segments_response', - 'list_service_credits_response', - 'list_subcription_group_prepayment_item', - 'list_subscription_components_filter', - 'list_subscription_components_for_site_filter', - 'list_subscription_components_response', - 'list_subscription_group_prepayment', - 'list_subscription_group_prepayment_response', - 'list_subscription_groups_item', - 'list_subscription_groups_meta', - 'list_subscription_groups_response', - 'metadata', - 'metafield', - 'metafield_scope', - 'metered_component', - 'metered_usage', - 'movement', - 'movement_line_item', - 'mrr', - 'mrr_movement', - 'mrr_response', - 'multi_invoice_payment', - 'multi_invoice_payment_response', - 'nested_subscription_group', - 'net_terms', - 'offer', - 'offer_discount', - 'offer_item', - 'offer_response', - 'offer_signup_page', - 'ok_response', - 'on_off_component', - 'organization_address', - 'origin_invoice', - 'overage_pricing', - 'override_subscription', - 'override_subscription_request', - 'paginated_metadata', - 'paid_invoice', - 'pause_request', - 'payer_attributes', - 'payer_error', - 'payment_collection_method_changed', - 'payment_for_allocation', - 'payment_profile_attributes', - 'payment_profile_response', - 'payment_related_events', - 'pending_cancellation_change', - 'portal_management_link', - 'prepaid_configuration', - 'prepaid_configuration_response', - 'prepaid_product_price_point_filter', - 'prepaid_subscription_balance_changed', - 'prepaid_usage', - 'prepaid_usage_allocation_detail', - 'prepaid_usage_component', - 'prepayment', - 'prepayment_account_balance_changed', - 'prepayment_response', - 'prepayments_response', - 'preview_allocations_request', - 'price', - 'product', - 'product_family', - 'product_family_response', - 'product_price_point', - 'product_price_point_errors', - 'product_price_point_response', - 'product_response', - 'proforma_error', - 'proforma_invoice', - 'proforma_invoice_credit', - 'proforma_invoice_discount', - 'proforma_invoice_issued', - 'proforma_invoice_payment', - 'proforma_invoice_tax', - 'proration', - 'public_key', - 'public_signup_page', - 'quantity_based_component', - 'reactivate_subscription_group_request', - 'reactivate_subscription_group_response', - 'reactivate_subscription_request', - 'reactivation_billing', - 'reason_code', - 'reason_code_response', - 'record_payment_request', - 'record_payment_response', - 'referral_code', - 'referral_validation_response', - 'refund_consolidated_invoice', - 'refund_invoice', - 'refund_invoice_event_data', - 'refund_invoice_request', - 'refund_prepayment', - 'refund_prepayment_base_refund_error', - 'refund_prepayment_request', - 'refund_success', - 'remove_payment_event_data', - 'renewal_preview', - 'renewal_preview_component', - 'renewal_preview_line_item', - 'renewal_preview_request', - 'renewal_preview_response', - 'replay_webhooks_request', - 'replay_webhooks_response', - 'resent_invitation', - 'resume_options', - 'revoked_invitation', - 'sale_rep', - 'sale_rep_item_mrr', - 'sale_rep_settings', - 'sale_rep_subscription', - 'segment', - 'segment_price', - 'segment_response', - 'send_invoice_request', - 'service_credit', - 'service_credit_response', - 'service_credit_1', - 'signup_proforma_preview', - 'signup_proforma_preview_response', - 'site', - 'site_response', - 'site_statistics', - 'site_summary', - 'subscription', - 'subscription_component', - 'subscription_component_allocation_error_item', - 'subscription_component_response', - 'subscription_component_subscription', - 'subscription_custom_price', - 'subscription_filter', - 'subscription_group', - 'subscription_group_balances', - 'subscription_group_bank_account', - 'subscription_group_component_custom_price', - 'subscription_group_credit_card', - 'subscription_group_customer', - 'subscription_group_item', - 'subscription_group_members_array_error', - 'subscription_group_payment_profile', - 'subscription_group_prepayment', - 'subscription_group_prepayment_request', - 'subscription_group_prepayment_response', - 'subscription_group_response', - 'subscription_group_signup', - 'subscription_group_signup_component', - 'subscription_group_signup_error', - 'subscription_group_signup_event_data', - 'subscription_group_signup_failure_data', - 'subscription_group_signup_item', - 'subscription_group_signup_request', - 'subscription_group_signup_response', - 'subscription_group_single_error', - 'subscription_group_subscription_error', - 'subscription_group_update_error', - 'subscription_included_coupon', - 'subscription_migration_preview', - 'subscription_migration_preview_options', - 'subscription_migration_preview_request', - 'subscription_migration_preview_response', - 'subscription_mrr', - 'subscription_mrr_breakout', - 'subscription_mrr_response', - 'subscription_note', - 'subscription_note_response', - 'subscription_preview', - 'subscription_preview_response', - 'subscription_product_change', - 'subscription_product_migration', - 'subscription_product_migration_request', - 'subscription_response', - 'subscription_state_change', - 'tax_configuration', - 'too_many_management_link_requests', - 'update_allocation_expiration_date', - 'update_component', - 'update_component_price_point', - 'update_component_price_point_request', - 'update_component_request', - 'update_coupon_currency', - 'update_currency_price', - 'update_currency_prices_request', - 'update_customer', - 'update_customer_request', - 'update_metadata', - 'update_metadata_request', - 'update_metafield', - 'update_metafields_request', - 'update_payment_profile', - 'update_payment_profile_request', - 'update_price', - 'update_product_price_point', - 'update_product_price_point_request', - 'update_reason_code', - 'update_reason_code_request', - 'update_segment', - 'update_segment_request', - 'update_subscription', - 'update_subscription_component', - 'update_subscription_group', - 'update_subscription_group_request', - 'update_subscription_note', - 'update_subscription_note_request', - 'update_subscription_request', - 'upsert_prepaid_configuration', - 'upsert_prepaid_configuration_request', - 'usage', - 'usage_response', - 'void_invoice', - 'void_invoice_event_data', - 'void_invoice_request', - 'void_remainder_event_data', - 'webhook', - 'webhook_response', - 'all_vaults', - 'allocation_preview_direction', - 'allocation_preview_line_item_kind', - 'apple_pay_vault', - 'auto_invite', - 'bank_account_holder_type', - 'bank_account_type', - 'bank_account_vault', - 'basic_date_field', - 'billing_manifest_line_item_kind', - 'cancellation_method', - 'card_type', - 'chargeback_status', - 'cleanup_scope', - 'collection_method', - 'component_kind', - 'compounding_strategy', - 'create_invoice_status', - 'create_prepayment_method', - 'create_signup_proforma_preview_include', - 'credit_card_vault', - 'credit_note_status', - 'credit_scheme', - 'credit_type', - 'currency_price_role', - 'custom_field_owner', - 'debit_note_role', - 'debit_note_status', - 'direction', - 'discount_type', - 'event_key', - 'expiration_interval_unit', - 'failed_payment_action', - 'first_charge_type', - 'group_target_type', - 'group_type', - 'include_not_null', - 'include_null_or_not_null', - 'include_option', - 'interval_unit', - 'invoice_consolidation_level', - 'invoice_date_field', - 'invoice_discount_source_type', - 'invoice_discount_type', - 'invoice_event_payment_method', - 'invoice_event_type', - 'invoice_payment_method_type', - 'invoice_payment_type', - 'invoice_role', - 'invoice_sort_field', - 'invoice_status', - 'item_category', - 'line_item_kind', - 'line_item_transaction_type', - 'list_components_price_points_include', - 'list_events_date_field', - 'list_prepayment_date_field', - 'list_products_include', - 'list_products_price_points_include', - 'list_subscription_components_include', - 'list_subscription_components_sort', - 'metafield_input', - 'payment_type', - 'pay_pal_vault', - 'prepayment_method', - 'price_point_type', - 'pricing_scheme', - 'proforma_invoice_discount_source_type', - 'proforma_invoice_role', - 'proforma_invoice_status', - 'proforma_invoice_tax_source_type', - 'reactivation_charge', - 'recurring_scheme', - 'resource_type', - 'restriction_type', - 'resumption_charge', - 'service_credit_type', - 'snap_day', - 'sorting_direction', - 'subscription_date_field', - 'subscription_group_include', - 'subscription_group_prepayment_method', - 'subscription_groups_list_include', - 'subscription_include', - 'subscription_list_date_field', - 'subscription_list_include', - 'subscription_purge_type', - 'subscription_sort', - 'subscription_state', - 'subscription_state_filter', - 'tax_configuration_kind', - 'tax_destination_address', - 'trial_type', - 'webhook_order', - 'webhook_status', - 'webhook_subscription', + "account_balance", + "account_balances", + "ach_agreement", + "activate_event_based_component", + "activate_subscription_request", + "add_coupons_request", + "add_subscription_to_a_group", + "address_change", + "agreement_acceptance", + "all_vaults", + "allocate_components", + "allocation", + "allocation_expiration_date", + "allocation_preview", + "allocation_preview_direction", + "allocation_preview_item", + "allocation_preview_line_item", + "allocation_preview_line_item_kind", + "allocation_preview_response", + "allocation_response", + "allocation_settings", + "apple_pay_payment_profile", + "apple_pay_vault", + "applied_credit_note_data", + "apply_credit_note_event", + "apply_credit_note_event_data", + "apply_debit_note_event", + "apply_debit_note_event_data", + "apply_payment_event", + "apply_payment_event_data", + "attribute_error", + "auto_invite", + "auto_resume", + "available_actions", + "backport_invoice_event", + "bank_account_attributes", + "bank_account_holder_type", + "bank_account_payment_profile", + "bank_account_response", + "bank_account_type", + "bank_account_vault", + "bank_account_verification", + "bank_account_verification_request", + "base_refund_error", + "base_string_error", + "basic_date_field", + "batch_job", + "batch_job_response", + "billing_manifest", + "billing_manifest_item", + "billing_manifest_line_item_kind", + "billing_schedule", + "breakouts", + "bulk_components_price_point_assignment", + "bulk_create_product_price_points_request", + "bulk_create_product_price_points_response", + "bulk_create_segments", + "bulk_update_segments", + "bulk_update_segments_item", + "calendar_billing", + "cancel_grouped_subscriptions_request", + "cancellation_method", + "cancellation_options", + "cancellation_request", + "card_type", + "change_chargeback_status_event", + "change_chargeback_status_event_data", + "change_invoice_collection_method_event", + "change_invoice_collection_method_event_data", + "change_invoice_status_event", + "change_invoice_status_event_data", + "chargeback_status", + "chargify_ebb", + "cleanup_scope", + "clone_component_price_point", + "clone_component_price_point_request", + "collection_method", + "component", + "component_allocation_change", + "component_allocation_error_item", + "component_cost_data", + "component_cost_data_rate_tier", + "component_currency_price", + "component_currency_prices_response", + "component_custom_price", + "component_kind", + "component_price", + "component_price_point", + "component_price_point_assignment", + "component_price_point_currency_overage_response", + "component_price_point_error_item", + "component_price_point_item", + "component_price_point_response", + "component_price_points_response", + "component_response", + "compounding_strategy", + "consolidated_invoice", + "contract", + "count_response", + "coupon", + "coupon_currency", + "coupon_currency_request", + "coupon_currency_response", + "coupon_payload", + "coupon_request", + "coupon_response", + "coupon_restriction", + "coupon_subcodes", + "coupon_subcodes_response", + "coupon_usage", + "create_allocation", + "create_allocation_request", + "create_component_price_point", + "create_component_price_point_request", + "create_component_price_points_request", + "create_credit_note_event", + "create_currency_price", + "create_currency_prices_request", + "create_customer", + "create_customer_request", + "create_debit_note_event", + "create_ebb_component", + "create_invoice", + "create_invoice_address", + "create_invoice_coupon", + "create_invoice_item", + "create_invoice_payment", + "create_invoice_payment_application", + "create_invoice_payment_request", + "create_invoice_request", + "create_invoice_status", + "create_metadata", + "create_metadata_request", + "create_metafield", + "create_metafields_request", + "create_metered_component", + "create_multi_invoice_payment", + "create_multi_invoice_payment_request", + "create_offer", + "create_offer_component", + "create_offer_request", + "create_on_off_component", + "create_or_update_endpoint", + "create_or_update_endpoint_request", + "create_or_update_product", + "create_or_update_product_request", + "create_or_update_segment_price", + "create_payment", + "create_payment_profile", + "create_payment_profile_request", + "create_prepaid_component", + "create_prepaid_usage_component_price_point", + "create_prepayment", + "create_prepayment_method", + "create_prepayment_request", + "create_prepayment_response", + "create_product_currency_price", + "create_product_currency_prices_request", + "create_product_family", + "create_product_family_request", + "create_product_price_point", + "create_product_price_point_request", + "create_quantity_based_component", + "create_reason_code", + "create_reason_code_request", + "create_segment", + "create_segment_request", + "create_signup_proforma_preview_include", + "create_subscription", + "create_subscription_component", + "create_subscription_group", + "create_subscription_group_request", + "create_subscription_request", + "create_usage", + "create_usage_request", + "created_prepayment", + "credit_account_balance_changed", + "credit_card_attributes", + "credit_card_payment_profile", + "credit_card_vault", + "credit_note", + "credit_note_application", + "credit_note_line_item", + "credit_note_status", + "credit_scheme", + "credit_scheme_request", + "credit_type", + "currency_overage_prices", + "currency_price", + "currency_price_role", + "currency_prices_response", + "custom_field_owner", + "custom_field_value_change", + "customer", + "customer_attributes", + "customer_change", + "customer_changes_preview_response", + "customer_custom_fields_change", + "customer_error", + "customer_payer_change", + "customer_response", + "debit_note", + "debit_note_role", + "debit_note_status", + "deduct_service_credit", + "deduct_service_credit_request", + "delayed_cancellation_response", + "delete_subscription_group_response", + "deliver_proforma_invoice_request", + "direction", + "discount_type", + "downgrade_credit_credit_type", + "dunner_data", + "dunning_step_data", + "dunning_step_reached", + "ebb_component", + "ebb_event", + "enable_webhooks_request", + "enable_webhooks_response", + "endpoint", + "endpoint_response", + "errors", + "event", + "event_based_billing_segment_error", + "event_key", + "event_response", + "expiration_interval_unit", + "failed_payment_action", + "failed_payment_event", + "failed_payment_event_data", + "first_charge_type", + "full_subscription_group_response", + "get_one_time_token_payment_profile", + "get_one_time_token_request", + "group_billing", + "group_settings", + "group_target", + "group_target_type", + "group_type", + "historic_usage", + "include_not_null", + "include_null_or_not_null", + "include_option", + "interval_unit", + "invoice", + "invoice_address", + "invoice_avatax_details", + "invoice_balance_item", + "invoice_consolidation_level", + "invoice_credit", + "invoice_custom_field", + "invoice_customer", + "invoice_date_field", + "invoice_debit", + "invoice_discount", + "invoice_discount_breakout", + "invoice_discount_source_type", + "invoice_discount_type", + "invoice_display_settings", + "invoice_event_payment_method", + "invoice_event_type", + "invoice_issued", + "invoice_line_item", + "invoice_line_item_component_cost_data", + "invoice_line_item_event_data", + "invoice_line_item_pricing_detail", + "invoice_payer", + "invoice_payer_change", + "invoice_payment", + "invoice_payment_application", + "invoice_payment_method", + "invoice_payment_method_type", + "invoice_payment_type", + "invoice_pre_payment", + "invoice_previous_balance", + "invoice_refund", + "invoice_response", + "invoice_role", + "invoice_seller", + "invoice_sort_field", + "invoice_status", + "invoice_tax", + "invoice_tax_breakout", + "invoice_tax_component_breakout", + "issue_advance_invoice_request", + "issue_invoice_event", + "issue_invoice_event_data", + "issue_invoice_request", + "issue_service_credit", + "issue_service_credit_request", + "item_category", + "item_price_point_changed", + "item_price_point_data", + "line_item_kind", + "line_item_transaction_type", + "list_components_filter", + "list_components_price_points_include", + "list_components_price_points_response", + "list_coupons_filter", + "list_credit_notes_response", + "list_events_date_field", + "list_invoice_events_response", + "list_invoices_response", + "list_metafields_response", + "list_mrr_filter", + "list_mrr_response", + "list_mrr_response_result", + "list_offers_response", + "list_prepayment_date_field", + "list_prepayments_filter", + "list_price_points_filter", + "list_product_price_points_response", + "list_products_filter", + "list_products_include", + "list_products_price_points_include", + "list_proforma_invoices_meta", + "list_proforma_invoices_response", + "list_public_keys_meta", + "list_public_keys_response", + "list_sale_rep_item", + "list_segments_filter", + "list_segments_response", + "list_service_credits_response", + "list_subcription_group_prepayment_item", + "list_subscription_components_filter", + "list_subscription_components_for_site_filter", + "list_subscription_components_include", + "list_subscription_components_response", + "list_subscription_components_sort", + "list_subscription_group_prepayment", + "list_subscription_group_prepayment_response", + "list_subscription_groups_item", + "list_subscription_groups_meta", + "list_subscription_groups_response", + "metadata", + "metafield", + "metafield_input", + "metafield_scope", + "metered_component", + "metered_usage", + "movement", + "movement_line_item", + "mrr", + "mrr_movement", + "mrr_response", + "multi_invoice_payment", + "multi_invoice_payment_response", + "nested_subscription_group", + "net_terms", + "offer", + "offer_discount", + "offer_item", + "offer_response", + "offer_signup_page", + "ok_response", + "on_off_component", + "organization_address", + "origin_invoice", + "overage_pricing", + "override_subscription", + "override_subscription_request", + "paginated_metadata", + "paid_invoice", + "pause_request", + "pay_pal_vault", + "payer_attributes", + "payer_error", + "payment_collection_method_changed", + "payment_for_allocation", + "payment_method_apple_pay", + "payment_method_bank_account", + "payment_method_credit_card", + "payment_method_external", + "payment_method_paypal", + "payment_profile_attributes", + "payment_profile_response", + "payment_related_events", + "payment_type", + "paypal_payment_profile", + "pending_cancellation_change", + "portal_management_link", + "prepaid_configuration", + "prepaid_configuration_response", + "prepaid_product_price_point_filter", + "prepaid_subscription_balance_changed", + "prepaid_usage", + "prepaid_usage_allocation_detail", + "prepaid_usage_component", + "prepayment", + "prepayment_account_balance_changed", + "prepayment_method", + "prepayment_response", + "prepayments_response", + "preview_allocations_request", + "price", + "price_point_type", + "pricing_scheme", + "product", + "product_family", + "product_family_response", + "product_price_point", + "product_price_point_errors", + "product_price_point_response", + "product_response", + "proforma_error", + "proforma_invoice", + "proforma_invoice_credit", + "proforma_invoice_discount", + "proforma_invoice_discount_source_type", + "proforma_invoice_issued", + "proforma_invoice_payment", + "proforma_invoice_role", + "proforma_invoice_status", + "proforma_invoice_tax", + "proforma_invoice_tax_source_type", + "proration", + "public_key", + "public_signup_page", + "quantity_based_component", + "reactivate_subscription_group_request", + "reactivate_subscription_group_response", + "reactivate_subscription_request", + "reactivation_billing", + "reactivation_charge", + "reason_code", + "reason_code_response", + "record_payment_request", + "record_payment_response", + "recurring_scheme", + "referral_code", + "referral_validation_response", + "refund_consolidated_invoice", + "refund_invoice", + "refund_invoice_event", + "refund_invoice_event_data", + "refund_invoice_request", + "refund_prepayment", + "refund_prepayment_base_refund_error", + "refund_prepayment_request", + "refund_success", + "register", + "remove_payment_event", + "remove_payment_event_data", + "renewal_preview", + "renewal_preview_component", + "renewal_preview_line_item", + "renewal_preview_request", + "renewal_preview_response", + "replay_webhooks_request", + "replay_webhooks_response", + "resent_invitation", + "resource_type", + "restriction_type", + "resume_options", + "resumption_charge", + "revoked_invitation", + "sale_rep", + "sale_rep_item_mrr", + "sale_rep_settings", + "sale_rep_subscription", + "scheduled_renewal_component_custom_price", + "scheduled_renewal_configuration", + "scheduled_renewal_configuration_item", + "scheduled_renewal_configuration_item_request", + "scheduled_renewal_configuration_item_response", + "scheduled_renewal_configuration_request", + "scheduled_renewal_configuration_request_body", + "scheduled_renewal_configuration_response", + "scheduled_renewal_configurations_response", + "scheduled_renewal_item_request_body_component", + "scheduled_renewal_item_request_body_product", + "scheduled_renewal_lock_in_request", + "scheduled_renewal_product_price_point", + "scheduled_renewal_update_request", + "segment", + "segment_price", + "segment_response", + "send_email", + "send_invoice_request", + "service_credit", + "service_credit_1", + "service_credit_response", + "service_credit_type", + "signup_proforma_preview", + "signup_proforma_preview_response", + "site", + "site_response", + "site_statistics", + "site_summary", + "snap_day", + "sorting_direction", + "status", + "subscription", + "subscription_component", + "subscription_component_allocation_error_item", + "subscription_component_response", + "subscription_component_subscription", + "subscription_custom_price", + "subscription_date_field", + "subscription_filter", + "subscription_group", + "subscription_group_balances", + "subscription_group_bank_account", + "subscription_group_component_custom_price", + "subscription_group_credit_card", + "subscription_group_customer", + "subscription_group_include", + "subscription_group_item", + "subscription_group_members_array_error", + "subscription_group_payment_profile", + "subscription_group_prepayment", + "subscription_group_prepayment_method", + "subscription_group_prepayment_request", + "subscription_group_prepayment_response", + "subscription_group_response", + "subscription_group_signup", + "subscription_group_signup_component", + "subscription_group_signup_error", + "subscription_group_signup_event_data", + "subscription_group_signup_failure_data", + "subscription_group_signup_item", + "subscription_group_signup_request", + "subscription_group_signup_response", + "subscription_group_single_error", + "subscription_group_subscription_error", + "subscription_group_update_error", + "subscription_groups_list_include", + "subscription_include", + "subscription_included_coupon", + "subscription_list_date_field", + "subscription_list_include", + "subscription_migration_preview", + "subscription_migration_preview_options", + "subscription_migration_preview_request", + "subscription_migration_preview_response", + "subscription_mrr", + "subscription_mrr_breakout", + "subscription_mrr_response", + "subscription_note", + "subscription_note_response", + "subscription_preview", + "subscription_preview_response", + "subscription_product_change", + "subscription_product_migration", + "subscription_product_migration_request", + "subscription_purge_type", + "subscription_response", + "subscription_sort", + "subscription_state", + "subscription_state_change", + "subscription_state_filter", + "tax_configuration", + "tax_configuration_kind", + "tax_destination_address", + "too_many_management_link_requests", + "trial_type", + "update_allocation_expiration_date", + "update_component", + "update_component_price_point", + "update_component_price_point_request", + "update_component_request", + "update_coupon_currency", + "update_currency_price", + "update_currency_prices_request", + "update_customer", + "update_customer_request", + "update_metadata", + "update_metadata_request", + "update_metafield", + "update_metafields_request", + "update_payment_profile", + "update_payment_profile_request", + "update_price", + "update_product_price_point", + "update_product_price_point_request", + "update_reason_code", + "update_reason_code_request", + "update_segment", + "update_segment_request", + "update_subscription", + "update_subscription_component", + "update_subscription_group", + "update_subscription_group_request", + "update_subscription_note", + "update_subscription_note_request", + "update_subscription_request", + "upgrade_charge_credit_type", + "upsert_prepaid_configuration", + "upsert_prepaid_configuration_request", + "usage", + "usage_response", + "void_invoice", + "void_invoice_event", + "void_invoice_event_data", + "void_invoice_request", + "void_remainder_event", + "void_remainder_event_data", + "webhook", + "webhook_order", + "webhook_response", + "webhook_status", + "webhook_subscription", ] diff --git a/advancedbilling/models/account_balance.py b/advancedbilling/models/account_balance.py index a6d0a72f..2f478921 100644 --- a/advancedbilling/models/account_balance.py +++ b/advancedbilling/models/account_balance.py @@ -1,59 +1,57 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AccountBalance(object): - """Implementation of the 'Account Balance' model. Attributes: balance_in_cents (int): The balance in cents. automatic_balance_in_cents (int): The automatic balance in cents. remittance_balance_in_cents (int): The remittance balance in cents. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "balance_in_cents": 'balance_in_cents', - "automatic_balance_in_cents": 'automatic_balance_in_cents', - "remittance_balance_in_cents": 'remittance_balance_in_cents' + "balance_in_cents": "balance_in_cents", + "automatic_balance_in_cents": "automatic_balance_in_cents", + "remittance_balance_in_cents": "remittance_balance_in_cents", } _optionals = [ - 'balance_in_cents', - 'automatic_balance_in_cents', - 'remittance_balance_in_cents', + "balance_in_cents", + "automatic_balance_in_cents", + "remittance_balance_in_cents", ] _nullables = [ - 'automatic_balance_in_cents', - 'remittance_balance_in_cents', + "automatic_balance_in_cents", + "remittance_balance_in_cents", ] - def __init__(self, - balance_in_cents=APIHelper.SKIP, - automatic_balance_in_cents=APIHelper.SKIP, - remittance_balance_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AccountBalance class""" - + def __init__( + self, + balance_in_cents=APIHelper.SKIP, + automatic_balance_in_cents=APIHelper.SKIP, + remittance_balance_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a AccountBalance instance.""" # Initialize members of the class if balance_in_cents is not APIHelper.SKIP: - self.balance_in_cents = balance_in_cents + self.balance_in_cents = balance_in_cents if automatic_balance_in_cents is not APIHelper.SKIP: - self.automatic_balance_in_cents = automatic_balance_in_cents + self.automatic_balance_in_cents = automatic_balance_in_cents if remittance_balance_in_cents is not APIHelper.SKIP: - self.remittance_balance_in_cents = remittance_balance_in_cents + self.remittance_balance_in_cents = remittance_balance_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -63,7 +61,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -74,16 +72,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - balance_in_cents = dictionary.get("balance_in_cents") if dictionary.get("balance_in_cents") else APIHelper.SKIP - automatic_balance_in_cents = dictionary.get("automatic_balance_in_cents") if "automatic_balance_in_cents" in dictionary.keys() else APIHelper.SKIP - remittance_balance_in_cents = dictionary.get("remittance_balance_in_cents") if "remittance_balance_in_cents" in dictionary.keys() else APIHelper.SKIP + balance_in_cents =\ + dictionary.get("balance_in_cents")\ + if dictionary.get("balance_in_cents")\ + else APIHelper.SKIP + automatic_balance_in_cents =\ + dictionary.get("automatic_balance_in_cents")\ + if "automatic_balance_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + remittance_balance_in_cents =\ + dictionary.get("remittance_balance_in_cents")\ + if "remittance_balance_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(balance_in_cents, automatic_balance_in_cents, @@ -91,15 +100,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'balance_in_cents={(self.balance_in_cents if hasattr(self, "balance_in_cents") else None)!r}, ' - f'automatic_balance_in_cents={(self.automatic_balance_in_cents if hasattr(self, "automatic_balance_in_cents") else None)!r}, ' - f'remittance_balance_in_cents={(self.remittance_balance_in_cents if hasattr(self, "remittance_balance_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _balance_in_cents=( + self.balance_in_cents + if hasattr(self, "balance_in_cents") + else None + ) + _automatic_balance_in_cents=( + self.automatic_balance_in_cents + if hasattr(self, "automatic_balance_in_cents") + else None + ) + _remittance_balance_in_cents=( + self.remittance_balance_in_cents + if hasattr(self, "remittance_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"balance_in_cents={_balance_in_cents!r}, " + f"automatic_balance_in_cents={_automatic_balance_in_cents!r}, " + f"remittance_balance_in_cents={_remittance_balance_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'balance_in_cents={(self.balance_in_cents if hasattr(self, "balance_in_cents") else None)!s}, ' - f'automatic_balance_in_cents={(self.automatic_balance_in_cents if hasattr(self, "automatic_balance_in_cents") else None)!s}, ' - f'remittance_balance_in_cents={(self.remittance_balance_in_cents if hasattr(self, "remittance_balance_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _balance_in_cents=( + self.balance_in_cents + if hasattr(self, "balance_in_cents") + else None + ) + _automatic_balance_in_cents=( + self.automatic_balance_in_cents + if hasattr(self, "automatic_balance_in_cents") + else None + ) + _remittance_balance_in_cents=( + self.remittance_balance_in_cents + if hasattr(self, "remittance_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"balance_in_cents={_balance_in_cents!s}, " + f"automatic_balance_in_cents={_automatic_balance_in_cents!s}, " + f"remittance_balance_in_cents={_remittance_balance_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/account_balances.py b/advancedbilling/models/account_balances.py index ee635130..42072ea6 100644 --- a/advancedbilling/models/account_balances.py +++ b/advancedbilling/models/account_balances.py @@ -1,72 +1,72 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.account_balance import AccountBalance +from advancedbilling.models.account_balance import ( + AccountBalance, +) class AccountBalances(object): - """Implementation of the 'Account Balances' model. Attributes: - open_invoices (AccountBalance): The balance, in cents, of the sum of - the subscription's open, payable invoices. - pending_invoices (AccountBalance): The balance, in cents, of the sum - of the subscription's pending, payable invoices. + open_invoices (AccountBalance): The balance, in cents, of the sum of the + subscription's open, payable invoices. + pending_invoices (AccountBalance): The balance, in cents, of the sum of the + subscription's pending, payable invoices. pending_discounts (AccountBalance): The balance, in cents, of the subscription's Pending Discount account. service_credits (AccountBalance): The balance, in cents, of the subscription's Service Credit account. - prepayments (AccountBalance): The balance, in cents, of the - subscription's Prepayment account. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayments (AccountBalance): The balance, in cents, of the subscription's + Prepayment account. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "open_invoices": 'open_invoices', - "pending_invoices": 'pending_invoices', - "pending_discounts": 'pending_discounts', - "service_credits": 'service_credits', - "prepayments": 'prepayments' + "open_invoices": "open_invoices", + "pending_invoices": "pending_invoices", + "pending_discounts": "pending_discounts", + "service_credits": "service_credits", + "prepayments": "prepayments", } _optionals = [ - 'open_invoices', - 'pending_invoices', - 'pending_discounts', - 'service_credits', - 'prepayments', + "open_invoices", + "pending_invoices", + "pending_discounts", + "service_credits", + "prepayments", ] - def __init__(self, - open_invoices=APIHelper.SKIP, - pending_invoices=APIHelper.SKIP, - pending_discounts=APIHelper.SKIP, - service_credits=APIHelper.SKIP, - prepayments=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AccountBalances class""" - + def __init__( + self, + open_invoices=APIHelper.SKIP, + pending_invoices=APIHelper.SKIP, + pending_discounts=APIHelper.SKIP, + service_credits=APIHelper.SKIP, + prepayments=APIHelper.SKIP, + additional_properties=None): + """Initialize a AccountBalances instance.""" # Initialize members of the class if open_invoices is not APIHelper.SKIP: - self.open_invoices = open_invoices + self.open_invoices = open_invoices if pending_invoices is not APIHelper.SKIP: - self.pending_invoices = pending_invoices + self.pending_invoices = pending_invoices if pending_discounts is not APIHelper.SKIP: - self.pending_discounts = pending_discounts + self.pending_discounts = pending_discounts if service_credits is not APIHelper.SKIP: - self.service_credits = service_credits + self.service_credits = service_credits if prepayments is not APIHelper.SKIP: - self.prepayments = prepayments + self.prepayments = prepayments # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +76,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,18 +87,40 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - open_invoices = AccountBalance.from_dictionary(dictionary.get('open_invoices')) if 'open_invoices' in dictionary.keys() else APIHelper.SKIP - pending_invoices = AccountBalance.from_dictionary(dictionary.get('pending_invoices')) if 'pending_invoices' in dictionary.keys() else APIHelper.SKIP - pending_discounts = AccountBalance.from_dictionary(dictionary.get('pending_discounts')) if 'pending_discounts' in dictionary.keys() else APIHelper.SKIP - service_credits = AccountBalance.from_dictionary(dictionary.get('service_credits')) if 'service_credits' in dictionary.keys() else APIHelper.SKIP - prepayments = AccountBalance.from_dictionary(dictionary.get('prepayments')) if 'prepayments' in dictionary.keys() else APIHelper.SKIP + open_invoices =\ + AccountBalance.from_dictionary( + dictionary.get("open_invoices"))\ + if "open_invoices" in dictionary.keys()\ + else APIHelper.SKIP + pending_invoices =\ + AccountBalance.from_dictionary( + dictionary.get("pending_invoices"))\ + if "pending_invoices" in dictionary.keys()\ + else APIHelper.SKIP + pending_discounts =\ + AccountBalance.from_dictionary( + dictionary.get("pending_discounts"))\ + if "pending_discounts" in dictionary.keys()\ + else APIHelper.SKIP + service_credits =\ + AccountBalance.from_dictionary( + dictionary.get("service_credits"))\ + if "service_credits" in dictionary.keys()\ + else APIHelper.SKIP + prepayments =\ + AccountBalance.from_dictionary( + dictionary.get("prepayments"))\ + if "prepayments" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(open_invoices, pending_invoices, @@ -108,19 +130,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'open_invoices={(self.open_invoices if hasattr(self, "open_invoices") else None)!r}, ' - f'pending_invoices={(self.pending_invoices if hasattr(self, "pending_invoices") else None)!r}, ' - f'pending_discounts={(self.pending_discounts if hasattr(self, "pending_discounts") else None)!r}, ' - f'service_credits={(self.service_credits if hasattr(self, "service_credits") else None)!r}, ' - f'prepayments={(self.prepayments if hasattr(self, "prepayments") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _open_invoices=( + self.open_invoices + if hasattr(self, "open_invoices") + else None + ) + _pending_invoices=( + self.pending_invoices + if hasattr(self, "pending_invoices") + else None + ) + _pending_discounts=( + self.pending_discounts + if hasattr(self, "pending_discounts") + else None + ) + _service_credits=( + self.service_credits + if hasattr(self, "service_credits") + else None + ) + _prepayments=( + self.prepayments + if hasattr(self, "prepayments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"open_invoices={_open_invoices!r}, " + f"pending_invoices={_pending_invoices!r}, " + f"pending_discounts={_pending_discounts!r}, " + f"service_credits={_service_credits!r}, " + f"prepayments={_prepayments!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'open_invoices={(self.open_invoices if hasattr(self, "open_invoices") else None)!s}, ' - f'pending_invoices={(self.pending_invoices if hasattr(self, "pending_invoices") else None)!s}, ' - f'pending_discounts={(self.pending_discounts if hasattr(self, "pending_discounts") else None)!s}, ' - f'service_credits={(self.service_credits if hasattr(self, "service_credits") else None)!s}, ' - f'prepayments={(self.prepayments if hasattr(self, "prepayments") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _open_invoices=( + self.open_invoices + if hasattr(self, "open_invoices") + else None + ) + _pending_invoices=( + self.pending_invoices + if hasattr(self, "pending_invoices") + else None + ) + _pending_discounts=( + self.pending_discounts + if hasattr(self, "pending_discounts") + else None + ) + _service_credits=( + self.service_credits + if hasattr(self, "service_credits") + else None + ) + _prepayments=( + self.prepayments + if hasattr(self, "prepayments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"open_invoices={_open_invoices!s}, " + f"pending_invoices={_pending_invoices!s}, " + f"pending_discounts={_pending_discounts!s}, " + f"service_credits={_service_credits!s}, " + f"prepayments={_prepayments!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/ach_agreement.py b/advancedbilling/models/ach_agreement.py index 5eb6da54..333630c3 100644 --- a/advancedbilling/models/ach_agreement.py +++ b/advancedbilling/models/ach_agreement.py @@ -1,67 +1,65 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ACHAgreement(object): - """Implementation of the 'ACH Agreement' model. - (Optional) If passed, the proof of the authorized ACH agreement terms will - be persisted. + (Optional) If passed, the proof of the authorized ACH agreement terms will be + persisted. Attributes: - agreement_terms (str): (Required when providing ACH agreement params) - The ACH authorization agreement terms. - authorizer_first_name (str): (Required when providing ACH agreement - params) The first name of the person authorizing the ACH agreement. - authorizer_last_name (str): (Required when providing ACH agreement - params) The last name of the person authorizing the ACH agreement. - ip_address (str): (Required when providing ACH agreement params) The - IP address of the person authorizing the ACH agreement. - additional_properties (Dict[str, object]): The additional properties - for the model. + agreement_terms (str): (Required when providing ACH agreement params) The ACH + authorization agreement terms. + authorizer_first_name (str): (Required when providing ACH agreement params) + The first name of the person authorizing the ACH agreement. + authorizer_last_name (str): (Required when providing ACH agreement params) + The last name of the person authorizing the ACH agreement. + ip_address (str): (Required when providing ACH agreement params) The IP + address of the person authorizing the ACH agreement. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "agreement_terms": 'agreement_terms', - "authorizer_first_name": 'authorizer_first_name', - "authorizer_last_name": 'authorizer_last_name', - "ip_address": 'ip_address' + "agreement_terms": "agreement_terms", + "authorizer_first_name": "authorizer_first_name", + "authorizer_last_name": "authorizer_last_name", + "ip_address": "ip_address", } _optionals = [ - 'agreement_terms', - 'authorizer_first_name', - 'authorizer_last_name', - 'ip_address', + "agreement_terms", + "authorizer_first_name", + "authorizer_last_name", + "ip_address", ] - def __init__(self, - agreement_terms=APIHelper.SKIP, - authorizer_first_name=APIHelper.SKIP, - authorizer_last_name=APIHelper.SKIP, - ip_address=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ACHAgreement class""" - + def __init__( + self, + agreement_terms=APIHelper.SKIP, + authorizer_first_name=APIHelper.SKIP, + authorizer_last_name=APIHelper.SKIP, + ip_address=APIHelper.SKIP, + additional_properties=None): + """Initialize a ACHAgreement instance.""" # Initialize members of the class if agreement_terms is not APIHelper.SKIP: - self.agreement_terms = agreement_terms + self.agreement_terms = agreement_terms if authorizer_first_name is not APIHelper.SKIP: - self.authorizer_first_name = authorizer_first_name + self.authorizer_first_name = authorizer_first_name if authorizer_last_name is not APIHelper.SKIP: - self.authorizer_last_name = authorizer_last_name + self.authorizer_last_name = authorizer_last_name if ip_address is not APIHelper.SKIP: - self.ip_address = ip_address + self.ip_address = ip_address # Add additional model properties to the instance if additional_properties is None: @@ -71,7 +69,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -82,17 +80,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - agreement_terms = dictionary.get("agreement_terms") if dictionary.get("agreement_terms") else APIHelper.SKIP - authorizer_first_name = dictionary.get("authorizer_first_name") if dictionary.get("authorizer_first_name") else APIHelper.SKIP - authorizer_last_name = dictionary.get("authorizer_last_name") if dictionary.get("authorizer_last_name") else APIHelper.SKIP - ip_address = dictionary.get("ip_address") if dictionary.get("ip_address") else APIHelper.SKIP + agreement_terms =\ + dictionary.get("agreement_terms")\ + if dictionary.get("agreement_terms")\ + else APIHelper.SKIP + authorizer_first_name =\ + dictionary.get("authorizer_first_name")\ + if dictionary.get("authorizer_first_name")\ + else APIHelper.SKIP + authorizer_last_name =\ + dictionary.get("authorizer_last_name")\ + if dictionary.get("authorizer_last_name")\ + else APIHelper.SKIP + ip_address =\ + dictionary.get("ip_address")\ + if dictionary.get("ip_address")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(agreement_terms, authorizer_first_name, @@ -102,7 +114,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -113,7 +125,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -123,17 +134,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'agreement_terms={(self.agreement_terms if hasattr(self, "agreement_terms") else None)!r}, ' - f'authorizer_first_name={(self.authorizer_first_name if hasattr(self, "authorizer_first_name") else None)!r}, ' - f'authorizer_last_name={(self.authorizer_last_name if hasattr(self, "authorizer_last_name") else None)!r}, ' - f'ip_address={(self.ip_address if hasattr(self, "ip_address") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _agreement_terms=( + self.agreement_terms + if hasattr(self, "agreement_terms") + else None + ) + _authorizer_first_name=( + self.authorizer_first_name + if hasattr(self, "authorizer_first_name") + else None + ) + _authorizer_last_name=( + self.authorizer_last_name + if hasattr(self, "authorizer_last_name") + else None + ) + _ip_address=( + self.ip_address + if hasattr(self, "ip_address") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"agreement_terms={_agreement_terms!r}, " + f"authorizer_first_name={_authorizer_first_name!r}, " + f"authorizer_last_name={_authorizer_last_name!r}, " + f"ip_address={_ip_address!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'agreement_terms={(self.agreement_terms if hasattr(self, "agreement_terms") else None)!s}, ' - f'authorizer_first_name={(self.authorizer_first_name if hasattr(self, "authorizer_first_name") else None)!s}, ' - f'authorizer_last_name={(self.authorizer_last_name if hasattr(self, "authorizer_last_name") else None)!s}, ' - f'ip_address={(self.ip_address if hasattr(self, "ip_address") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _agreement_terms=( + self.agreement_terms + if hasattr(self, "agreement_terms") + else None + ) + _authorizer_first_name=( + self.authorizer_first_name + if hasattr(self, "authorizer_first_name") + else None + ) + _authorizer_last_name=( + self.authorizer_last_name + if hasattr(self, "authorizer_last_name") + else None + ) + _ip_address=( + self.ip_address + if hasattr(self, "ip_address") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"agreement_terms={_agreement_terms!s}, " + f"authorizer_first_name={_authorizer_first_name!s}, " + f"authorizer_last_name={_authorizer_last_name!s}, " + f"ip_address={_ip_address!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/activate_event_based_component.py b/advancedbilling/models/activate_event_based_component.py index 04444f39..f2c6e6bc 100644 --- a/advancedbilling/models/activate_event_based_component.py +++ b/advancedbilling/models/activate_event_based_component.py @@ -1,60 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.billing_schedule import BillingSchedule -from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.billing_schedule import ( + BillingSchedule, +) +from advancedbilling.models.component_custom_price import ( + ComponentCustomPrice, +) class ActivateEventBasedComponent(object): - """Implementation of the 'Activate Event-Based Component' model. Attributes: price_point_id (int): The Chargify id of the price point - billing_schedule (BillingSchedule): This attribute is particularly - useful when you need to align billing events for different - components on distinct schedules within a subscription. This only - works for site with Multifrequency enabled. - custom_price (ComponentCustomPrice): Create or update custom pricing - unique to the subscription. Used in place of `price_point_id`. - additional_properties (Dict[str, object]): The additional properties - for the model. + billing_schedule (BillingSchedule): This attribute is particularly useful + when you need to align billing events for different components on + distinct schedules within a subscription. This only works for site with + Multifrequency enabled. + custom_price (ComponentCustomPrice): Create or update custom pricing unique + to the subscription. Used in place of `price_point_id`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point_id": 'price_point_id', - "billing_schedule": 'billing_schedule', - "custom_price": 'custom_price' + "price_point_id": "price_point_id", + "billing_schedule": "billing_schedule", + "custom_price": "custom_price", } _optionals = [ - 'price_point_id', - 'billing_schedule', - 'custom_price', + "price_point_id", + "billing_schedule", + "custom_price", ] - def __init__(self, - price_point_id=APIHelper.SKIP, - billing_schedule=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ActivateEventBasedComponent class""" - + def __init__( + self, + price_point_id=APIHelper.SKIP, + billing_schedule=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a ActivateEventBasedComponent instance.""" # Initialize members of the class if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if billing_schedule is not APIHelper.SKIP: - self.billing_schedule = billing_schedule + self.billing_schedule = billing_schedule if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,16 +77,29 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - billing_schedule = BillingSchedule.from_dictionary(dictionary.get('billing_schedule')) if 'billing_schedule' in dictionary.keys() else APIHelper.SKIP - custom_price = ComponentCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + billing_schedule =\ + BillingSchedule.from_dictionary( + dictionary.get("billing_schedule"))\ + if "billing_schedule" in dictionary.keys()\ + else APIHelper.SKIP + custom_price =\ + ComponentCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point_id, billing_schedule, @@ -92,15 +107,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'billing_schedule={(self.billing_schedule if hasattr(self, "billing_schedule") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule=( + self.billing_schedule + if hasattr(self, "billing_schedule") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point_id={_price_point_id!r}, " + f"billing_schedule={_billing_schedule!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'billing_schedule={(self.billing_schedule if hasattr(self, "billing_schedule") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule=( + self.billing_schedule + if hasattr(self, "billing_schedule") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point_id={_price_point_id!s}, " + f"billing_schedule={_billing_schedule!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/activate_subscription_request.py b/advancedbilling/models/activate_subscription_request.py index ae2f2606..2540d75b 100644 --- a/advancedbilling/models/activate_subscription_request.py +++ b/advancedbilling/models/activate_subscription_request.py @@ -1,51 +1,48 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ActivateSubscriptionRequest(object): - """Implementation of the 'Activate Subscription Request' model. Attributes: revert_on_failure (bool): You may choose how to handle the activation - failure. `true` means do not change the subscription’s state and - billing period. `false` means to continue through with the - activation and enter an end of life state. If this parameter is - omitted or `null` is passed it will default to value set in the - site settings (default: `true`) - additional_properties (Dict[str, object]): The additional properties - for the model. + failure. `true` means do not change the subscription’s state and billing + period. `false` means to continue through with the activation and enter + an end of life state. If this parameter is omitted or `null` is passed it + will default to value set in the site settings (default: `true`) + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "revert_on_failure": 'revert_on_failure' + "revert_on_failure": "revert_on_failure", } _optionals = [ - 'revert_on_failure', + "revert_on_failure", ] _nullables = [ - 'revert_on_failure', + "revert_on_failure", ] - def __init__(self, - revert_on_failure=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ActivateSubscriptionRequest class""" - + def __init__( + self, + revert_on_failure=APIHelper.SKIP, + additional_properties=None): + """Initialize a ActivateSubscriptionRequest instance.""" # Initialize members of the class if revert_on_failure is not APIHelper.SKIP: - self.revert_on_failure = revert_on_failure + self.revert_on_failure = revert_on_failure # Add additional model properties to the instance if additional_properties is None: @@ -55,7 +52,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -66,24 +63,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - revert_on_failure = dictionary.get("revert_on_failure") if "revert_on_failure" in dictionary.keys() else APIHelper.SKIP + revert_on_failure =\ + dictionary.get("revert_on_failure")\ + if "revert_on_failure" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(revert_on_failure, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'revert_on_failure={(self.revert_on_failure if hasattr(self, "revert_on_failure") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _revert_on_failure=( + self.revert_on_failure + if hasattr(self, "revert_on_failure") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"revert_on_failure={_revert_on_failure!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'revert_on_failure={(self.revert_on_failure if hasattr(self, "revert_on_failure") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _revert_on_failure=( + self.revert_on_failure + if hasattr(self, "revert_on_failure") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"revert_on_failure={_revert_on_failure!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/add_coupons_request.py b/advancedbilling/models/add_coupons_request.py index 4b2cdd99..f6843cf2 100644 --- a/advancedbilling/models/add_coupons_request.py +++ b/advancedbilling/models/add_coupons_request.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AddCouponsRequest(object): - """Implementation of the 'Add Coupons Request' model. Attributes: codes (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "codes": 'codes' + "codes": "codes", } _optionals = [ - 'codes', + "codes", ] - def __init__(self, - codes=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AddCouponsRequest class""" - + def __init__( + self, + codes=APIHelper.SKIP, + additional_properties=None): + """Initialize a AddCouponsRequest instance.""" # Initialize members of the class if codes is not APIHelper.SKIP: - self.codes = codes + self.codes = codes # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - codes = dictionary.get("codes") if dictionary.get("codes") else APIHelper.SKIP + codes =\ + dictionary.get("codes")\ + if dictionary.get("codes")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(codes, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'codes={(self.codes if hasattr(self, "codes") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _codes=( + self.codes + if hasattr(self, "codes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"codes={_codes!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'codes={(self.codes if hasattr(self, "codes") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _codes=( + self.codes + if hasattr(self, "codes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"codes={_codes!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/add_subscription_to_a_group.py b/advancedbilling/models/add_subscription_to_a_group.py index 4a236e00..194a0d48 100644 --- a/advancedbilling/models/add_subscription_to_a_group.py +++ b/advancedbilling/models/add_subscription_to_a_group.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.group_settings import GroupSettings +from advancedbilling.models.group_settings import ( + GroupSettings, +) class AddSubscriptionToAGroup(object): - """Implementation of the 'Add Subscription to a Group' model. Attributes: group (GroupSettings): The model property of type GroupSettings. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "group": 'group' + "group": "group", } _optionals = [ - 'group', + "group", ] - def __init__(self, - group=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AddSubscriptionToAGroup class""" - + def __init__( + self, + group=APIHelper.SKIP, + additional_properties=None): + """Initialize a AddSubscriptionToAGroup instance.""" # Initialize members of the class if group is not APIHelper.SKIP: - self.group = group + self.group = group # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - group = GroupSettings.from_dictionary(dictionary.get('group')) if 'group' in dictionary.keys() else APIHelper.SKIP + group =\ + GroupSettings.from_dictionary( + dictionary.get("group"))\ + if "group" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(group, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'group={(self.group if hasattr(self, "group") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _group=( + self.group + if hasattr(self, "group") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"group={_group!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'group={(self.group if hasattr(self, "group") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _group=( + self.group + if hasattr(self, "group") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"group={_group!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/address_change.py b/advancedbilling/models/address_change.py index b07652d1..b21c4d41 100644 --- a/advancedbilling/models/address_change.py +++ b/advancedbilling/models/address_change.py @@ -1,41 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.invoice_address import InvoiceAddress +# ruff: noqa: E501 +from advancedbilling.models.invoice_address import ( + InvoiceAddress, +) -class AddressChange(object): +class AddressChange(object): """Implementation of the 'Address Change' model. Attributes: before (InvoiceAddress): The model property of type InvoiceAddress. after (InvoiceAddress): The model property of type InvoiceAddress. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "before": 'before', - "after": 'after' + "before": "before", + "after": "after", } - def __init__(self, - before=None, - after=None, - additional_properties=None): - """Constructor for the AddressChange class""" - + def __init__( + self, + before=None, + after=None, + additional_properties=None): + """Initialize a AddressChange instance.""" # Initialize members of the class - self.before = before - self.after = after + self.before = before + self.after = after # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,28 +56,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - before = InvoiceAddress.from_dictionary(dictionary.get('before')) if dictionary.get('before') else None - after = InvoiceAddress.from_dictionary(dictionary.get('after')) if dictionary.get('after') else None + before =\ + InvoiceAddress.from_dictionary( + dictionary.get("before"))\ + if dictionary.get("before") else None + after =\ + InvoiceAddress.from_dictionary( + dictionary.get("after"))\ + if dictionary.get("after") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(before, after, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'before={self.before!r}, ' - f'after={self.after!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _before=self.before + _after=self.after + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"before={_before!r}, " + f"after={_after!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'before={self.before!s}, ' - f'after={self.after!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _before=self.before + _after=self.after + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"before={_before!s}, " + f"after={_after!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/agreement_acceptance.py b/advancedbilling/models/agreement_acceptance.py index 2a7d4fa7..5302afb0 100644 --- a/advancedbilling/models/agreement_acceptance.py +++ b/advancedbilling/models/agreement_acceptance.py @@ -1,76 +1,74 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AgreementAcceptance(object): - """Implementation of the 'Agreement Acceptance' model. Required when creating a subscription with Maxio Payments. Attributes: ip_address (str): Required when providing agreement acceptance params. - terms_url (str): Required when creating a subscription with Maxio - Payments. Either terms_url or provacy_policy_url required when - providing agreement_acceptance params. + terms_url (str): Required when creating a subscription with Maxio Payments. + Either terms_url or provacy_policy_url required when providing + agreement_acceptance params. privacy_policy_url (str): The model property of type str. return_refund_policy_url (str): The model property of type str. delivery_policy_url (str): The model property of type str. secure_checkout_policy_url (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "ip_address": 'ip_address', - "terms_url": 'terms_url', - "privacy_policy_url": 'privacy_policy_url', - "return_refund_policy_url": 'return_refund_policy_url', - "delivery_policy_url": 'delivery_policy_url', - "secure_checkout_policy_url": 'secure_checkout_policy_url' + "ip_address": "ip_address", + "terms_url": "terms_url", + "privacy_policy_url": "privacy_policy_url", + "return_refund_policy_url": "return_refund_policy_url", + "delivery_policy_url": "delivery_policy_url", + "secure_checkout_policy_url": "secure_checkout_policy_url", } _optionals = [ - 'ip_address', - 'terms_url', - 'privacy_policy_url', - 'return_refund_policy_url', - 'delivery_policy_url', - 'secure_checkout_policy_url', + "ip_address", + "terms_url", + "privacy_policy_url", + "return_refund_policy_url", + "delivery_policy_url", + "secure_checkout_policy_url", ] - def __init__(self, - ip_address=APIHelper.SKIP, - terms_url=APIHelper.SKIP, - privacy_policy_url=APIHelper.SKIP, - return_refund_policy_url=APIHelper.SKIP, - delivery_policy_url=APIHelper.SKIP, - secure_checkout_policy_url=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AgreementAcceptance class""" - + def __init__( + self, + ip_address=APIHelper.SKIP, + terms_url=APIHelper.SKIP, + privacy_policy_url=APIHelper.SKIP, + return_refund_policy_url=APIHelper.SKIP, + delivery_policy_url=APIHelper.SKIP, + secure_checkout_policy_url=APIHelper.SKIP, + additional_properties=None): + """Initialize a AgreementAcceptance instance.""" # Initialize members of the class if ip_address is not APIHelper.SKIP: - self.ip_address = ip_address + self.ip_address = ip_address if terms_url is not APIHelper.SKIP: - self.terms_url = terms_url + self.terms_url = terms_url if privacy_policy_url is not APIHelper.SKIP: - self.privacy_policy_url = privacy_policy_url + self.privacy_policy_url = privacy_policy_url if return_refund_policy_url is not APIHelper.SKIP: - self.return_refund_policy_url = return_refund_policy_url + self.return_refund_policy_url = return_refund_policy_url if delivery_policy_url is not APIHelper.SKIP: - self.delivery_policy_url = delivery_policy_url + self.delivery_policy_url = delivery_policy_url if secure_checkout_policy_url is not APIHelper.SKIP: - self.secure_checkout_policy_url = secure_checkout_policy_url + self.secure_checkout_policy_url = secure_checkout_policy_url # Add additional model properties to the instance if additional_properties is None: @@ -80,7 +78,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -91,19 +89,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - ip_address = dictionary.get("ip_address") if dictionary.get("ip_address") else APIHelper.SKIP - terms_url = dictionary.get("terms_url") if dictionary.get("terms_url") else APIHelper.SKIP - privacy_policy_url = dictionary.get("privacy_policy_url") if dictionary.get("privacy_policy_url") else APIHelper.SKIP - return_refund_policy_url = dictionary.get("return_refund_policy_url") if dictionary.get("return_refund_policy_url") else APIHelper.SKIP - delivery_policy_url = dictionary.get("delivery_policy_url") if dictionary.get("delivery_policy_url") else APIHelper.SKIP - secure_checkout_policy_url = dictionary.get("secure_checkout_policy_url") if dictionary.get("secure_checkout_policy_url") else APIHelper.SKIP + ip_address =\ + dictionary.get("ip_address")\ + if dictionary.get("ip_address")\ + else APIHelper.SKIP + terms_url =\ + dictionary.get("terms_url")\ + if dictionary.get("terms_url")\ + else APIHelper.SKIP + privacy_policy_url =\ + dictionary.get("privacy_policy_url")\ + if dictionary.get("privacy_policy_url")\ + else APIHelper.SKIP + return_refund_policy_url =\ + dictionary.get("return_refund_policy_url")\ + if dictionary.get("return_refund_policy_url")\ + else APIHelper.SKIP + delivery_policy_url =\ + dictionary.get("delivery_policy_url")\ + if dictionary.get("delivery_policy_url")\ + else APIHelper.SKIP + secure_checkout_policy_url =\ + dictionary.get("secure_checkout_policy_url")\ + if dictionary.get("secure_checkout_policy_url")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(ip_address, terms_url, @@ -115,7 +133,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -126,7 +144,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -136,21 +153,91 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'ip_address={(self.ip_address if hasattr(self, "ip_address") else None)!r}, ' - f'terms_url={(self.terms_url if hasattr(self, "terms_url") else None)!r}, ' - f'privacy_policy_url={(self.privacy_policy_url if hasattr(self, "privacy_policy_url") else None)!r}, ' - f'return_refund_policy_url={(self.return_refund_policy_url if hasattr(self, "return_refund_policy_url") else None)!r}, ' - f'delivery_policy_url={(self.delivery_policy_url if hasattr(self, "delivery_policy_url") else None)!r}, ' - f'secure_checkout_policy_url={(self.secure_checkout_policy_url if hasattr(self, "secure_checkout_policy_url") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _ip_address=( + self.ip_address + if hasattr(self, "ip_address") + else None + ) + _terms_url=( + self.terms_url + if hasattr(self, "terms_url") + else None + ) + _privacy_policy_url=( + self.privacy_policy_url + if hasattr(self, "privacy_policy_url") + else None + ) + _return_refund_policy_url=( + self.return_refund_policy_url + if hasattr(self, "return_refund_policy_url") + else None + ) + _delivery_policy_url=( + self.delivery_policy_url + if hasattr(self, "delivery_policy_url") + else None + ) + _secure_checkout_policy_url=( + self.secure_checkout_policy_url + if hasattr(self, "secure_checkout_policy_url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ip_address={_ip_address!r}, " + f"terms_url={_terms_url!r}, " + f"privacy_policy_url={_privacy_policy_url!r}, " + f"return_refund_policy_url={_return_refund_policy_url!r}, " + f"delivery_policy_url={_delivery_policy_url!r}, " + f"secure_checkout_policy_url={_secure_checkout_policy_url!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'ip_address={(self.ip_address if hasattr(self, "ip_address") else None)!s}, ' - f'terms_url={(self.terms_url if hasattr(self, "terms_url") else None)!s}, ' - f'privacy_policy_url={(self.privacy_policy_url if hasattr(self, "privacy_policy_url") else None)!s}, ' - f'return_refund_policy_url={(self.return_refund_policy_url if hasattr(self, "return_refund_policy_url") else None)!s}, ' - f'delivery_policy_url={(self.delivery_policy_url if hasattr(self, "delivery_policy_url") else None)!s}, ' - f'secure_checkout_policy_url={(self.secure_checkout_policy_url if hasattr(self, "secure_checkout_policy_url") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _ip_address=( + self.ip_address + if hasattr(self, "ip_address") + else None + ) + _terms_url=( + self.terms_url + if hasattr(self, "terms_url") + else None + ) + _privacy_policy_url=( + self.privacy_policy_url + if hasattr(self, "privacy_policy_url") + else None + ) + _return_refund_policy_url=( + self.return_refund_policy_url + if hasattr(self, "return_refund_policy_url") + else None + ) + _delivery_policy_url=( + self.delivery_policy_url + if hasattr(self, "delivery_policy_url") + else None + ) + _secure_checkout_policy_url=( + self.secure_checkout_policy_url + if hasattr(self, "secure_checkout_policy_url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ip_address={_ip_address!s}, " + f"terms_url={_terms_url!s}, " + f"privacy_policy_url={_privacy_policy_url!s}, " + f"return_refund_policy_url={_return_refund_policy_url!s}, " + f"delivery_policy_url={_delivery_policy_url!s}, " + f"secure_checkout_policy_url={_secure_checkout_policy_url!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/all_vaults.py b/advancedbilling/models/all_vaults.py index 1caa734c..17c0b2bf 100644 --- a/advancedbilling/models/all_vaults.py +++ b/advancedbilling/models/all_vaults.py @@ -1,19 +1,16 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class AllVaults(object): - """Implementation of the 'All Vaults' enum. - The vault that stores the payment profile with the provided `vault_token`. - Use `bogus` for testing. + The vault that stores the payment profile with the provided `vault_token`. Use + `bogus` for testing. Attributes: ADYEN: The enum member of type str. @@ -50,82 +47,88 @@ class AllVaults(object): TRUST_COMMERCE: The enum member of type str. UNIPAAS: The enum member of type str. WIRECARD: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['adyen', 'authorizenet', 'beanstream', 'blue_snap', 'bogus', 'braintree1', 'braintree_blue', 'checkout', 'cybersource', 'elavon', 'eway', 'eway_rapid', 'eway_rapid_std', 'firstdata', 'forte', 'gocardless', 'litle', 'maxio_payments', 'maxp', 'moduslink', 'moneris', 'nmi', 'orbital', 'payment_express', 'paymill', 'paypal', 'paypal_complete', 'pin', 'square', 'stripe', 'stripe_connect', 'trust_commerce', 'unipaas', 'wirecard'] - ADYEN = 'adyen' - AUTHORIZENET = 'authorizenet' + _all_values = ["adyen", "authorizenet", "beanstream", "blue_snap", + "bogus", "braintree1", "braintree_blue", "checkout", "cybersource", "elavon", + "eway", "eway_rapid", "eway_rapid_std", "firstdata", "forte", "gocardless", + "litle", "maxio_payments", "maxp", "moduslink", "moneris", "nmi", "orbital", + "payment_express", "paymill", "paypal", "paypal_complete", "pin", "square", + "stripe", "stripe_connect", "trust_commerce", "unipaas", "wirecard"] + ADYEN = "adyen" - BEANSTREAM = 'beanstream' + AUTHORIZENET = "authorizenet" - BLUE_SNAP = 'blue_snap' + BEANSTREAM = "beanstream" - BOGUS = 'bogus' + BLUE_SNAP = "blue_snap" - BRAINTREE1 = 'braintree1' + BOGUS = "bogus" - BRAINTREE_BLUE = 'braintree_blue' + BRAINTREE1 = "braintree1" - CHECKOUT = 'checkout' + BRAINTREE_BLUE = "braintree_blue" - CYBERSOURCE = 'cybersource' + CHECKOUT = "checkout" - ELAVON = 'elavon' + CYBERSOURCE = "cybersource" - EWAY = 'eway' + ELAVON = "elavon" - EWAY_RAPID = 'eway_rapid' + EWAY = "eway" - EWAY_RAPID_STD = 'eway_rapid_std' + EWAY_RAPID = "eway_rapid" - FIRSTDATA = 'firstdata' + EWAY_RAPID_STD = "eway_rapid_std" - FORTE = 'forte' + FIRSTDATA = "firstdata" - GOCARDLESS = 'gocardless' + FORTE = "forte" - LITLE = 'litle' + GOCARDLESS = "gocardless" - MAXIO_PAYMENTS = 'maxio_payments' + LITLE = "litle" - MAXP = 'maxp' + MAXIO_PAYMENTS = "maxio_payments" - MODUSLINK = 'moduslink' + MAXP = "maxp" - MONERIS = 'moneris' + MODUSLINK = "moduslink" - NMI = 'nmi' + MONERIS = "moneris" - ORBITAL = 'orbital' + NMI = "nmi" - PAYMENT_EXPRESS = 'payment_express' + ORBITAL = "orbital" - PAYMILL = 'paymill' + PAYMENT_EXPRESS = "payment_express" - PAYPAL = 'paypal' + PAYMILL = "paymill" - PAYPAL_COMPLETE = 'paypal_complete' + PAYPAL = "paypal" - PIN = 'pin' + PAYPAL_COMPLETE = "paypal_complete" - SQUARE = 'square' + PIN = "pin" - STRIPE = 'stripe' + SQUARE = "square" - STRIPE_CONNECT = 'stripe_connect' + STRIPE = "stripe" - TRUST_COMMERCE = 'trust_commerce' + STRIPE_CONNECT = "stripe_connect" - UNIPAAS = 'unipaas' + TRUST_COMMERCE = "trust_commerce" - WIRECARD = 'wirecard' + UNIPAAS = "unipaas" + + WIRECARD = "wirecard" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -135,9 +138,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/allocate_components.py b/advancedbilling/models/allocate_components.py index 5382d445..e82f55ad 100644 --- a/advancedbilling/models/allocate_components.py +++ b/advancedbilling/models/allocate_components.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_allocation import CreateAllocation +from advancedbilling.models.create_allocation import ( + CreateAllocation, +) class AllocateComponents(object): - """Implementation of the 'Allocate Components' model. Attributes: @@ -21,81 +21,78 @@ class AllocateComponents(object): List[CreateAllocation]. accrue_charge (bool): The model property of type bool. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - payment_collection_method (CollectionMethod): (Optional) If not - passed, the allocation(s) will use the payment collection method - on the subscription - initiate_dunning (bool): If true, if the immediate component payment - fails, initiate dunning for the subscription. Otherwise, leave - the charges on the subscription to pay for at renewal. - additional_properties (Dict[str, object]): The additional properties - for the model. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. + payment_collection_method (CollectionMethod): (Optional) If not passed, the + allocation(s) will use the payment collection method on the subscription + initiate_dunning (bool): If true, if the immediate component payment fails, + initiate dunning for the subscription. Otherwise, leave the charges on + the subscription to pay for at renewal. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "proration_upgrade_scheme": 'proration_upgrade_scheme', - "proration_downgrade_scheme": 'proration_downgrade_scheme', - "allocations": 'allocations', - "accrue_charge": 'accrue_charge', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "payment_collection_method": 'payment_collection_method', - "initiate_dunning": 'initiate_dunning' + "proration_upgrade_scheme": "proration_upgrade_scheme", + "proration_downgrade_scheme": "proration_downgrade_scheme", + "allocations": "allocations", + "accrue_charge": "accrue_charge", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "payment_collection_method": "payment_collection_method", + "initiate_dunning": "initiate_dunning", } _optionals = [ - 'proration_upgrade_scheme', - 'proration_downgrade_scheme', - 'allocations', - 'accrue_charge', - 'upgrade_charge', - 'downgrade_credit', - 'payment_collection_method', - 'initiate_dunning', + "proration_upgrade_scheme", + "proration_downgrade_scheme", + "allocations", + "accrue_charge", + "upgrade_charge", + "downgrade_credit", + "payment_collection_method", + "initiate_dunning", ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', + "upgrade_charge", + "downgrade_credit", ] - def __init__(self, - proration_upgrade_scheme=APIHelper.SKIP, - proration_downgrade_scheme=APIHelper.SKIP, - allocations=APIHelper.SKIP, - accrue_charge=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - initiate_dunning=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AllocateComponents class""" - + def __init__( + self, + proration_upgrade_scheme=APIHelper.SKIP, + proration_downgrade_scheme=APIHelper.SKIP, + allocations=APIHelper.SKIP, + accrue_charge=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + initiate_dunning=APIHelper.SKIP, + additional_properties=None): + """Initialize a AllocateComponents instance.""" # Initialize members of the class if proration_upgrade_scheme is not APIHelper.SKIP: - self.proration_upgrade_scheme = proration_upgrade_scheme + self.proration_upgrade_scheme = proration_upgrade_scheme if proration_downgrade_scheme is not APIHelper.SKIP: - self.proration_downgrade_scheme = proration_downgrade_scheme + self.proration_downgrade_scheme = proration_downgrade_scheme if allocations is not APIHelper.SKIP: - self.allocations = allocations + self.allocations = allocations if accrue_charge is not APIHelper.SKIP: - self.accrue_charge = accrue_charge + self.accrue_charge = accrue_charge if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method if initiate_dunning is not APIHelper.SKIP: - self.initiate_dunning = initiate_dunning + self.initiate_dunning = initiate_dunning # Add additional model properties to the instance if additional_properties is None: @@ -105,7 +102,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -116,25 +113,51 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else APIHelper.SKIP - proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else APIHelper.SKIP + proration_upgrade_scheme =\ + dictionary.get("proration_upgrade_scheme")\ + if dictionary.get("proration_upgrade_scheme")\ + else APIHelper.SKIP + proration_downgrade_scheme =\ + dictionary.get("proration_downgrade_scheme")\ + if dictionary.get("proration_downgrade_scheme")\ + else APIHelper.SKIP allocations = None - if dictionary.get('allocations') is not None: - allocations = [CreateAllocation.from_dictionary(x) for x in dictionary.get('allocations')] + if dictionary.get("allocations") is not None: + allocations = [ + CreateAllocation.from_dictionary(x) + for x in dictionary.get("allocations") + ] else: allocations = APIHelper.SKIP - accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP - initiate_dunning = dictionary.get("initiate_dunning") if "initiate_dunning" in dictionary.keys() else APIHelper.SKIP + accrue_charge =\ + dictionary.get("accrue_charge")\ + if "accrue_charge" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + initiate_dunning =\ + dictionary.get("initiate_dunning")\ + if "initiate_dunning" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(proration_upgrade_scheme, proration_downgrade_scheme, @@ -147,25 +170,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!r}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!r}, ' - f'allocations={(self.allocations if hasattr(self, "allocations") else None)!r}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'initiate_dunning={(self.initiate_dunning if hasattr(self, "initiate_dunning") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _allocations=( + self.allocations + if hasattr(self, "allocations") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _initiate_dunning=( + self.initiate_dunning + if hasattr(self, "initiate_dunning") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"proration_upgrade_scheme={_proration_upgrade_scheme!r}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!r}, " + f"allocations={_allocations!r}, " + f"accrue_charge={_accrue_charge!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"initiate_dunning={_initiate_dunning!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!s}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!s}, ' - f'allocations={(self.allocations if hasattr(self, "allocations") else None)!s}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'initiate_dunning={(self.initiate_dunning if hasattr(self, "initiate_dunning") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _allocations=( + self.allocations + if hasattr(self, "allocations") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _initiate_dunning=( + self.initiate_dunning + if hasattr(self, "initiate_dunning") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"proration_upgrade_scheme={_proration_upgrade_scheme!s}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!s}, " + f"allocations={_allocations!s}, " + f"accrue_charge={_accrue_charge!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"initiate_dunning={_initiate_dunning!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation.py b/advancedbilling/models/allocation.py index 18799bf1..1858b211 100644 --- a/advancedbilling/models/allocation.py +++ b/advancedbilling/models/allocation.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payment_for_allocation import PaymentForAllocation +from advancedbilling.models.payment_for_allocation import ( + PaymentForAllocation, +) class Allocation(object): - """Implementation of the 'Allocation' model. Attributes: @@ -20,206 +20,210 @@ class Allocation(object): references a component that you have created in your Product setup component_handle (str): The handle of the component. This references a component that you have created in your Product setup - subscription_id (int): The integer subscription ID for the allocation. - This references a unique subscription in your Site - quantity (int | str | None): The allocated quantity set in to effect - by the allocation. String for components supporting fractional - quantities - previous_quantity (int | str | None): The allocated quantity that was - in effect before this allocation was created. String for - components supporting fractional quantities + subscription_id (int): The integer subscription ID for the allocation. This + references a unique subscription in your Site + quantity (int | str | None): The allocated quantity set in to effect by the + allocation. String for components supporting fractional quantities + previous_quantity (int | str | None): The allocated quantity that was in + effect before this allocation was created. String for components + supporting fractional quantities memo (str): The memo passed when the allocation was created - timestamp (datetime): The time that the allocation was recorded, in - format and UTC timezone, i.e. 2012-11-20T22:00:37Z - created_at (datetime): Timestamp indicating when this allocation was - created - proration_upgrade_scheme (str): The scheme used if the proration was - an upgrade. This is only present when the allocation was created - mid-period. - proration_downgrade_scheme (str): The scheme used if the proration was - a downgrade. This is only present when the allocation was created + timestamp (datetime): The time that the allocation was recorded, in format + and UTC timezone, i.e. 2012-11-20T22:00:37Z + created_at (datetime): Timestamp indicating when this allocation was created + proration_upgrade_scheme (str): The scheme used if the proration was an + upgrade. This is only present when the allocation was created mid-period. + proration_downgrade_scheme (str): The scheme used if the proration was a + downgrade. This is only present when the allocation was created mid-period. price_point_id (int): The model property of type int. price_point_name (str): The model property of type str. price_point_handle (str): The model property of type str. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. previous_price_point_id (int): The model property of type int. - accrue_charge (bool): If the change in cost is an upgrade, this - determines if the charge should accrue to the next renewal or if - capture should be attempted immediately. - initiate_dunning (bool): If true, if the immediate component payment - fails, initiate dunning for the subscription. Otherwise, leave - the charges on the subscription to pay for at renewal. + accrue_charge (bool): If the change in cost is an upgrade, this determines if + the charge should accrue to the next renewal or if capture should be + attempted immediately. + initiate_dunning (bool): If true, if the immediate component payment fails, + initiate dunning for the subscription. Otherwise, leave the charges on + the subscription to pay for at renewal. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. payment (PaymentForAllocation): The model property of type PaymentForAllocation. expires_at (datetime): The model property of type datetime. used_quantity (int): The model property of type int. charge_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "allocation_id": 'allocation_id', - "component_id": 'component_id', - "component_handle": 'component_handle', - "subscription_id": 'subscription_id', - "quantity": 'quantity', - "previous_quantity": 'previous_quantity', - "memo": 'memo', - "timestamp": 'timestamp', - "created_at": 'created_at', - "proration_upgrade_scheme": 'proration_upgrade_scheme', - "proration_downgrade_scheme": 'proration_downgrade_scheme', - "price_point_id": 'price_point_id', - "price_point_name": 'price_point_name', - "price_point_handle": 'price_point_handle', - "interval": 'interval', - "interval_unit": 'interval_unit', - "previous_price_point_id": 'previous_price_point_id', - "accrue_charge": 'accrue_charge', - "initiate_dunning": 'initiate_dunning', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "payment": 'payment', - "expires_at": 'expires_at', - "used_quantity": 'used_quantity', - "charge_id": 'charge_id' + "allocation_id": "allocation_id", + "component_id": "component_id", + "component_handle": "component_handle", + "subscription_id": "subscription_id", + "quantity": "quantity", + "previous_quantity": "previous_quantity", + "memo": "memo", + "timestamp": "timestamp", + "created_at": "created_at", + "proration_upgrade_scheme": "proration_upgrade_scheme", + "proration_downgrade_scheme": "proration_downgrade_scheme", + "price_point_id": "price_point_id", + "price_point_name": "price_point_name", + "price_point_handle": "price_point_handle", + "interval": "interval", + "interval_unit": "interval_unit", + "previous_price_point_id": "previous_price_point_id", + "accrue_charge": "accrue_charge", + "initiate_dunning": "initiate_dunning", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "payment": "payment", + "expires_at": "expires_at", + "used_quantity": "used_quantity", + "charge_id": "charge_id", } _optionals = [ - 'allocation_id', - 'component_id', - 'component_handle', - 'subscription_id', - 'quantity', - 'previous_quantity', - 'memo', - 'timestamp', - 'created_at', - 'proration_upgrade_scheme', - 'proration_downgrade_scheme', - 'price_point_id', - 'price_point_name', - 'price_point_handle', - 'interval', - 'interval_unit', - 'previous_price_point_id', - 'accrue_charge', - 'initiate_dunning', - 'upgrade_charge', - 'downgrade_credit', - 'payment', - 'expires_at', - 'used_quantity', - 'charge_id', + "allocation_id", + "component_id", + "component_handle", + "subscription_id", + "quantity", + "previous_quantity", + "memo", + "timestamp", + "created_at", + "proration_upgrade_scheme", + "proration_downgrade_scheme", + "price_point_id", + "price_point_name", + "price_point_handle", + "interval", + "interval_unit", + "previous_price_point_id", + "accrue_charge", + "initiate_dunning", + "upgrade_charge", + "downgrade_credit", + "payment", + "expires_at", + "used_quantity", + "charge_id", ] _nullables = [ - 'component_handle', - 'memo', - 'interval_unit', - 'upgrade_charge', - 'downgrade_credit', - 'payment', + "component_handle", + "memo", + "interval_unit", + "upgrade_charge", + "downgrade_credit", + "payment", ] - def __init__(self, - allocation_id=APIHelper.SKIP, - component_id=APIHelper.SKIP, - component_handle=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - quantity=APIHelper.SKIP, - previous_quantity=APIHelper.SKIP, - memo=APIHelper.SKIP, - timestamp=APIHelper.SKIP, - created_at=APIHelper.SKIP, - proration_upgrade_scheme=APIHelper.SKIP, - proration_downgrade_scheme=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - price_point_name=APIHelper.SKIP, - price_point_handle=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - previous_price_point_id=APIHelper.SKIP, - accrue_charge=APIHelper.SKIP, - initiate_dunning=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - payment=APIHelper.SKIP, - expires_at=APIHelper.SKIP, - used_quantity=APIHelper.SKIP, - charge_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Allocation class""" - + def __init__( + self, + allocation_id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + component_handle=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + previous_quantity=APIHelper.SKIP, + memo=APIHelper.SKIP, + timestamp=APIHelper.SKIP, + created_at=APIHelper.SKIP, + proration_upgrade_scheme=APIHelper.SKIP, + proration_downgrade_scheme=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + price_point_name=APIHelper.SKIP, + price_point_handle=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + previous_price_point_id=APIHelper.SKIP, + accrue_charge=APIHelper.SKIP, + initiate_dunning=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + payment=APIHelper.SKIP, + expires_at=APIHelper.SKIP, + used_quantity=APIHelper.SKIP, + charge_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a Allocation instance.""" # Initialize members of the class if allocation_id is not APIHelper.SKIP: - self.allocation_id = allocation_id + self.allocation_id = allocation_id if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if component_handle is not APIHelper.SKIP: - self.component_handle = component_handle + self.component_handle = component_handle if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if previous_quantity is not APIHelper.SKIP: - self.previous_quantity = previous_quantity + self.previous_quantity = previous_quantity if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if timestamp is not APIHelper.SKIP: - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if proration_upgrade_scheme is not APIHelper.SKIP: - self.proration_upgrade_scheme = proration_upgrade_scheme + self.proration_upgrade_scheme = proration_upgrade_scheme if proration_downgrade_scheme is not APIHelper.SKIP: - self.proration_downgrade_scheme = proration_downgrade_scheme + self.proration_downgrade_scheme = proration_downgrade_scheme if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if price_point_name is not APIHelper.SKIP: - self.price_point_name = price_point_name + self.price_point_name = price_point_name if price_point_handle is not APIHelper.SKIP: - self.price_point_handle = price_point_handle + self.price_point_handle = price_point_handle if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if previous_price_point_id is not APIHelper.SKIP: - self.previous_price_point_id = previous_price_point_id + self.previous_price_point_id = previous_price_point_id if accrue_charge is not APIHelper.SKIP: - self.accrue_charge = accrue_charge + self.accrue_charge = accrue_charge if initiate_dunning is not APIHelper.SKIP: - self.initiate_dunning = initiate_dunning + self.initiate_dunning = initiate_dunning if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if payment is not APIHelper.SKIP: - self.payment = payment + self.payment = payment if expires_at is not APIHelper.SKIP: - self.expires_at = APIHelper.apply_datetime_converter(expires_at, APIHelper.RFC3339DateTime) if expires_at else None + self.expires_at =\ + APIHelper.apply_datetime_converter( + expires_at, APIHelper.RFC3339DateTime)\ + if expires_at else None if used_quantity is not APIHelper.SKIP: - self.used_quantity = used_quantity + self.used_quantity = used_quantity if charge_id is not APIHelper.SKIP: - self.charge_id = charge_id + self.charge_id = charge_id # Add additional model properties to the instance if additional_properties is None: @@ -229,7 +233,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -240,42 +244,123 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - allocation_id = dictionary.get("allocation_id") if dictionary.get("allocation_id") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if "component_handle" in dictionary.keys() else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationQuantity'), dictionary.get('quantity'), False) if dictionary.get('quantity') is not None else APIHelper.SKIP - previous_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPreviousQuantity'), dictionary.get('previous_quantity'), False) if dictionary.get('previous_quantity') is not None else APIHelper.SKIP - memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else APIHelper.SKIP - proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - price_point_name = dictionary.get("price_point_name") if dictionary.get("price_point_name") else APIHelper.SKIP - price_point_handle = dictionary.get("price_point_handle") if dictionary.get("price_point_handle") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP - previous_price_point_id = dictionary.get("previous_price_point_id") if dictionary.get("previous_price_point_id") else APIHelper.SKIP - accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP - initiate_dunning = dictionary.get("initiate_dunning") if "initiate_dunning" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP - if 'payment' in dictionary.keys(): - payment = PaymentForAllocation.from_dictionary(dictionary.get('payment')) if dictionary.get('payment') else None + allocation_id =\ + dictionary.get("allocation_id")\ + if dictionary.get("allocation_id")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + component_handle =\ + dictionary.get("component_handle")\ + if "component_handle" in dictionary.keys()\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("AllocationQuantity"), + dictionary.get("quantity"), + False)\ + if dictionary.get("quantity") is not None\ + else APIHelper.SKIP + previous_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("AllocationPreviousQuantity"), + dictionary.get("previous_quantity"), + False)\ + if dictionary.get("previous_quantity") is not None\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if "memo" in dictionary.keys()\ + else APIHelper.SKIP + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + proration_upgrade_scheme =\ + dictionary.get("proration_upgrade_scheme")\ + if dictionary.get("proration_upgrade_scheme")\ + else APIHelper.SKIP + proration_downgrade_scheme =\ + dictionary.get("proration_downgrade_scheme")\ + if dictionary.get("proration_downgrade_scheme")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + price_point_name =\ + dictionary.get("price_point_name")\ + if dictionary.get("price_point_name")\ + else APIHelper.SKIP + price_point_handle =\ + dictionary.get("price_point_handle")\ + if dictionary.get("price_point_handle")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + previous_price_point_id =\ + dictionary.get("previous_price_point_id")\ + if dictionary.get("previous_price_point_id")\ + else APIHelper.SKIP + accrue_charge =\ + dictionary.get("accrue_charge")\ + if "accrue_charge" in dictionary.keys()\ + else APIHelper.SKIP + initiate_dunning =\ + dictionary.get("initiate_dunning")\ + if "initiate_dunning" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + if "payment" in dictionary.keys(): + payment =\ + PaymentForAllocation.from_dictionary( + dictionary.get("payment"))\ + if dictionary.get("payment") else None else: payment = APIHelper.SKIP - expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else APIHelper.SKIP - used_quantity = dictionary.get("used_quantity") if dictionary.get("used_quantity") else APIHelper.SKIP - charge_id = dictionary.get("charge_id") if dictionary.get("charge_id") else APIHelper.SKIP + expires_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("expires_at")).datetime\ + if dictionary.get("expires_at") else APIHelper.SKIP + used_quantity =\ + dictionary.get("used_quantity")\ + if dictionary.get("used_quantity")\ + else APIHelper.SKIP + charge_id =\ + dictionary.get("charge_id")\ + if dictionary.get("charge_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(allocation_id, component_id, @@ -305,59 +390,319 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'allocation_id={(self.allocation_id if hasattr(self, "allocation_id") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'previous_quantity={(self.previous_quantity if hasattr(self, "previous_quantity") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!r}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!r}, ' - f'price_point_handle={(self.price_point_handle if hasattr(self, "price_point_handle") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'previous_price_point_id={(self.previous_price_point_id if hasattr(self, "previous_price_point_id") else None)!r}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!r}, ' - f'initiate_dunning={(self.initiate_dunning if hasattr(self, "initiate_dunning") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'payment={(self.payment if hasattr(self, "payment") else None)!r}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'used_quantity={(self.used_quantity if hasattr(self, "used_quantity") else None)!r}, ' - f'charge_id={(self.charge_id if hasattr(self, "charge_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _allocation_id=( + self.allocation_id + if hasattr(self, "allocation_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _previous_quantity=( + self.previous_quantity + if hasattr(self, "previous_quantity") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _price_point_handle=( + self.price_point_handle + if hasattr(self, "price_point_handle") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _previous_price_point_id=( + self.previous_price_point_id + if hasattr(self, "previous_price_point_id") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _initiate_dunning=( + self.initiate_dunning + if hasattr(self, "initiate_dunning") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _payment=( + self.payment + if hasattr(self, "payment") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _used_quantity=( + self.used_quantity + if hasattr(self, "used_quantity") + else None + ) + _charge_id=( + self.charge_id + if hasattr(self, "charge_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation_id={_allocation_id!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"subscription_id={_subscription_id!r}, " + f"quantity={_quantity!r}, " + f"previous_quantity={_previous_quantity!r}, " + f"memo={_memo!r}, " + f"timestamp={_timestamp!r}, " + f"created_at={_created_at!r}, " + f"proration_upgrade_scheme={_proration_upgrade_scheme!r}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!r}, " + f"price_point_id={_price_point_id!r}, " + f"price_point_name={_price_point_name!r}, " + f"price_point_handle={_price_point_handle!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"previous_price_point_id={_previous_price_point_id!r}, " + f"accrue_charge={_accrue_charge!r}, " + f"initiate_dunning={_initiate_dunning!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"payment={_payment!r}, " + f"expires_at={_expires_at!r}, " + f"used_quantity={_used_quantity!r}, " + f"charge_id={_charge_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'allocation_id={(self.allocation_id if hasattr(self, "allocation_id") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'previous_quantity={(self.previous_quantity if hasattr(self, "previous_quantity") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!s}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!s}, ' - f'price_point_handle={(self.price_point_handle if hasattr(self, "price_point_handle") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'previous_price_point_id={(self.previous_price_point_id if hasattr(self, "previous_price_point_id") else None)!s}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!s}, ' - f'initiate_dunning={(self.initiate_dunning if hasattr(self, "initiate_dunning") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'payment={(self.payment if hasattr(self, "payment") else None)!s}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'used_quantity={(self.used_quantity if hasattr(self, "used_quantity") else None)!s}, ' - f'charge_id={(self.charge_id if hasattr(self, "charge_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _allocation_id=( + self.allocation_id + if hasattr(self, "allocation_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _previous_quantity=( + self.previous_quantity + if hasattr(self, "previous_quantity") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _price_point_handle=( + self.price_point_handle + if hasattr(self, "price_point_handle") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _previous_price_point_id=( + self.previous_price_point_id + if hasattr(self, "previous_price_point_id") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _initiate_dunning=( + self.initiate_dunning + if hasattr(self, "initiate_dunning") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _payment=( + self.payment + if hasattr(self, "payment") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _used_quantity=( + self.used_quantity + if hasattr(self, "used_quantity") + else None + ) + _charge_id=( + self.charge_id + if hasattr(self, "charge_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation_id={_allocation_id!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"subscription_id={_subscription_id!s}, " + f"quantity={_quantity!s}, " + f"previous_quantity={_previous_quantity!s}, " + f"memo={_memo!s}, " + f"timestamp={_timestamp!s}, " + f"created_at={_created_at!s}, " + f"proration_upgrade_scheme={_proration_upgrade_scheme!s}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!s}, " + f"price_point_id={_price_point_id!s}, " + f"price_point_name={_price_point_name!s}, " + f"price_point_handle={_price_point_handle!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"previous_price_point_id={_previous_price_point_id!s}, " + f"accrue_charge={_accrue_charge!s}, " + f"initiate_dunning={_initiate_dunning!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"payment={_payment!s}, " + f"expires_at={_expires_at!s}, " + f"used_quantity={_used_quantity!s}, " + f"charge_id={_charge_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation_expiration_date.py b/advancedbilling/models/allocation_expiration_date.py index 2fae784a..be257c3b 100644 --- a/advancedbilling/models/allocation_expiration_date.py +++ b/advancedbilling/models/allocation_expiration_date.py @@ -1,42 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AllocationExpirationDate(object): - """Implementation of the 'Allocation Expiration Date' model. Attributes: expires_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "expires_at": 'expires_at' + "expires_at": "expires_at", } _optionals = [ - 'expires_at', + "expires_at", ] - def __init__(self, - expires_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AllocationExpirationDate class""" - + def __init__( + self, + expires_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a AllocationExpirationDate instance.""" # Initialize members of the class if expires_at is not APIHelper.SKIP: - self.expires_at = APIHelper.apply_datetime_converter(expires_at, APIHelper.RFC3339DateTime) if expires_at else None + self.expires_at =\ + APIHelper.apply_datetime_converter( + expires_at, APIHelper.RFC3339DateTime)\ + if expires_at else None # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +58,48 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else APIHelper.SKIP + expires_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("expires_at")).datetime\ + if dictionary.get("expires_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(expires_at, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"expires_at={_expires_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"expires_at={_expires_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation_preview.py b/advancedbilling/models/allocation_preview.py index 9dd73d29..2b651660 100644 --- a/advancedbilling/models/allocation_preview.py +++ b/advancedbilling/models/allocation_preview.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.allocation_preview_item import AllocationPreviewItem -from advancedbilling.models.allocation_preview_line_item import AllocationPreviewLineItem +from advancedbilling.models.allocation_preview_item import ( + AllocationPreviewItem, +) +from advancedbilling.models.allocation_preview_line_item import ( + AllocationPreviewLineItem, +) class AllocationPreview(object): - """Implementation of the 'Allocation Preview' model. Attributes: @@ -25,96 +27,102 @@ class AllocationPreview(object): direction (AllocationPreviewDirection): The model property of type AllocationPreviewDirection. proration_scheme (str): The model property of type str. - line_items (List[AllocationPreviewLineItem]): The model property of - type List[AllocationPreviewLineItem]. + line_items (List[AllocationPreviewLineItem]): The model property of type + List[AllocationPreviewLineItem]. accrue_charge (bool): The model property of type bool. allocations (List[AllocationPreviewItem]): The model property of type List[AllocationPreviewItem]. period_type (str): The model property of type str. - existing_balance_in_cents (int): An integer representing the amount of - the subscription's current balance - additional_properties (Dict[str, object]): The additional properties - for the model. + existing_balance_in_cents (int): An integer representing the amount of the + subscription's current balance + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "start_date": 'start_date', - "end_date": 'end_date', - "subtotal_in_cents": 'subtotal_in_cents', - "total_tax_in_cents": 'total_tax_in_cents', - "total_discount_in_cents": 'total_discount_in_cents', - "total_in_cents": 'total_in_cents', - "direction": 'direction', - "proration_scheme": 'proration_scheme', - "line_items": 'line_items', - "accrue_charge": 'accrue_charge', - "allocations": 'allocations', - "period_type": 'period_type', - "existing_balance_in_cents": 'existing_balance_in_cents' + "start_date": "start_date", + "end_date": "end_date", + "subtotal_in_cents": "subtotal_in_cents", + "total_tax_in_cents": "total_tax_in_cents", + "total_discount_in_cents": "total_discount_in_cents", + "total_in_cents": "total_in_cents", + "direction": "direction", + "proration_scheme": "proration_scheme", + "line_items": "line_items", + "accrue_charge": "accrue_charge", + "allocations": "allocations", + "period_type": "period_type", + "existing_balance_in_cents": "existing_balance_in_cents", } _optionals = [ - 'start_date', - 'end_date', - 'subtotal_in_cents', - 'total_tax_in_cents', - 'total_discount_in_cents', - 'total_in_cents', - 'direction', - 'proration_scheme', - 'line_items', - 'accrue_charge', - 'allocations', - 'period_type', - 'existing_balance_in_cents', + "start_date", + "end_date", + "subtotal_in_cents", + "total_tax_in_cents", + "total_discount_in_cents", + "total_in_cents", + "direction", + "proration_scheme", + "line_items", + "accrue_charge", + "allocations", + "period_type", + "existing_balance_in_cents", ] - def __init__(self, - start_date=APIHelper.SKIP, - end_date=APIHelper.SKIP, - subtotal_in_cents=APIHelper.SKIP, - total_tax_in_cents=APIHelper.SKIP, - total_discount_in_cents=APIHelper.SKIP, - total_in_cents=APIHelper.SKIP, - direction=APIHelper.SKIP, - proration_scheme=APIHelper.SKIP, - line_items=APIHelper.SKIP, - accrue_charge=APIHelper.SKIP, - allocations=APIHelper.SKIP, - period_type=APIHelper.SKIP, - existing_balance_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AllocationPreview class""" - + def __init__( + self, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + subtotal_in_cents=APIHelper.SKIP, + total_tax_in_cents=APIHelper.SKIP, + total_discount_in_cents=APIHelper.SKIP, + total_in_cents=APIHelper.SKIP, + direction=APIHelper.SKIP, + proration_scheme=APIHelper.SKIP, + line_items=APIHelper.SKIP, + accrue_charge=APIHelper.SKIP, + allocations=APIHelper.SKIP, + period_type=APIHelper.SKIP, + existing_balance_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a AllocationPreview instance.""" # Initialize members of the class if start_date is not APIHelper.SKIP: - self.start_date = APIHelper.apply_datetime_converter(start_date, APIHelper.RFC3339DateTime) if start_date else None + self.start_date =\ + APIHelper.apply_datetime_converter( + start_date, APIHelper.RFC3339DateTime)\ + if start_date else None if end_date is not APIHelper.SKIP: - self.end_date = APIHelper.apply_datetime_converter(end_date, APIHelper.RFC3339DateTime) if end_date else None + self.end_date =\ + APIHelper.apply_datetime_converter( + end_date, APIHelper.RFC3339DateTime)\ + if end_date else None if subtotal_in_cents is not APIHelper.SKIP: - self.subtotal_in_cents = subtotal_in_cents + self.subtotal_in_cents = subtotal_in_cents if total_tax_in_cents is not APIHelper.SKIP: - self.total_tax_in_cents = total_tax_in_cents + self.total_tax_in_cents = total_tax_in_cents if total_discount_in_cents is not APIHelper.SKIP: - self.total_discount_in_cents = total_discount_in_cents + self.total_discount_in_cents = total_discount_in_cents if total_in_cents is not APIHelper.SKIP: - self.total_in_cents = total_in_cents + self.total_in_cents = total_in_cents if direction is not APIHelper.SKIP: - self.direction = direction + self.direction = direction if proration_scheme is not APIHelper.SKIP: - self.proration_scheme = proration_scheme + self.proration_scheme = proration_scheme if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if accrue_charge is not APIHelper.SKIP: - self.accrue_charge = accrue_charge + self.accrue_charge = accrue_charge if allocations is not APIHelper.SKIP: - self.allocations = allocations + self.allocations = allocations if period_type is not APIHelper.SKIP: - self.period_type = period_type + self.period_type = period_type if existing_balance_in_cents is not APIHelper.SKIP: - self.existing_balance_in_cents = existing_balance_in_cents + self.existing_balance_in_cents = existing_balance_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -124,7 +132,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -135,34 +143,73 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - start_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("start_date")).datetime if dictionary.get("start_date") else APIHelper.SKIP - end_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_date")).datetime if dictionary.get("end_date") else APIHelper.SKIP - subtotal_in_cents = dictionary.get("subtotal_in_cents") if dictionary.get("subtotal_in_cents") else APIHelper.SKIP - total_tax_in_cents = dictionary.get("total_tax_in_cents") if dictionary.get("total_tax_in_cents") else APIHelper.SKIP - total_discount_in_cents = dictionary.get("total_discount_in_cents") if dictionary.get("total_discount_in_cents") else APIHelper.SKIP - total_in_cents = dictionary.get("total_in_cents") if dictionary.get("total_in_cents") else APIHelper.SKIP - direction = dictionary.get("direction") if dictionary.get("direction") else APIHelper.SKIP - proration_scheme = dictionary.get("proration_scheme") if dictionary.get("proration_scheme") else APIHelper.SKIP + start_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("start_date")).datetime\ + if dictionary.get("start_date") else APIHelper.SKIP + end_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("end_date")).datetime\ + if dictionary.get("end_date") else APIHelper.SKIP + subtotal_in_cents =\ + dictionary.get("subtotal_in_cents")\ + if dictionary.get("subtotal_in_cents")\ + else APIHelper.SKIP + total_tax_in_cents =\ + dictionary.get("total_tax_in_cents")\ + if dictionary.get("total_tax_in_cents")\ + else APIHelper.SKIP + total_discount_in_cents =\ + dictionary.get("total_discount_in_cents")\ + if dictionary.get("total_discount_in_cents")\ + else APIHelper.SKIP + total_in_cents =\ + dictionary.get("total_in_cents")\ + if dictionary.get("total_in_cents")\ + else APIHelper.SKIP + direction =\ + dictionary.get("direction")\ + if dictionary.get("direction")\ + else APIHelper.SKIP + proration_scheme =\ + dictionary.get("proration_scheme")\ + if dictionary.get("proration_scheme")\ + else APIHelper.SKIP line_items = None - if dictionary.get('line_items') is not None: - line_items = [AllocationPreviewLineItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + AllocationPreviewLineItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP - accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP + accrue_charge =\ + dictionary.get("accrue_charge")\ + if "accrue_charge" in dictionary.keys()\ + else APIHelper.SKIP allocations = None - if dictionary.get('allocations') is not None: - allocations = [AllocationPreviewItem.from_dictionary(x) for x in dictionary.get('allocations')] + if dictionary.get("allocations") is not None: + allocations = [ + AllocationPreviewItem.from_dictionary(x) + for x in dictionary.get("allocations") + ] else: allocations = APIHelper.SKIP - period_type = dictionary.get("period_type") if dictionary.get("period_type") else APIHelper.SKIP - existing_balance_in_cents = dictionary.get("existing_balance_in_cents") if dictionary.get("existing_balance_in_cents") else APIHelper.SKIP + period_type =\ + dictionary.get("period_type")\ + if dictionary.get("period_type")\ + else APIHelper.SKIP + existing_balance_in_cents =\ + dictionary.get("existing_balance_in_cents")\ + if dictionary.get("existing_balance_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(start_date, end_date, @@ -180,35 +227,175 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'subtotal_in_cents={(self.subtotal_in_cents if hasattr(self, "subtotal_in_cents") else None)!r}, ' - f'total_tax_in_cents={(self.total_tax_in_cents if hasattr(self, "total_tax_in_cents") else None)!r}, ' - f'total_discount_in_cents={(self.total_discount_in_cents if hasattr(self, "total_discount_in_cents") else None)!r}, ' - f'total_in_cents={(self.total_in_cents if hasattr(self, "total_in_cents") else None)!r}, ' - f'direction={(self.direction if hasattr(self, "direction") else None)!r}, ' - f'proration_scheme={(self.proration_scheme if hasattr(self, "proration_scheme") else None)!r}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!r}, ' - f'allocations={(self.allocations if hasattr(self, "allocations") else None)!r}, ' - f'period_type={(self.period_type if hasattr(self, "period_type") else None)!r}, ' - f'existing_balance_in_cents={(self.existing_balance_in_cents if hasattr(self, "existing_balance_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _subtotal_in_cents=( + self.subtotal_in_cents + if hasattr(self, "subtotal_in_cents") + else None + ) + _total_tax_in_cents=( + self.total_tax_in_cents + if hasattr(self, "total_tax_in_cents") + else None + ) + _total_discount_in_cents=( + self.total_discount_in_cents + if hasattr(self, "total_discount_in_cents") + else None + ) + _total_in_cents=( + self.total_in_cents + if hasattr(self, "total_in_cents") + else None + ) + _direction=( + self.direction + if hasattr(self, "direction") + else None + ) + _proration_scheme=( + self.proration_scheme + if hasattr(self, "proration_scheme") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _allocations=( + self.allocations + if hasattr(self, "allocations") + else None + ) + _period_type=( + self.period_type + if hasattr(self, "period_type") + else None + ) + _existing_balance_in_cents=( + self.existing_balance_in_cents + if hasattr(self, "existing_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"start_date={_start_date!r}, " + f"end_date={_end_date!r}, " + f"subtotal_in_cents={_subtotal_in_cents!r}, " + f"total_tax_in_cents={_total_tax_in_cents!r}, " + f"total_discount_in_cents={_total_discount_in_cents!r}, " + f"total_in_cents={_total_in_cents!r}, " + f"direction={_direction!r}, " + f"proration_scheme={_proration_scheme!r}, " + f"line_items={_line_items!r}, " + f"accrue_charge={_accrue_charge!r}, " + f"allocations={_allocations!r}, " + f"period_type={_period_type!r}, " + f"existing_balance_in_cents={_existing_balance_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'subtotal_in_cents={(self.subtotal_in_cents if hasattr(self, "subtotal_in_cents") else None)!s}, ' - f'total_tax_in_cents={(self.total_tax_in_cents if hasattr(self, "total_tax_in_cents") else None)!s}, ' - f'total_discount_in_cents={(self.total_discount_in_cents if hasattr(self, "total_discount_in_cents") else None)!s}, ' - f'total_in_cents={(self.total_in_cents if hasattr(self, "total_in_cents") else None)!s}, ' - f'direction={(self.direction if hasattr(self, "direction") else None)!s}, ' - f'proration_scheme={(self.proration_scheme if hasattr(self, "proration_scheme") else None)!s}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!s}, ' - f'allocations={(self.allocations if hasattr(self, "allocations") else None)!s}, ' - f'period_type={(self.period_type if hasattr(self, "period_type") else None)!s}, ' - f'existing_balance_in_cents={(self.existing_balance_in_cents if hasattr(self, "existing_balance_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _subtotal_in_cents=( + self.subtotal_in_cents + if hasattr(self, "subtotal_in_cents") + else None + ) + _total_tax_in_cents=( + self.total_tax_in_cents + if hasattr(self, "total_tax_in_cents") + else None + ) + _total_discount_in_cents=( + self.total_discount_in_cents + if hasattr(self, "total_discount_in_cents") + else None + ) + _total_in_cents=( + self.total_in_cents + if hasattr(self, "total_in_cents") + else None + ) + _direction=( + self.direction + if hasattr(self, "direction") + else None + ) + _proration_scheme=( + self.proration_scheme + if hasattr(self, "proration_scheme") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _allocations=( + self.allocations + if hasattr(self, "allocations") + else None + ) + _period_type=( + self.period_type + if hasattr(self, "period_type") + else None + ) + _existing_balance_in_cents=( + self.existing_balance_in_cents + if hasattr(self, "existing_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"start_date={_start_date!s}, " + f"end_date={_end_date!s}, " + f"subtotal_in_cents={_subtotal_in_cents!s}, " + f"total_tax_in_cents={_total_tax_in_cents!s}, " + f"total_discount_in_cents={_total_discount_in_cents!s}, " + f"total_in_cents={_total_in_cents!s}, " + f"direction={_direction!s}, " + f"proration_scheme={_proration_scheme!s}, " + f"line_items={_line_items!s}, " + f"accrue_charge={_accrue_charge!s}, " + f"allocations={_allocations!s}, " + f"period_type={_period_type!s}, " + f"existing_balance_in_cents={_existing_balance_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation_preview_direction.py b/advancedbilling/models/allocation_preview_direction.py index 774fb682..3f6234c0 100644 --- a/advancedbilling/models/allocation_preview_direction.py +++ b/advancedbilling/models/allocation_preview_direction.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class AllocationPreviewDirection(object): - """Implementation of the 'Allocation Preview Direction' enum. Attributes: UPGRADE: The enum member of type str. DOWNGRADE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - UPGRADE = 'upgrade' - DOWNGRADE = 'downgrade' + UPGRADE = "upgrade" + + DOWNGRADE = "downgrade" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/allocation_preview_item.py b/advancedbilling/models/allocation_preview_item.py index 77b0a8cd..09f47fea 100644 --- a/advancedbilling/models/allocation_preview_item.py +++ b/advancedbilling/models/allocation_preview_item.py @@ -1,166 +1,161 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AllocationPreviewItem(object): - """Implementation of the 'Allocation Preview Item' model. Attributes: component_id (int): The model property of type int. subscription_id (int): The model property of type int. - quantity (int | str | None): The model property of type int | str | + quantity (int | str | None): The model property of type int | str | None. + previous_quantity (int | str | None): The model property of type int | str | None. - previous_quantity (int | str | None): The model property of type int | - str | None. memo (str): The model property of type str. timestamp (str): The model property of type str. proration_upgrade_scheme (str): The model property of type str. proration_downgrade_scheme (str): The model property of type str. accrue_charge (bool): The model property of type bool. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. price_point_id (int): The model property of type int. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. previous_price_point_id (int): The model property of type int. price_point_handle (str): The model property of type str. price_point_name (str): The model property of type str. component_handle (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "subscription_id": 'subscription_id', - "quantity": 'quantity', - "previous_quantity": 'previous_quantity', - "memo": 'memo', - "timestamp": 'timestamp', - "proration_upgrade_scheme": 'proration_upgrade_scheme', - "proration_downgrade_scheme": 'proration_downgrade_scheme', - "accrue_charge": 'accrue_charge', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "price_point_id": 'price_point_id', - "interval": 'interval', - "interval_unit": 'interval_unit', - "previous_price_point_id": 'previous_price_point_id', - "price_point_handle": 'price_point_handle', - "price_point_name": 'price_point_name', - "component_handle": 'component_handle' + "component_id": "component_id", + "subscription_id": "subscription_id", + "quantity": "quantity", + "previous_quantity": "previous_quantity", + "memo": "memo", + "timestamp": "timestamp", + "proration_upgrade_scheme": "proration_upgrade_scheme", + "proration_downgrade_scheme": "proration_downgrade_scheme", + "accrue_charge": "accrue_charge", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "price_point_id": "price_point_id", + "interval": "interval", + "interval_unit": "interval_unit", + "previous_price_point_id": "previous_price_point_id", + "price_point_handle": "price_point_handle", + "price_point_name": "price_point_name", + "component_handle": "component_handle", } _optionals = [ - 'component_id', - 'subscription_id', - 'quantity', - 'previous_quantity', - 'memo', - 'timestamp', - 'proration_upgrade_scheme', - 'proration_downgrade_scheme', - 'accrue_charge', - 'upgrade_charge', - 'downgrade_credit', - 'price_point_id', - 'interval', - 'interval_unit', - 'previous_price_point_id', - 'price_point_handle', - 'price_point_name', - 'component_handle', + "component_id", + "subscription_id", + "quantity", + "previous_quantity", + "memo", + "timestamp", + "proration_upgrade_scheme", + "proration_downgrade_scheme", + "accrue_charge", + "upgrade_charge", + "downgrade_credit", + "price_point_id", + "interval", + "interval_unit", + "previous_price_point_id", + "price_point_handle", + "price_point_name", + "component_handle", ] _nullables = [ - 'memo', - 'timestamp', - 'upgrade_charge', - 'downgrade_credit', - 'interval_unit', - 'component_handle', + "memo", + "timestamp", + "upgrade_charge", + "downgrade_credit", + "interval_unit", + "component_handle", ] - def __init__(self, - component_id=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - quantity=APIHelper.SKIP, - previous_quantity=APIHelper.SKIP, - memo=APIHelper.SKIP, - timestamp=APIHelper.SKIP, - proration_upgrade_scheme=APIHelper.SKIP, - proration_downgrade_scheme=APIHelper.SKIP, - accrue_charge=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - previous_price_point_id=APIHelper.SKIP, - price_point_handle=APIHelper.SKIP, - price_point_name=APIHelper.SKIP, - component_handle=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AllocationPreviewItem class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + previous_quantity=APIHelper.SKIP, + memo=APIHelper.SKIP, + timestamp=APIHelper.SKIP, + proration_upgrade_scheme=APIHelper.SKIP, + proration_downgrade_scheme=APIHelper.SKIP, + accrue_charge=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + previous_price_point_id=APIHelper.SKIP, + price_point_handle=APIHelper.SKIP, + price_point_name=APIHelper.SKIP, + component_handle=APIHelper.SKIP, + additional_properties=None): + """Initialize a AllocationPreviewItem instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if previous_quantity is not APIHelper.SKIP: - self.previous_quantity = previous_quantity + self.previous_quantity = previous_quantity if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if timestamp is not APIHelper.SKIP: - self.timestamp = timestamp + self.timestamp = timestamp if proration_upgrade_scheme is not APIHelper.SKIP: - self.proration_upgrade_scheme = proration_upgrade_scheme + self.proration_upgrade_scheme = proration_upgrade_scheme if proration_downgrade_scheme is not APIHelper.SKIP: - self.proration_downgrade_scheme = proration_downgrade_scheme + self.proration_downgrade_scheme = proration_downgrade_scheme if accrue_charge is not APIHelper.SKIP: - self.accrue_charge = accrue_charge + self.accrue_charge = accrue_charge if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if previous_price_point_id is not APIHelper.SKIP: - self.previous_price_point_id = previous_price_point_id + self.previous_price_point_id = previous_price_point_id if price_point_handle is not APIHelper.SKIP: - self.price_point_handle = price_point_handle + self.price_point_handle = price_point_handle if price_point_name is not APIHelper.SKIP: - self.price_point_name = price_point_name + self.price_point_name = price_point_name if component_handle is not APIHelper.SKIP: - self.component_handle = component_handle + self.component_handle = component_handle # Add additional model properties to the instance if additional_properties is None: @@ -170,7 +165,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -181,32 +176,95 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPreviewItemQuantity'), dictionary.get('quantity'), False) if dictionary.get('quantity') is not None else APIHelper.SKIP - previous_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPreviewItemPreviousQuantity'), dictionary.get('previous_quantity'), False) if dictionary.get('previous_quantity') is not None else APIHelper.SKIP - memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP - timestamp = dictionary.get("timestamp") if "timestamp" in dictionary.keys() else APIHelper.SKIP - proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else APIHelper.SKIP - proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else APIHelper.SKIP - accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP - previous_price_point_id = dictionary.get("previous_price_point_id") if dictionary.get("previous_price_point_id") else APIHelper.SKIP - price_point_handle = dictionary.get("price_point_handle") if dictionary.get("price_point_handle") else APIHelper.SKIP - price_point_name = dictionary.get("price_point_name") if dictionary.get("price_point_name") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if "component_handle" in dictionary.keys() else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("AllocationPreviewItemQuantity"), + dictionary.get("quantity"), + False)\ + if dictionary.get("quantity") is not None\ + else APIHelper.SKIP + previous_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("AllocationPreviewItemPreviousQuantity"), + dictionary.get("previous_quantity"), + False)\ + if dictionary.get("previous_quantity") is not None\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if "memo" in dictionary.keys()\ + else APIHelper.SKIP + timestamp =\ + dictionary.get("timestamp")\ + if "timestamp" in dictionary.keys()\ + else APIHelper.SKIP + proration_upgrade_scheme =\ + dictionary.get("proration_upgrade_scheme")\ + if dictionary.get("proration_upgrade_scheme")\ + else APIHelper.SKIP + proration_downgrade_scheme =\ + dictionary.get("proration_downgrade_scheme")\ + if dictionary.get("proration_downgrade_scheme")\ + else APIHelper.SKIP + accrue_charge =\ + dictionary.get("accrue_charge")\ + if "accrue_charge" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + previous_price_point_id =\ + dictionary.get("previous_price_point_id")\ + if dictionary.get("previous_price_point_id")\ + else APIHelper.SKIP + price_point_handle =\ + dictionary.get("price_point_handle")\ + if dictionary.get("price_point_handle")\ + else APIHelper.SKIP + price_point_name =\ + dictionary.get("price_point_name")\ + if dictionary.get("price_point_name")\ + else APIHelper.SKIP + component_handle =\ + dictionary.get("component_handle")\ + if "component_handle" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, subscription_id, @@ -229,45 +287,235 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'previous_quantity={(self.previous_quantity if hasattr(self, "previous_quantity") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!r}, ' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!r}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!r}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'previous_price_point_id={(self.previous_price_point_id if hasattr(self, "previous_price_point_id") else None)!r}, ' - f'price_point_handle={(self.price_point_handle if hasattr(self, "price_point_handle") else None)!r}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!r}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _previous_quantity=( + self.previous_quantity + if hasattr(self, "previous_quantity") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _previous_price_point_id=( + self.previous_price_point_id + if hasattr(self, "previous_price_point_id") + else None + ) + _price_point_handle=( + self.price_point_handle + if hasattr(self, "price_point_handle") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"quantity={_quantity!r}, " + f"previous_quantity={_previous_quantity!r}, " + f"memo={_memo!r}, " + f"timestamp={_timestamp!r}, " + f"proration_upgrade_scheme={_proration_upgrade_scheme!r}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!r}, " + f"accrue_charge={_accrue_charge!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"price_point_id={_price_point_id!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"previous_price_point_id={_previous_price_point_id!r}, " + f"price_point_handle={_price_point_handle!r}, " + f"price_point_name={_price_point_name!r}, " + f"component_handle={_component_handle!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'previous_quantity={(self.previous_quantity if hasattr(self, "previous_quantity") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!s}, ' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!s}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!s}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'previous_price_point_id={(self.previous_price_point_id if hasattr(self, "previous_price_point_id") else None)!s}, ' - f'price_point_handle={(self.price_point_handle if hasattr(self, "price_point_handle") else None)!s}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!s}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _previous_quantity=( + self.previous_quantity + if hasattr(self, "previous_quantity") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _previous_price_point_id=( + self.previous_price_point_id + if hasattr(self, "previous_price_point_id") + else None + ) + _price_point_handle=( + self.price_point_handle + if hasattr(self, "price_point_handle") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"quantity={_quantity!s}, " + f"previous_quantity={_previous_quantity!s}, " + f"memo={_memo!s}, " + f"timestamp={_timestamp!s}, " + f"proration_upgrade_scheme={_proration_upgrade_scheme!s}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!s}, " + f"accrue_charge={_accrue_charge!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"price_point_id={_price_point_id!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"previous_price_point_id={_previous_price_point_id!s}, " + f"price_point_handle={_price_point_handle!s}, " + f"price_point_name={_price_point_name!s}, " + f"component_handle={_component_handle!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation_preview_line_item.py b/advancedbilling/models/allocation_preview_line_item.py index 5651cb75..8f720f98 100644 --- a/advancedbilling/models/allocation_preview_line_item.py +++ b/advancedbilling/models/allocation_preview_line_item.py @@ -1,93 +1,91 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AllocationPreviewLineItem(object): - """Implementation of the 'Allocation Preview Line Item' model. Attributes: transaction_type (LineItemTransactionType): A handle for the line item transaction type - kind (AllocationPreviewLineItemKind): A handle for the line item kind - for allocation preview + kind (AllocationPreviewLineItemKind): A handle for the line item kind for + allocation preview amount_in_cents (int): The model property of type int. memo (str): The model property of type str. discount_amount_in_cents (int): The model property of type int. taxable_amount_in_cents (int): The model property of type int. component_id (int): The model property of type int. component_handle (str): The model property of type str. - direction (AllocationPreviewDirection): Visible when using - Fine-grained Component Control - additional_properties (Dict[str, object]): The additional properties - for the model. + direction (AllocationPreviewDirection): Visible when using Fine-grained + Component Control + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "transaction_type": 'transaction_type', - "kind": 'kind', - "amount_in_cents": 'amount_in_cents', - "memo": 'memo', - "discount_amount_in_cents": 'discount_amount_in_cents', - "taxable_amount_in_cents": 'taxable_amount_in_cents', - "component_id": 'component_id', - "component_handle": 'component_handle', - "direction": 'direction' + "transaction_type": "transaction_type", + "kind": "kind", + "amount_in_cents": "amount_in_cents", + "memo": "memo", + "discount_amount_in_cents": "discount_amount_in_cents", + "taxable_amount_in_cents": "taxable_amount_in_cents", + "component_id": "component_id", + "component_handle": "component_handle", + "direction": "direction", } _optionals = [ - 'transaction_type', - 'kind', - 'amount_in_cents', - 'memo', - 'discount_amount_in_cents', - 'taxable_amount_in_cents', - 'component_id', - 'component_handle', - 'direction', + "transaction_type", + "kind", + "amount_in_cents", + "memo", + "discount_amount_in_cents", + "taxable_amount_in_cents", + "component_id", + "component_handle", + "direction", ] - def __init__(self, - transaction_type=APIHelper.SKIP, - kind=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - memo=APIHelper.SKIP, - discount_amount_in_cents=APIHelper.SKIP, - taxable_amount_in_cents=APIHelper.SKIP, - component_id=APIHelper.SKIP, - component_handle=APIHelper.SKIP, - direction=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AllocationPreviewLineItem class""" - + def __init__( + self, + transaction_type=APIHelper.SKIP, + kind=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + memo=APIHelper.SKIP, + discount_amount_in_cents=APIHelper.SKIP, + taxable_amount_in_cents=APIHelper.SKIP, + component_id=APIHelper.SKIP, + component_handle=APIHelper.SKIP, + direction=APIHelper.SKIP, + additional_properties=None): + """Initialize a AllocationPreviewLineItem instance.""" # Initialize members of the class if transaction_type is not APIHelper.SKIP: - self.transaction_type = transaction_type + self.transaction_type = transaction_type if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if discount_amount_in_cents is not APIHelper.SKIP: - self.discount_amount_in_cents = discount_amount_in_cents + self.discount_amount_in_cents = discount_amount_in_cents if taxable_amount_in_cents is not APIHelper.SKIP: - self.taxable_amount_in_cents = taxable_amount_in_cents + self.taxable_amount_in_cents = taxable_amount_in_cents if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if component_handle is not APIHelper.SKIP: - self.component_handle = component_handle + self.component_handle = component_handle if direction is not APIHelper.SKIP: - self.direction = direction + self.direction = direction # Add additional model properties to the instance if additional_properties is None: @@ -97,7 +95,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -108,22 +106,51 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - transaction_type = dictionary.get("transaction_type") if dictionary.get("transaction_type") else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - discount_amount_in_cents = dictionary.get("discount_amount_in_cents") if dictionary.get("discount_amount_in_cents") else APIHelper.SKIP - taxable_amount_in_cents = dictionary.get("taxable_amount_in_cents") if dictionary.get("taxable_amount_in_cents") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else APIHelper.SKIP - direction = dictionary.get("direction") if dictionary.get("direction") else APIHelper.SKIP + transaction_type =\ + dictionary.get("transaction_type")\ + if dictionary.get("transaction_type")\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + discount_amount_in_cents =\ + dictionary.get("discount_amount_in_cents")\ + if dictionary.get("discount_amount_in_cents")\ + else APIHelper.SKIP + taxable_amount_in_cents =\ + dictionary.get("taxable_amount_in_cents")\ + if dictionary.get("taxable_amount_in_cents")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + component_handle =\ + dictionary.get("component_handle")\ + if dictionary.get("component_handle")\ + else APIHelper.SKIP + direction =\ + dictionary.get("direction")\ + if dictionary.get("direction")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(transaction_type, kind, @@ -137,27 +164,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'transaction_type={(self.transaction_type if hasattr(self, "transaction_type") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'discount_amount_in_cents={(self.discount_amount_in_cents if hasattr(self, "discount_amount_in_cents") else None)!r}, ' - f'taxable_amount_in_cents={(self.taxable_amount_in_cents if hasattr(self, "taxable_amount_in_cents") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!r}, ' - f'direction={(self.direction if hasattr(self, "direction") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _transaction_type=( + self.transaction_type + if hasattr(self, "transaction_type") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _discount_amount_in_cents=( + self.discount_amount_in_cents + if hasattr(self, "discount_amount_in_cents") + else None + ) + _taxable_amount_in_cents=( + self.taxable_amount_in_cents + if hasattr(self, "taxable_amount_in_cents") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _direction=( + self.direction + if hasattr(self, "direction") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_type={_transaction_type!r}, " + f"kind={_kind!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"memo={_memo!r}, " + f"discount_amount_in_cents={_discount_amount_in_cents!r}, " + f"taxable_amount_in_cents={_taxable_amount_in_cents!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"direction={_direction!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'transaction_type={(self.transaction_type if hasattr(self, "transaction_type") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'discount_amount_in_cents={(self.discount_amount_in_cents if hasattr(self, "discount_amount_in_cents") else None)!s}, ' - f'taxable_amount_in_cents={(self.taxable_amount_in_cents if hasattr(self, "taxable_amount_in_cents") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!s}, ' - f'direction={(self.direction if hasattr(self, "direction") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _transaction_type=( + self.transaction_type + if hasattr(self, "transaction_type") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _discount_amount_in_cents=( + self.discount_amount_in_cents + if hasattr(self, "discount_amount_in_cents") + else None + ) + _taxable_amount_in_cents=( + self.taxable_amount_in_cents + if hasattr(self, "taxable_amount_in_cents") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _direction=( + self.direction + if hasattr(self, "direction") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_type={_transaction_type!s}, " + f"kind={_kind!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"memo={_memo!s}, " + f"discount_amount_in_cents={_discount_amount_in_cents!s}, " + f"taxable_amount_in_cents={_taxable_amount_in_cents!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"direction={_direction!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation_preview_line_item_kind.py b/advancedbilling/models/allocation_preview_line_item_kind.py index c67ffa20..3541ccdd 100644 --- a/advancedbilling/models/allocation_preview_line_item_kind.py +++ b/advancedbilling/models/allocation_preview_line_item_kind.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class AllocationPreviewLineItemKind(object): - """Implementation of the 'Allocation Preview Line Item Kind' enum. A handle for the line item kind for allocation preview @@ -19,20 +16,22 @@ class AllocationPreviewLineItemKind(object): ON_OFF_COMPONENT: The enum member of type str. COUPON: The enum member of type str. TAX: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - QUANTITY_BASED_COMPONENT = 'quantity_based_component' - ON_OFF_COMPONENT = 'on_off_component' + QUANTITY_BASED_COMPONENT = "quantity_based_component" + + ON_OFF_COMPONENT = "on_off_component" - COUPON = 'coupon' + COUPON = "coupon" - TAX = 'tax' + TAX = "tax" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/allocation_preview_response.py b/advancedbilling/models/allocation_preview_response.py index 37e4eee1..e6fee211 100644 --- a/advancedbilling/models/allocation_preview_response.py +++ b/advancedbilling/models/allocation_preview_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.allocation_preview import AllocationPreview +# ruff: noqa: E501 +from advancedbilling.models.allocation_preview import ( + AllocationPreview, +) -class AllocationPreviewResponse(object): +class AllocationPreviewResponse(object): """Implementation of the 'Allocation Preview Response' model. Attributes: allocation_preview (AllocationPreview): The model property of type AllocationPreview. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "allocation_preview": 'allocation_preview' + "allocation_preview": "allocation_preview", } - def __init__(self, - allocation_preview=None, - additional_properties=None): - """Constructor for the AllocationPreviewResponse class""" - + def __init__( + self, + allocation_preview=None, + additional_properties=None): + """Initialize a AllocationPreviewResponse instance.""" # Initialize members of the class - self.allocation_preview = allocation_preview + self.allocation_preview = allocation_preview # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - allocation_preview = AllocationPreview.from_dictionary(dictionary.get('allocation_preview')) if dictionary.get('allocation_preview') else None + allocation_preview =\ + AllocationPreview.from_dictionary( + dictionary.get("allocation_preview"))\ + if dictionary.get("allocation_preview") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(allocation_preview, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'allocation_preview={self.allocation_preview!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _allocation_preview=self.allocation_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation_preview={_allocation_preview!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'allocation_preview={self.allocation_preview!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _allocation_preview=self.allocation_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation_preview={_allocation_preview!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation_response.py b/advancedbilling/models/allocation_response.py index ed1718b8..ba660a10 100644 --- a/advancedbilling/models/allocation_response.py +++ b/advancedbilling/models/allocation_response.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.allocation import Allocation +from advancedbilling.models.allocation import ( + Allocation, +) class AllocationResponse(object): - """Implementation of the 'Allocation Response' model. Attributes: allocation (Allocation): The model property of type Allocation. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "allocation": 'allocation' + "allocation": "allocation", } _optionals = [ - 'allocation', + "allocation", ] - def __init__(self, - allocation=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AllocationResponse class""" - + def __init__( + self, + allocation=APIHelper.SKIP, + additional_properties=None): + """Initialize a AllocationResponse instance.""" # Initialize members of the class if allocation is not APIHelper.SKIP: - self.allocation = allocation + self.allocation = allocation # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - allocation = Allocation.from_dictionary(dictionary.get('allocation')) if 'allocation' in dictionary.keys() else APIHelper.SKIP + allocation =\ + Allocation.from_dictionary( + dictionary.get("allocation"))\ + if "allocation" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(allocation, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'allocation={(self.allocation if hasattr(self, "allocation") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _allocation=( + self.allocation + if hasattr(self, "allocation") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation={_allocation!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'allocation={(self.allocation if hasattr(self, "allocation") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _allocation=( + self.allocation + if hasattr(self, "allocation") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation={_allocation!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/allocation_settings.py b/advancedbilling/models/allocation_settings.py index 1cc6e61f..86b479d1 100644 --- a/advancedbilling/models/allocation_settings.py +++ b/advancedbilling/models/allocation_settings.py @@ -1,65 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AllocationSettings(object): - """Implementation of the 'Allocation Settings' model. Attributes: upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. accrue_charge (str): Either "true" or "false". - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "accrue_charge": 'accrue_charge' + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "accrue_charge": "accrue_charge", } _optionals = [ - 'upgrade_charge', - 'downgrade_credit', - 'accrue_charge', + "upgrade_charge", + "downgrade_credit", + "accrue_charge", ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', + "upgrade_charge", + "downgrade_credit", ] - def __init__(self, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - accrue_charge=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AllocationSettings class""" - + def __init__( + self, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + accrue_charge=APIHelper.SKIP, + additional_properties=None): + """Initialize a AllocationSettings instance.""" # Initialize members of the class if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if accrue_charge is not APIHelper.SKIP: - self.accrue_charge = accrue_charge + self.accrue_charge = accrue_charge # Add additional model properties to the instance if additional_properties is None: @@ -69,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -80,16 +76,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP - accrue_charge = dictionary.get("accrue_charge") if dictionary.get("accrue_charge") else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + accrue_charge =\ + dictionary.get("accrue_charge")\ + if dictionary.get("accrue_charge")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(upgrade_charge, downgrade_credit, @@ -97,15 +104,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"accrue_charge={_accrue_charge!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"accrue_charge={_accrue_charge!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apple_pay_payment_profile.py b/advancedbilling/models/apple_pay_payment_profile.py index 8321968d..d2f180b5 100644 --- a/advancedbilling/models/apple_pay_payment_profile.py +++ b/advancedbilling/models/apple_pay_payment_profile.py @@ -1,166 +1,171 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payment_type import PaymentType +from advancedbilling.models.payment_type import ( + PaymentType, +) class ApplePayPaymentProfile(object): - """Implementation of the 'ApplePay Payment Profile' model. Attributes: id (int): The Chargify-assigned ID of the Apple Pay payment profile. first_name (str): The first name of the Apple Pay account holder last_name (str): The last name of the Apple Pay account holder - customer_id (int): The Chargify-assigned id for the customer record to - which the Apple Pay account belongs - current_vault (ApplePayVault): The vault that stores the payment - profile with the provided vault_token. - vault_token (str): The “token” provided by your vault storage for an - already stored payment profile - billing_address (str): The current billing street address for the - Apple Pay account - billing_city (str): The current billing address city for the Apple Pay + customer_id (int): The Chargify-assigned id for the customer record to which + the Apple Pay account belongs + current_vault (ApplePayVault): The vault that stores the payment profile with + the provided vault_token. + vault_token (str): The “token” provided by your vault storage for an already + stored payment profile + billing_address (str): The current billing street address for the Apple Pay + account + billing_city (str): The current billing address city for the Apple Pay account + billing_state (str): The current billing address state for the Apple Pay + account + billing_zip (str): The current billing address zip code for the Apple Pay + account + billing_country (str): The current billing address country for the Apple Pay account - billing_state (str): The current billing address state for the Apple - Pay account - billing_zip (str): The current billing address zip code for the Apple - Pay account - billing_country (str): The current billing address country for the - Apple Pay account customer_vault_token (str): The model property of type str. - billing_address_2 (str): The current billing street address, second - line, for the Apple Pay account + billing_address_2 (str): The current billing street address, second line, for + the Apple Pay account payment_type (PaymentType): The model property of type PaymentType. site_gateway_setting_id (int): The model property of type int. gateway_handle (str): The model property of type str. - created_at (datetime): A timestamp indicating when this payment - profile was created - updated_at (datetime): A timestamp indicating when this payment - profile was last updated - additional_properties (Dict[str, object]): The additional properties - for the model. + created_at (datetime): A timestamp indicating when this payment profile was + created + updated_at (datetime): A timestamp indicating when this payment profile was + last updated + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_type": 'payment_type', - "id": 'id', - "first_name": 'first_name', - "last_name": 'last_name', - "customer_id": 'customer_id', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "billing_address": 'billing_address', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "billing_country": 'billing_country', - "customer_vault_token": 'customer_vault_token', - "billing_address_2": 'billing_address_2', - "site_gateway_setting_id": 'site_gateway_setting_id', - "gateway_handle": 'gateway_handle', - "created_at": 'created_at', - "updated_at": 'updated_at' + "payment_type": "payment_type", + "id": "id", + "first_name": "first_name", + "last_name": "last_name", + "customer_id": "customer_id", + "current_vault": "current_vault", + "vault_token": "vault_token", + "billing_address": "billing_address", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "billing_country": "billing_country", + "customer_vault_token": "customer_vault_token", + "billing_address_2": "billing_address_2", + "site_gateway_setting_id": "site_gateway_setting_id", + "gateway_handle": "gateway_handle", + "created_at": "created_at", + "updated_at": "updated_at", } _optionals = [ - 'id', - 'first_name', - 'last_name', - 'customer_id', - 'current_vault', - 'vault_token', - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'site_gateway_setting_id', - 'gateway_handle', - 'created_at', - 'updated_at', + "id", + "first_name", + "last_name", + "customer_id", + "current_vault", + "vault_token", + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "site_gateway_setting_id", + "gateway_handle", + "created_at", + "updated_at", ] _nullables = [ - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'site_gateway_setting_id', - 'gateway_handle', + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "site_gateway_setting_id", + "gateway_handle", ] - def __init__(self, - payment_type='apple_pay', - id=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - site_gateway_setting_id=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ApplePayPaymentProfile class""" - + def __init__( + self, + payment_type="apple_pay", + id=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + site_gateway_setting_id=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ApplePayPaymentProfile instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 - self.payment_type = payment_type + self.billing_address_2 = billing_address_2 + self.payment_type = payment_type if site_gateway_setting_id is not APIHelper.SKIP: - self.site_gateway_setting_id = site_gateway_setting_id + self.site_gateway_setting_id = site_gateway_setting_id if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None # Add additional model properties to the instance if additional_properties is None: @@ -170,7 +175,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -181,31 +186,85 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else 'apple_pay' - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if "billing_address" in dictionary.keys() else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if "billing_city" in dictionary.keys() else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if "billing_state" in dictionary.keys() else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if "billing_zip" in dictionary.keys() else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if "billing_country" in dictionary.keys() else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if "customer_vault_token" in dictionary.keys() else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if "billing_address_2" in dictionary.keys() else APIHelper.SKIP - site_gateway_setting_id = dictionary.get("site_gateway_setting_id") if "site_gateway_setting_id" in dictionary.keys() else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if "gateway_handle" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else "apple_pay" + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if "billing_city" in dictionary.keys()\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if "billing_state" in dictionary.keys()\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if "billing_zip" in dictionary.keys()\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if "billing_country" in dictionary.keys()\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if "customer_vault_token" in dictionary.keys()\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if "billing_address_2" in dictionary.keys()\ + else APIHelper.SKIP + site_gateway_setting_id =\ + dictionary.get("site_gateway_setting_id")\ + if "site_gateway_setting_id" in dictionary.keys()\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_type, id, @@ -229,7 +288,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -240,57 +299,242 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.payment_type, - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.payment_type, + type_callable=lambda value: + PaymentType.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('payment_type'), - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("payment_type"), + type_callable=lambda value: + PaymentType.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'payment_type={self.payment_type!r}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _payment_type=self.payment_type + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"customer_id={_customer_id!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"billing_address={_billing_address!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"billing_country={_billing_country!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"payment_type={_payment_type!r}, " + f"site_gateway_setting_id={_site_gateway_setting_id!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'payment_type={self.payment_type!s}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _payment_type=self.payment_type + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"customer_id={_customer_id!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"billing_address={_billing_address!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"billing_country={_billing_country!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"payment_type={_payment_type!s}, " + f"site_gateway_setting_id={_site_gateway_setting_id!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apple_pay_vault.py b/advancedbilling/models/apple_pay_vault.py index 2edab1d6..cfc53d4c 100644 --- a/advancedbilling/models/apple_pay_vault.py +++ b/advancedbilling/models/apple_pay_vault.py @@ -1,31 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ApplePayVault(object): - """Implementation of the 'Apple Pay Vault' enum. The vault that stores the payment profile with the provided vault_token. Attributes: BRAINTREE_BLUE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['braintree_blue'] - BRAINTREE_BLUE = 'braintree_blue' + + _all_values = ["braintree_blue"] + BRAINTREE_BLUE = "braintree_blue" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -35,9 +33,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/applied_credit_note_data.py b/advancedbilling/models/applied_credit_note_data.py index 17883900..f6910175 100644 --- a/advancedbilling/models/applied_credit_note_data.py +++ b/advancedbilling/models/applied_credit_note_data.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AppliedCreditNoteData(object): - """Implementation of the 'Applied Credit Note Data' model. Attributes: uid (str): The UID of the credit note number (str): The number of the credit note - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "number": 'number' + "uid": "uid", + "number": "number", } _optionals = [ - 'uid', - 'number', + "uid", + "number", ] - def __init__(self, - uid=APIHelper.SKIP, - number=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AppliedCreditNoteData class""" - + def __init__( + self, + uid=APIHelper.SKIP, + number=APIHelper.SKIP, + additional_properties=None): + """Initialize a AppliedCreditNoteData instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if number is not APIHelper.SKIP: - self.number = number + self.number = number # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,15 +61,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - number = dictionary.get("number") if dictionary.get("number") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, number, @@ -79,7 +85,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -90,7 +96,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -100,13 +105,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'number={(self.number if hasattr(self, "number") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"number={_number!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'number={(self.number if hasattr(self, "number") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"number={_number!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apply_credit_note_event.py b/advancedbilling/models/apply_credit_note_event.py index 2b5c0deb..b1f0e0cc 100644 --- a/advancedbilling/models/apply_credit_note_event.py +++ b/advancedbilling/models/apply_credit_note_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.apply_credit_note_event_data import ApplyCreditNoteEventData +from advancedbilling.models.apply_credit_note_event_data import ( + ApplyCreditNoteEventData, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class ApplyCreditNoteEvent(object): - """Implementation of the 'Apply Credit Note Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. + event_type (InvoiceEventType): The model property of type InvoiceEventType. event_data (ApplyCreditNoteEventData): Example schema for an `apply_credit_note` event - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='apply_credit_note', - event_data=None, - additional_properties=None): - """Constructor for the ApplyCreditNoteEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="apply_credit_note", + event_data=None, + additional_properties=None): + """Initialize a ApplyCreditNoteEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'apply_credit_note' - event_data = ApplyCreditNoteEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "apply_credit_note" + event_data =\ + ApplyCreditNoteEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: ApplyCreditNoteEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + ApplyCreditNoteEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: ApplyCreditNoteEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + ApplyCreditNoteEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apply_credit_note_event_data.py b/advancedbilling/models/apply_credit_note_event_data.py index 81e4c2e2..d51f5fff 100644 --- a/advancedbilling/models/apply_credit_note_event_data.py +++ b/advancedbilling/models/apply_credit_note_event_data.py @@ -1,101 +1,104 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.applied_credit_note_data import AppliedCreditNoteData +from advancedbilling.models.applied_credit_note_data import ( + AppliedCreditNoteData, +) class ApplyCreditNoteEventData(object): - """Implementation of the 'Apply Credit Note Event Data' model. Example schema for an `apply_credit_note` event Attributes: - uid (str): Unique identifier for the credit note application. It is - generated automatically by Chargify and has the prefix "cdt_" - followed by alphanumeric characters. - credit_note_number (str): A unique, identifying string that appears on - the credit note and in places it is referenced. - credit_note_uid (str): Unique identifier for the credit note. It is - generated automatically by Chargify and has the prefix "cn_" - followed by alphanumeric characters. + uid (str): Unique identifier for the credit note application. It is generated + automatically by Chargify and has the prefix "cdt_" followed by + alphanumeric characters. + credit_note_number (str): A unique, identifying string that appears on the + credit note and in places it is referenced. + credit_note_uid (str): Unique identifier for the credit note. It is generated + automatically by Chargify and has the prefix "cn_" followed by + alphanumeric characters. original_amount (str): The full, original amount of the credit note. applied_amount (str): The amount of the credit note applied to invoice. - transaction_time (datetime): The time the credit note was applied, in - ISO 8601 format, i.e. "2019-06-07T17:20:06Z" + transaction_time (datetime): The time the credit note was applied, in ISO + 8601 format, i.e. "2019-06-07T17:20:06Z" memo (str): The credit note memo. role (str): The role of the credit note (e.g. 'general') - consolidated_invoice (bool): Shows whether it was applied to - consolidated invoice or not - applied_credit_notes (List[AppliedCreditNoteData]): List of credit - notes applied to children invoices (if consolidated invoice) - additional_properties (Dict[str, object]): The additional properties - for the model. + consolidated_invoice (bool): Shows whether it was applied to consolidated + invoice or not + applied_credit_notes (List[AppliedCreditNoteData]): List of credit notes + applied to children invoices (if consolidated invoice) + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "credit_note_number": 'credit_note_number', - "credit_note_uid": 'credit_note_uid', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount', - "transaction_time": 'transaction_time', - "memo": 'memo', - "role": 'role', - "consolidated_invoice": 'consolidated_invoice', - "applied_credit_notes": 'applied_credit_notes' + "uid": "uid", + "credit_note_number": "credit_note_number", + "credit_note_uid": "credit_note_uid", + "original_amount": "original_amount", + "applied_amount": "applied_amount", + "transaction_time": "transaction_time", + "memo": "memo", + "role": "role", + "consolidated_invoice": "consolidated_invoice", + "applied_credit_notes": "applied_credit_notes", } _optionals = [ - 'transaction_time', - 'memo', - 'role', - 'consolidated_invoice', - 'applied_credit_notes', + "transaction_time", + "memo", + "role", + "consolidated_invoice", + "applied_credit_notes", ] _nullables = [ - 'memo', + "memo", ] - def __init__(self, - uid=None, - credit_note_number=None, - credit_note_uid=None, - original_amount=None, - applied_amount=None, - transaction_time=APIHelper.SKIP, - memo=APIHelper.SKIP, - role=APIHelper.SKIP, - consolidated_invoice=APIHelper.SKIP, - applied_credit_notes=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ApplyCreditNoteEventData class""" - + def __init__( + self, + uid=None, + credit_note_number=None, + credit_note_uid=None, + original_amount=None, + applied_amount=None, + transaction_time=APIHelper.SKIP, + memo=APIHelper.SKIP, + role=APIHelper.SKIP, + consolidated_invoice=APIHelper.SKIP, + applied_credit_notes=APIHelper.SKIP, + additional_properties=None): + """Initialize a ApplyCreditNoteEventData instance.""" # Initialize members of the class - self.uid = uid - self.credit_note_number = credit_note_number - self.credit_note_uid = credit_note_uid - self.original_amount = original_amount - self.applied_amount = applied_amount + self.uid = uid + self.credit_note_number = credit_note_number + self.credit_note_uid = credit_note_uid + self.original_amount = original_amount + self.applied_amount = applied_amount if transaction_time is not APIHelper.SKIP: - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if role is not APIHelper.SKIP: - self.role = role + self.role = role if consolidated_invoice is not APIHelper.SKIP: - self.consolidated_invoice = consolidated_invoice + self.consolidated_invoice = consolidated_invoice if applied_credit_notes is not APIHelper.SKIP: - self.applied_credit_notes = applied_credit_notes + self.applied_credit_notes = applied_credit_notes # Add additional model properties to the instance if additional_properties is None: @@ -105,7 +108,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -116,27 +119,58 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else None - credit_note_number = dictionary.get("credit_note_number") if dictionary.get("credit_note_number") else None - credit_note_uid = dictionary.get("credit_note_uid") if dictionary.get("credit_note_uid") else None - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else None - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else None - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else APIHelper.SKIP - memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP - role = dictionary.get("role") if dictionary.get("role") else APIHelper.SKIP - consolidated_invoice = dictionary.get("consolidated_invoice") if "consolidated_invoice" in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else None + credit_note_number =\ + dictionary.get("credit_note_number")\ + if dictionary.get("credit_note_number")\ + else None + credit_note_uid =\ + dictionary.get("credit_note_uid")\ + if dictionary.get("credit_note_uid")\ + else None + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else None + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else None + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if "memo" in dictionary.keys()\ + else APIHelper.SKIP + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else APIHelper.SKIP + consolidated_invoice =\ + dictionary.get("consolidated_invoice")\ + if "consolidated_invoice" in dictionary.keys()\ + else APIHelper.SKIP applied_credit_notes = None - if dictionary.get('applied_credit_notes') is not None: - applied_credit_notes = [AppliedCreditNoteData.from_dictionary(x) for x in dictionary.get('applied_credit_notes')] + if dictionary.get("applied_credit_notes") is not None: + applied_credit_notes = [ + AppliedCreditNoteData.from_dictionary(x) + for x in dictionary.get("applied_credit_notes") + ] else: applied_credit_notes = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, credit_note_number, @@ -152,7 +186,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -163,57 +197,176 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.uid, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.credit_note_number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.credit_note_uid, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.original_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.applied_amount, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.uid, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.credit_note_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.credit_note_uid, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.original_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.applied_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('uid'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('credit_note_number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('credit_note_uid'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('original_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('applied_amount'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("uid"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("credit_note_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("credit_note_uid"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("original_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("applied_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={self.uid!r}, ' - f'credit_note_number={self.credit_note_number!r}, ' - f'credit_note_uid={self.credit_note_uid!r}, ' - f'original_amount={self.original_amount!r}, ' - f'applied_amount={self.applied_amount!r}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'role={(self.role if hasattr(self, "role") else None)!r}, ' - f'consolidated_invoice={(self.consolidated_invoice if hasattr(self, "consolidated_invoice") else None)!r}, ' - f'applied_credit_notes={(self.applied_credit_notes if hasattr(self, "applied_credit_notes") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=self.uid + _credit_note_number=self.credit_note_number + _credit_note_uid=self.credit_note_uid + _original_amount=self.original_amount + _applied_amount=self.applied_amount + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _consolidated_invoice=( + self.consolidated_invoice + if hasattr(self, "consolidated_invoice") + else None + ) + _applied_credit_notes=( + self.applied_credit_notes + if hasattr(self, "applied_credit_notes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"credit_note_number={_credit_note_number!r}, " + f"credit_note_uid={_credit_note_uid!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"transaction_time={_transaction_time!r}, " + f"memo={_memo!r}, " + f"role={_role!r}, " + f"consolidated_invoice={_consolidated_invoice!r}, " + f"applied_credit_notes={_applied_credit_notes!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={self.uid!s}, ' - f'credit_note_number={self.credit_note_number!s}, ' - f'credit_note_uid={self.credit_note_uid!s}, ' - f'original_amount={self.original_amount!s}, ' - f'applied_amount={self.applied_amount!s}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'role={(self.role if hasattr(self, "role") else None)!s}, ' - f'consolidated_invoice={(self.consolidated_invoice if hasattr(self, "consolidated_invoice") else None)!s}, ' - f'applied_credit_notes={(self.applied_credit_notes if hasattr(self, "applied_credit_notes") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=self.uid + _credit_note_number=self.credit_note_number + _credit_note_uid=self.credit_note_uid + _original_amount=self.original_amount + _applied_amount=self.applied_amount + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _consolidated_invoice=( + self.consolidated_invoice + if hasattr(self, "consolidated_invoice") + else None + ) + _applied_credit_notes=( + self.applied_credit_notes + if hasattr(self, "applied_credit_notes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"credit_note_number={_credit_note_number!s}, " + f"credit_note_uid={_credit_note_uid!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"transaction_time={_transaction_time!s}, " + f"memo={_memo!s}, " + f"role={_role!s}, " + f"consolidated_invoice={_consolidated_invoice!s}, " + f"applied_credit_notes={_applied_credit_notes!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apply_debit_note_event.py b/advancedbilling/models/apply_debit_note_event.py index bce3ff51..da6a7f4a 100644 --- a/advancedbilling/models/apply_debit_note_event.py +++ b/advancedbilling/models/apply_debit_note_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.apply_debit_note_event_data import ApplyDebitNoteEventData +from advancedbilling.models.apply_debit_note_event_data import ( + ApplyDebitNoteEventData, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class ApplyDebitNoteEvent(object): - """Implementation of the 'Apply Debit Note Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. + event_type (InvoiceEventType): The model property of type InvoiceEventType. event_data (ApplyDebitNoteEventData): Example schema for an `apply_debit_note` event - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='apply_debit_note', - event_data=None, - additional_properties=None): - """Constructor for the ApplyDebitNoteEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="apply_debit_note", + event_data=None, + additional_properties=None): + """Initialize a ApplyDebitNoteEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'apply_debit_note' - event_data = ApplyDebitNoteEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "apply_debit_note" + event_data =\ + ApplyDebitNoteEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: ApplyDebitNoteEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + ApplyDebitNoteEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: ApplyDebitNoteEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + ApplyDebitNoteEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apply_debit_note_event_data.py b/advancedbilling/models/apply_debit_note_event_data.py index aa390cda..92645d62 100644 --- a/advancedbilling/models/apply_debit_note_event_data.py +++ b/advancedbilling/models/apply_debit_note_event_data.py @@ -1,75 +1,76 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ApplyDebitNoteEventData(object): - """Implementation of the 'Apply Debit Note Event Data' model. Example schema for an `apply_debit_note` event Attributes: - debit_note_number (str): A unique, identifying string that appears on - the debit note and in places it is referenced. - debit_note_uid (str): Unique identifier for the debit note. It is - generated automatically by Chargify and has the prefix "db_" - followed by alphanumeric characters. + debit_note_number (str): A unique, identifying string that appears on the + debit note and in places it is referenced. + debit_note_uid (str): Unique identifier for the debit note. It is generated + automatically by Chargify and has the prefix "db_" followed by + alphanumeric characters. original_amount (str): The full, original amount of the debit note. applied_amount (str): The amount of the debit note applied to invoice. memo (str): The debit note memo. - transaction_time (datetime): The time the debit note was applied, in - ISO 8601 format, i.e. "2019-06-07T17:20:06Z" - additional_properties (Dict[str, object]): The additional properties - for the model. + transaction_time (datetime): The time the debit note was applied, in ISO 8601 + format, i.e. "2019-06-07T17:20:06Z" + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "debit_note_number": 'debit_note_number', - "debit_note_uid": 'debit_note_uid', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount', - "memo": 'memo', - "transaction_time": 'transaction_time' + "debit_note_number": "debit_note_number", + "debit_note_uid": "debit_note_uid", + "original_amount": "original_amount", + "applied_amount": "applied_amount", + "memo": "memo", + "transaction_time": "transaction_time", } _optionals = [ - 'memo', - 'transaction_time', + "memo", + "transaction_time", ] _nullables = [ - 'memo', - 'transaction_time', + "memo", + "transaction_time", ] - def __init__(self, - debit_note_number=None, - debit_note_uid=None, - original_amount=None, - applied_amount=None, - memo=APIHelper.SKIP, - transaction_time=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ApplyDebitNoteEventData class""" - + def __init__( + self, + debit_note_number=None, + debit_note_uid=None, + original_amount=None, + applied_amount=None, + memo=APIHelper.SKIP, + transaction_time=APIHelper.SKIP, + additional_properties=None): + """Initialize a ApplyDebitNoteEventData instance.""" # Initialize members of the class - self.debit_note_number = debit_note_number - self.debit_note_uid = debit_note_uid - self.original_amount = original_amount - self.applied_amount = applied_amount + self.debit_note_number = debit_note_number + self.debit_note_uid = debit_note_uid + self.original_amount = original_amount + self.applied_amount = applied_amount if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if transaction_time is not APIHelper.SKIP: - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None # Add additional model properties to the instance if additional_properties is None: @@ -79,7 +80,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -90,22 +91,42 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - debit_note_number = dictionary.get("debit_note_number") if dictionary.get("debit_note_number") else None - debit_note_uid = dictionary.get("debit_note_uid") if dictionary.get("debit_note_uid") else None - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else None - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else None - memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP - if 'transaction_time' in dictionary.keys(): - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else None + debit_note_number =\ + dictionary.get("debit_note_number")\ + if dictionary.get("debit_note_number")\ + else None + debit_note_uid =\ + dictionary.get("debit_note_uid")\ + if dictionary.get("debit_note_uid")\ + else None + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else None + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else None + memo =\ + dictionary.get("memo")\ + if "memo" in dictionary.keys()\ + else APIHelper.SKIP + if "transaction_time" in dictionary.keys(): + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else None + else: transaction_time = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(debit_note_number, debit_note_uid, @@ -117,7 +138,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -128,45 +149,122 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.debit_note_number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.debit_note_uid, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.original_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.applied_amount, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.debit_note_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.debit_note_uid, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.original_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.applied_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('debit_note_number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('debit_note_uid'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('original_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('applied_amount'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("debit_note_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("debit_note_uid"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("original_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("applied_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'debit_note_number={self.debit_note_number!r}, ' - f'debit_note_uid={self.debit_note_uid!r}, ' - f'original_amount={self.original_amount!r}, ' - f'applied_amount={self.applied_amount!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _debit_note_number=self.debit_note_number + _debit_note_uid=self.debit_note_uid + _original_amount=self.original_amount + _applied_amount=self.applied_amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"debit_note_number={_debit_note_number!r}, " + f"debit_note_uid={_debit_note_uid!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"memo={_memo!r}, " + f"transaction_time={_transaction_time!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'debit_note_number={self.debit_note_number!s}, ' - f'debit_note_uid={self.debit_note_uid!s}, ' - f'original_amount={self.original_amount!s}, ' - f'applied_amount={self.applied_amount!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _debit_note_number=self.debit_note_number + _debit_note_uid=self.debit_note_uid + _original_amount=self.original_amount + _applied_amount=self.applied_amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"debit_note_number={_debit_note_number!s}, " + f"debit_note_uid={_debit_note_uid!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"memo={_memo!s}, " + f"transaction_time={_transaction_time!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apply_payment_event.py b/advancedbilling/models/apply_payment_event.py index 709f6c85..b6c8db0f 100644 --- a/advancedbilling/models/apply_payment_event.py +++ b/advancedbilling/models/apply_payment_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.apply_payment_event_data import ApplyPaymentEventData +from advancedbilling.models.apply_payment_event_data import ( + ApplyPaymentEventData, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class ApplyPaymentEvent(object): - """Implementation of the 'Apply Payment Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (ApplyPaymentEventData): Example schema for an - `apply_payment` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (ApplyPaymentEventData): Example schema for an `apply_payment` + event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='apply_payment', - event_data=None, - additional_properties=None): - """Constructor for the ApplyPaymentEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="apply_payment", + event_data=None, + additional_properties=None): + """Initialize a ApplyPaymentEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'apply_payment' - event_data = ApplyPaymentEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "apply_payment" + event_data =\ + ApplyPaymentEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: ApplyPaymentEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + ApplyPaymentEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: ApplyPaymentEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + ApplyPaymentEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/apply_payment_event_data.py b/advancedbilling/models/apply_payment_event_data.py index cb96eefe..2203b60c 100644 --- a/advancedbilling/models/apply_payment_event_data.py +++ b/advancedbilling/models/apply_payment_event_data.py @@ -1,113 +1,113 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_consolidation_level import ( + InvoiceConsolidationLevel, +) class ApplyPaymentEventData(object): - """Implementation of the 'Apply Payment Event Data' model. Example schema for an `apply_payment` event Attributes: - consolidation_level (InvoiceConsolidationLevel): The model property of - type InvoiceConsolidationLevel. + consolidation_level (InvoiceConsolidationLevel): The model property of type + InvoiceConsolidationLevel. memo (str): The payment memo - original_amount (str): The full, original amount of the payment - transaction as a string in full units. Incoming payments can be - split amongst several invoices, which will result in a - `applied_amount` less than the `original_amount`. Example: A - $100.99 payment, of which $40.11 is applied to this invoice, will - have an `original_amount` of `"100.99"`. - applied_amount (str): The amount of the payment applied to this - invoice. Incoming payments can be split amongst several invoices, - which will result in a `applied_amount` less than the - `original_amount`. Example: A $100.99 payment, of which $40.11 is - applied to this invoice, will have an `applied_amount` of - `"40.11"`. - transaction_time (datetime): The time the payment was applied, in ISO - 8601 format, i.e. "2019-06-07T17:20:06Z" + original_amount (str): The full, original amount of the payment transaction + as a string in full units. Incoming payments can be split amongst several + invoices, which will result in a `applied_amount` less than the + `original_amount`. Example: A $100.99 payment, of which $40.11 is applied + to this invoice, will have an `original_amount` of `"100.99"`. + applied_amount (str): The amount of the payment applied to this invoice. + Incoming payments can be split amongst several invoices, which will + result in a `applied_amount` less than the `original_amount`. Example: A + $100.99 payment, of which $40.11 is applied to this invoice, will have an + `applied_amount` of `"40.11"`. + transaction_time (datetime): The time the payment was applied, in ISO 8601 + format, i.e. "2019-06-07T17:20:06Z" payment_method (PaymentMethodApplePay | PaymentMethodBankAccount | - PaymentMethodCreditCard | PaymentMethodExternal | - PaymentMethodPaypal): A nested data structure detailing the method - of payment + PaymentMethodCreditCard | PaymentMethodExternal | PaymentMethodPaypal): A + nested data structure detailing the method of payment transaction_id (int): The Chargify id of the original payment parent_invoice_number (int): The model property of type int. remaining_prepayment_amount (str): The model property of type str. prepayment (bool): The model property of type bool. external (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "consolidation_level": 'consolidation_level', - "memo": 'memo', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount', - "transaction_time": 'transaction_time', - "payment_method": 'payment_method', - "transaction_id": 'transaction_id', - "parent_invoice_number": 'parent_invoice_number', - "remaining_prepayment_amount": 'remaining_prepayment_amount', - "prepayment": 'prepayment', - "external": 'external' + "consolidation_level": "consolidation_level", + "memo": "memo", + "original_amount": "original_amount", + "applied_amount": "applied_amount", + "transaction_time": "transaction_time", + "payment_method": "payment_method", + "transaction_id": "transaction_id", + "parent_invoice_number": "parent_invoice_number", + "remaining_prepayment_amount": "remaining_prepayment_amount", + "prepayment": "prepayment", + "external": "external", } _optionals = [ - 'transaction_id', - 'parent_invoice_number', - 'remaining_prepayment_amount', - 'prepayment', - 'external', + "transaction_id", + "parent_invoice_number", + "remaining_prepayment_amount", + "prepayment", + "external", ] _nullables = [ - 'parent_invoice_number', - 'remaining_prepayment_amount', + "parent_invoice_number", + "remaining_prepayment_amount", ] - def __init__(self, - consolidation_level=None, - memo=None, - original_amount=None, - applied_amount=None, - transaction_time=None, - payment_method=None, - transaction_id=APIHelper.SKIP, - parent_invoice_number=APIHelper.SKIP, - remaining_prepayment_amount=APIHelper.SKIP, - prepayment=APIHelper.SKIP, - external=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ApplyPaymentEventData class""" - + def __init__( + self, + consolidation_level=None, + memo=None, + original_amount=None, + applied_amount=None, + transaction_time=None, + payment_method=None, + transaction_id=APIHelper.SKIP, + parent_invoice_number=APIHelper.SKIP, + remaining_prepayment_amount=APIHelper.SKIP, + prepayment=APIHelper.SKIP, + external=APIHelper.SKIP, + additional_properties=None): + """Initialize a ApplyPaymentEventData instance.""" # Initialize members of the class - self.consolidation_level = consolidation_level - self.memo = memo - self.original_amount = original_amount - self.applied_amount = applied_amount - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None - self.payment_method = payment_method + self.consolidation_level = consolidation_level + self.memo = memo + self.original_amount = original_amount + self.applied_amount = applied_amount + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None + self.payment_method = payment_method if transaction_id is not APIHelper.SKIP: - self.transaction_id = transaction_id + self.transaction_id = transaction_id if parent_invoice_number is not APIHelper.SKIP: - self.parent_invoice_number = parent_invoice_number + self.parent_invoice_number = parent_invoice_number if remaining_prepayment_amount is not APIHelper.SKIP: - self.remaining_prepayment_amount = remaining_prepayment_amount + self.remaining_prepayment_amount = remaining_prepayment_amount if prepayment is not APIHelper.SKIP: - self.prepayment = prepayment + self.prepayment = prepayment if external is not APIHelper.SKIP: - self.external = external + self.external = external # Add additional model properties to the instance if additional_properties is None: @@ -117,7 +117,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -128,25 +128,64 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - consolidation_level = dictionary.get("consolidation_level") if dictionary.get("consolidation_level") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else None - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else None - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else None - payment_method = APIHelper.deserialize_union_type(UnionTypeLookUp.get('Invoice-Event-Payment'), dictionary.get('payment_method'), False) if dictionary.get('payment_method') is not None else None - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP - parent_invoice_number = dictionary.get("parent_invoice_number") if "parent_invoice_number" in dictionary.keys() else APIHelper.SKIP - remaining_prepayment_amount = dictionary.get("remaining_prepayment_amount") if "remaining_prepayment_amount" in dictionary.keys() else APIHelper.SKIP - prepayment = dictionary.get("prepayment") if "prepayment" in dictionary.keys() else APIHelper.SKIP - external = dictionary.get("external") if "external" in dictionary.keys() else APIHelper.SKIP + consolidation_level =\ + dictionary.get("consolidation_level")\ + if dictionary.get("consolidation_level")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else None + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else None + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else None + payment_method = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("Invoice-Event-Payment"), + dictionary.get("payment_method"), + False)\ + if dictionary.get("payment_method") is not None\ + else None + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else APIHelper.SKIP + parent_invoice_number =\ + dictionary.get("parent_invoice_number")\ + if "parent_invoice_number" in dictionary.keys()\ + else APIHelper.SKIP + remaining_prepayment_amount =\ + dictionary.get("remaining_prepayment_amount")\ + if "remaining_prepayment_amount" in dictionary.keys()\ + else APIHelper.SKIP + prepayment =\ + dictionary.get("prepayment")\ + if "prepayment" in dictionary.keys()\ + else APIHelper.SKIP + external =\ + dictionary.get("external")\ + if "external" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(consolidation_level, memo, @@ -163,7 +202,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -174,62 +213,182 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.consolidation_level, - type_callable=lambda value: InvoiceConsolidationLevel.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.original_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.applied_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.transaction_time, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and UnionTypeLookUp.get('Invoice-Event-Payment').validate(dictionary.payment_method).is_valid + return APIHelper.is_valid_type( + value=dictionary.consolidation_level, + type_callable=lambda value: + InvoiceConsolidationLevel.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.original_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.applied_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.transaction_time, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and (UnionTypeLookUp.get("Invoice-Event-Payment") + .validate(dictionary.payment_method).is_valid) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('consolidation_level'), - type_callable=lambda value: InvoiceConsolidationLevel.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('original_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('applied_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('transaction_time'), - type_callable=lambda value: isinstance(value, str)) \ - and UnionTypeLookUp.get('Invoice-Event-Payment').validate(dictionary.get('payment_method')).is_valid + return APIHelper.is_valid_type( + value=dictionary.get("consolidation_level"), + type_callable=lambda value: + InvoiceConsolidationLevel.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("original_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("applied_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("transaction_time"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and (UnionTypeLookUp.get("Invoice-Event-Payment") + .validate(dictionary.get("payment_method")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'consolidation_level={self.consolidation_level!r}, ' - f'memo={self.memo!r}, ' - f'original_amount={self.original_amount!r}, ' - f'applied_amount={self.applied_amount!r}, ' - f'transaction_time={self.transaction_time!r}, ' - f'payment_method={self.payment_method!r}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' - f'parent_invoice_number={(self.parent_invoice_number if hasattr(self, "parent_invoice_number") else None)!r}, ' - f'remaining_prepayment_amount={(self.remaining_prepayment_amount if hasattr(self, "remaining_prepayment_amount") else None)!r}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!r}, ' - f'external={(self.external if hasattr(self, "external") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _consolidation_level=self.consolidation_level + _memo=self.memo + _original_amount=self.original_amount + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _payment_method=self.payment_method + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _parent_invoice_number=( + self.parent_invoice_number + if hasattr(self, "parent_invoice_number") + else None + ) + _remaining_prepayment_amount=( + self.remaining_prepayment_amount + if hasattr(self, "remaining_prepayment_amount") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _external=( + self.external + if hasattr(self, "external") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"consolidation_level={_consolidation_level!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"transaction_time={_transaction_time!r}, " + f"payment_method={_payment_method!r}, " + f"transaction_id={_transaction_id!r}, " + f"parent_invoice_number={_parent_invoice_number!r}, " + f"remaining_prepayment_amount={_remaining_prepayment_amount!r}, " + f"prepayment={_prepayment!r}, " + f"external={_external!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'consolidation_level={self.consolidation_level!s}, ' - f'memo={self.memo!s}, ' - f'original_amount={self.original_amount!s}, ' - f'applied_amount={self.applied_amount!s}, ' - f'transaction_time={self.transaction_time!s}, ' - f'payment_method={self.payment_method!s}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' - f'parent_invoice_number={(self.parent_invoice_number if hasattr(self, "parent_invoice_number") else None)!s}, ' - f'remaining_prepayment_amount={(self.remaining_prepayment_amount if hasattr(self, "remaining_prepayment_amount") else None)!s}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!s}, ' - f'external={(self.external if hasattr(self, "external") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _consolidation_level=self.consolidation_level + _memo=self.memo + _original_amount=self.original_amount + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _payment_method=self.payment_method + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _parent_invoice_number=( + self.parent_invoice_number + if hasattr(self, "parent_invoice_number") + else None + ) + _remaining_prepayment_amount=( + self.remaining_prepayment_amount + if hasattr(self, "remaining_prepayment_amount") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _external=( + self.external + if hasattr(self, "external") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"consolidation_level={_consolidation_level!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"transaction_time={_transaction_time!s}, " + f"payment_method={_payment_method!s}, " + f"transaction_id={_transaction_id!s}, " + f"parent_invoice_number={_parent_invoice_number!s}, " + f"remaining_prepayment_amount={_remaining_prepayment_amount!s}, " + f"prepayment={_prepayment!s}, " + f"external={_external!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/attribute_error.py b/advancedbilling/models/attribute_error.py index 58717ce5..9023fea1 100644 --- a/advancedbilling/models/attribute_error.py +++ b/advancedbilling/models/attribute_error.py @@ -1,36 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class AttributeError(object): - """Implementation of the 'Attribute Error' model. Attributes: attribute (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "attribute": 'attribute' + "attribute": "attribute", } - def __init__(self, - attribute=None, - additional_properties=None): - """Constructor for the AttributeError class""" - + def __init__( + self, + attribute=None, + additional_properties=None): + """Initialize a AttributeError instance.""" # Initialize members of the class - self.attribute = attribute + self.attribute = attribute # Add additional model properties to the instance if additional_properties is None: @@ -40,7 +36,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -51,24 +47,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - attribute = dictionary.get("attribute") if dictionary.get("attribute") else None + attribute =\ + dictionary.get("attribute")\ + if dictionary.get("attribute")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(attribute, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'attribute={self.attribute!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _attribute=self.attribute + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"attribute={_attribute!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'attribute={self.attribute!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _attribute=self.attribute + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"attribute={_attribute!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/auto_invite.py b/advancedbilling/models/auto_invite.py index b1de3c95..57692d38 100644 --- a/advancedbilling/models/auto_invite.py +++ b/advancedbilling/models/auto_invite.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class AutoInvite(object): - """Implementation of the 'Auto Invite' enum. Attributes: NO: Do not send the invitation email. YES: Automatically send the invitation email. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ + NO = 0 YES = 1 @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/auto_resume.py b/advancedbilling/models/auto_resume.py index e8822aa5..90d0bf87 100644 --- a/advancedbilling/models/auto_resume.py +++ b/advancedbilling/models/auto_resume.py @@ -1,47 +1,47 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class AutoResume(object): - """Implementation of the 'Auto Resume' model. Attributes: - automatically_resume_at (datetime): The model property of type - datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + automatically_resume_at (datetime): The model property of type datetime. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "automatically_resume_at": 'automatically_resume_at' + "automatically_resume_at": "automatically_resume_at", } _optionals = [ - 'automatically_resume_at', + "automatically_resume_at", ] _nullables = [ - 'automatically_resume_at', + "automatically_resume_at", ] - def __init__(self, - automatically_resume_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the AutoResume class""" - + def __init__( + self, + automatically_resume_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a AutoResume instance.""" # Initialize members of the class if automatically_resume_at is not APIHelper.SKIP: - self.automatically_resume_at = APIHelper.apply_datetime_converter(automatically_resume_at, APIHelper.RFC3339DateTime) if automatically_resume_at else None + self.automatically_resume_at =\ + APIHelper.apply_datetime_converter( + automatically_resume_at, APIHelper.RFC3339DateTime)\ + if automatically_resume_at else None # Add additional model properties to the instance if additional_properties is None: @@ -51,7 +51,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -62,27 +62,52 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - if 'automatically_resume_at' in dictionary.keys(): - automatically_resume_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("automatically_resume_at")).datetime if dictionary.get("automatically_resume_at") else None + if "automatically_resume_at" in dictionary.keys(): + automatically_resume_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("automatically_resume_at")).datetime\ + if dictionary.get("automatically_resume_at") else None + else: automatically_resume_at = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(automatically_resume_at, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'automatically_resume_at={(self.automatically_resume_at if hasattr(self, "automatically_resume_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _automatically_resume_at=( + self.automatically_resume_at + if hasattr(self, "automatically_resume_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"automatically_resume_at={_automatically_resume_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'automatically_resume_at={(self.automatically_resume_at if hasattr(self, "automatically_resume_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _automatically_resume_at=( + self.automatically_resume_at + if hasattr(self, "automatically_resume_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"automatically_resume_at={_automatically_resume_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/available_actions.py b/advancedbilling/models/available_actions.py new file mode 100644 index 00000000..6679cd16 --- /dev/null +++ b/advancedbilling/models/available_actions.py @@ -0,0 +1,107 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.send_email import ( + SendEmail, +) + + +class AvailableActions(object): + """Implementation of the 'AvailableActions' model. + + Attributes: + send_email (SendEmail): The model property of type SendEmail. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "send_email": "send_email", + } + + _optionals = [ + "send_email", + ] + + def __init__( + self, + send_email=APIHelper.SKIP, + additional_properties=None): + """Initialize a AvailableActions instance.""" + # Initialize members of the class + if send_email is not APIHelper.SKIP: + self.send_email = send_email + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + send_email =\ + SendEmail.from_dictionary( + dictionary.get("send_email"))\ + if "send_email" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(send_email, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _send_email=( + self.send_email + if hasattr(self, "send_email") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"send_email={_send_email!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _send_email=( + self.send_email + if hasattr(self, "send_email") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"send_email={_send_email!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/backport_invoice_event.py b/advancedbilling/models/backport_invoice_event.py index b2fa315c..55cf5b5d 100644 --- a/advancedbilling/models/backport_invoice_event.py +++ b/advancedbilling/models/backport_invoice_event.py @@ -1,56 +1,58 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class BackportInvoiceEvent(object): - """Implementation of the 'Backport Invoice Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. + event_type (InvoiceEventType): The model property of type InvoiceEventType. event_data (Invoice): Example schema for an `backport_invoice` event - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='backport_invoice', - event_data=None, - additional_properties=None): - """Constructor for the BackportInvoiceEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="backport_invoice", + event_data=None, + additional_properties=None): + """Initialize a BackportInvoiceEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -60,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -71,18 +73,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'backport_invoice' - event_data = Invoice.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "backport_invoice" + event_data =\ + Invoice.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -93,7 +111,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -104,51 +122,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bank_account_attributes.py b/advancedbilling/models/bank_account_attributes.py index 15fbddc3..6312d8a8 100644 --- a/advancedbilling/models/bank_account_attributes.py +++ b/advancedbilling/models/bank_account_attributes.py @@ -1,121 +1,117 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class BankAccountAttributes(object): - """Implementation of the 'Bank Account Attributes' model. Attributes: chargify_token (str): The model property of type str. bank_name (str): (Required when creating a subscription with ACH or - GoCardless) The name of the bank where the customer’s account - resides - bank_routing_number (str): (Required when creating a subscription with - ACH. Optional when creating a subscription with GoCardless). The - routing number of the bank. It becomes bank_code while passing via - GoCardless API - bank_account_number (str): (Required when creating a subscription with - ACH. Required when creating a subscription with GoCardless and - bank_iban is blank) The customerʼs bank account number + GoCardless) The name of the bank where the customer’s account resides + bank_routing_number (str): (Required when creating a subscription with ACH. + Optional when creating a subscription with GoCardless). The routing + number of the bank. It becomes bank_code while passing via GoCardless API + bank_account_number (str): (Required when creating a subscription with ACH. + Required when creating a subscription with GoCardless and bank_iban is + blank) The customerʼs bank account number bank_account_type (BankAccountType): Defaults to checking bank_branch_code (str): (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided - bank_iban (str): (Optional when creating a subscription with - GoCardless). International Bank Account Number. Alternatively, - local bank details can be provided + bank_iban (str): (Optional when creating a subscription with GoCardless). + International Bank Account Number. Alternatively, local bank details can + be provided bank_account_holder_type (BankAccountHolderType): Defaults to personal payment_type (PaymentType): The model property of type PaymentType. - current_vault (BankAccountVault): The vault that stores the payment - profile with the provided vault_token. Use `bogus` for testing. + current_vault (BankAccountVault): The vault that stores the payment profile + with the provided vault_token. Use `bogus` for testing. vault_token (str): The model property of type str. - customer_vault_token (str): (only for Authorize.Net CIM storage or - Square) The customerProfileId for the owner of the - customerPaymentProfileId provided as the vault_token - additional_properties (Dict[str, object]): The additional properties - for the model. + customer_vault_token (str): (only for Authorize.Net CIM storage or Square) + The customerProfileId for the owner of the customerPaymentProfileId + provided as the vault_token + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify_token": 'chargify_token', - "bank_name": 'bank_name', - "bank_routing_number": 'bank_routing_number', - "bank_account_number": 'bank_account_number', - "bank_account_type": 'bank_account_type', - "bank_branch_code": 'bank_branch_code', - "bank_iban": 'bank_iban', - "bank_account_holder_type": 'bank_account_holder_type', - "payment_type": 'payment_type', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "customer_vault_token": 'customer_vault_token' + "chargify_token": "chargify_token", + "bank_name": "bank_name", + "bank_routing_number": "bank_routing_number", + "bank_account_number": "bank_account_number", + "bank_account_type": "bank_account_type", + "bank_branch_code": "bank_branch_code", + "bank_iban": "bank_iban", + "bank_account_holder_type": "bank_account_holder_type", + "payment_type": "payment_type", + "current_vault": "current_vault", + "vault_token": "vault_token", + "customer_vault_token": "customer_vault_token", } _optionals = [ - 'chargify_token', - 'bank_name', - 'bank_routing_number', - 'bank_account_number', - 'bank_account_type', - 'bank_branch_code', - 'bank_iban', - 'bank_account_holder_type', - 'payment_type', - 'current_vault', - 'vault_token', - 'customer_vault_token', + "chargify_token", + "bank_name", + "bank_routing_number", + "bank_account_number", + "bank_account_type", + "bank_branch_code", + "bank_iban", + "bank_account_holder_type", + "payment_type", + "current_vault", + "vault_token", + "customer_vault_token", ] - def __init__(self, - chargify_token=APIHelper.SKIP, - bank_name=APIHelper.SKIP, - bank_routing_number=APIHelper.SKIP, - bank_account_number=APIHelper.SKIP, - bank_account_type=APIHelper.SKIP, - bank_branch_code=APIHelper.SKIP, - bank_iban=APIHelper.SKIP, - bank_account_holder_type=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BankAccountAttributes class""" - + def __init__( + self, + chargify_token=APIHelper.SKIP, + bank_name=APIHelper.SKIP, + bank_routing_number=APIHelper.SKIP, + bank_account_number=APIHelper.SKIP, + bank_account_type=APIHelper.SKIP, + bank_branch_code=APIHelper.SKIP, + bank_iban=APIHelper.SKIP, + bank_account_holder_type=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + additional_properties=None): + """Initialize a BankAccountAttributes instance.""" # Initialize members of the class if chargify_token is not APIHelper.SKIP: - self.chargify_token = chargify_token + self.chargify_token = chargify_token if bank_name is not APIHelper.SKIP: - self.bank_name = bank_name + self.bank_name = bank_name if bank_routing_number is not APIHelper.SKIP: - self.bank_routing_number = bank_routing_number + self.bank_routing_number = bank_routing_number if bank_account_number is not APIHelper.SKIP: - self.bank_account_number = bank_account_number + self.bank_account_number = bank_account_number if bank_account_type is not APIHelper.SKIP: - self.bank_account_type = bank_account_type + self.bank_account_type = bank_account_type if bank_branch_code is not APIHelper.SKIP: - self.bank_branch_code = bank_branch_code + self.bank_branch_code = bank_branch_code if bank_iban is not APIHelper.SKIP: - self.bank_iban = bank_iban + self.bank_iban = bank_iban if bank_account_holder_type is not APIHelper.SKIP: - self.bank_account_holder_type = bank_account_holder_type + self.bank_account_holder_type = bank_account_holder_type if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type + self.payment_type = payment_type if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token # Add additional model properties to the instance if additional_properties is None: @@ -125,7 +121,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -136,25 +132,63 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargify_token = dictionary.get("chargify_token") if dictionary.get("chargify_token") else APIHelper.SKIP - bank_name = dictionary.get("bank_name") if dictionary.get("bank_name") else APIHelper.SKIP - bank_routing_number = dictionary.get("bank_routing_number") if dictionary.get("bank_routing_number") else APIHelper.SKIP - bank_account_number = dictionary.get("bank_account_number") if dictionary.get("bank_account_number") else APIHelper.SKIP - bank_account_type = dictionary.get("bank_account_type") if dictionary.get("bank_account_type") else APIHelper.SKIP - bank_branch_code = dictionary.get("bank_branch_code") if dictionary.get("bank_branch_code") else APIHelper.SKIP - bank_iban = dictionary.get("bank_iban") if dictionary.get("bank_iban") else APIHelper.SKIP - bank_account_holder_type = dictionary.get("bank_account_holder_type") if dictionary.get("bank_account_holder_type") else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if dictionary.get("customer_vault_token") else APIHelper.SKIP + chargify_token =\ + dictionary.get("chargify_token")\ + if dictionary.get("chargify_token")\ + else APIHelper.SKIP + bank_name =\ + dictionary.get("bank_name")\ + if dictionary.get("bank_name")\ + else APIHelper.SKIP + bank_routing_number =\ + dictionary.get("bank_routing_number")\ + if dictionary.get("bank_routing_number")\ + else APIHelper.SKIP + bank_account_number =\ + dictionary.get("bank_account_number")\ + if dictionary.get("bank_account_number")\ + else APIHelper.SKIP + bank_account_type =\ + dictionary.get("bank_account_type")\ + if dictionary.get("bank_account_type")\ + else APIHelper.SKIP + bank_branch_code =\ + dictionary.get("bank_branch_code")\ + if dictionary.get("bank_branch_code")\ + else APIHelper.SKIP + bank_iban =\ + dictionary.get("bank_iban")\ + if dictionary.get("bank_iban")\ + else APIHelper.SKIP + bank_account_holder_type =\ + dictionary.get("bank_account_holder_type")\ + if dictionary.get("bank_account_holder_type")\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if dictionary.get("customer_vault_token")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify_token, bank_name, @@ -172,7 +206,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -183,7 +217,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -193,33 +226,163 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!r}, ' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!r}, ' - f'bank_routing_number={(self.bank_routing_number if hasattr(self, "bank_routing_number") else None)!r}, ' - f'bank_account_number={(self.bank_account_number if hasattr(self, "bank_account_number") else None)!r}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!r}, ' - f'bank_branch_code={(self.bank_branch_code if hasattr(self, "bank_branch_code") else None)!r}, ' - f'bank_iban={(self.bank_iban if hasattr(self, "bank_iban") else None)!r}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _bank_routing_number=( + self.bank_routing_number + if hasattr(self, "bank_routing_number") + else None + ) + _bank_account_number=( + self.bank_account_number + if hasattr(self, "bank_account_number") + else None + ) + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_branch_code=( + self.bank_branch_code + if hasattr(self, "bank_branch_code") + else None + ) + _bank_iban=( + self.bank_iban + if hasattr(self, "bank_iban") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!r}, " + f"bank_name={_bank_name!r}, " + f"bank_routing_number={_bank_routing_number!r}, " + f"bank_account_number={_bank_account_number!r}, " + f"bank_account_type={_bank_account_type!r}, " + f"bank_branch_code={_bank_branch_code!r}, " + f"bank_iban={_bank_iban!r}, " + f"bank_account_holder_type={_bank_account_holder_type!r}, " + f"payment_type={_payment_type!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!s}, ' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!s}, ' - f'bank_routing_number={(self.bank_routing_number if hasattr(self, "bank_routing_number") else None)!s}, ' - f'bank_account_number={(self.bank_account_number if hasattr(self, "bank_account_number") else None)!s}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!s}, ' - f'bank_branch_code={(self.bank_branch_code if hasattr(self, "bank_branch_code") else None)!s}, ' - f'bank_iban={(self.bank_iban if hasattr(self, "bank_iban") else None)!s}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _bank_routing_number=( + self.bank_routing_number + if hasattr(self, "bank_routing_number") + else None + ) + _bank_account_number=( + self.bank_account_number + if hasattr(self, "bank_account_number") + else None + ) + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_branch_code=( + self.bank_branch_code + if hasattr(self, "bank_branch_code") + else None + ) + _bank_iban=( + self.bank_iban + if hasattr(self, "bank_iban") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!s}, " + f"bank_name={_bank_name!s}, " + f"bank_routing_number={_bank_routing_number!s}, " + f"bank_account_number={_bank_account_number!s}, " + f"bank_account_type={_bank_account_type!s}, " + f"bank_branch_code={_bank_branch_code!s}, " + f"bank_iban={_bank_iban!s}, " + f"bank_account_holder_type={_bank_account_holder_type!s}, " + f"payment_type={_payment_type!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bank_account_holder_type.py b/advancedbilling/models/bank_account_holder_type.py index ce184007..c773bf0d 100644 --- a/advancedbilling/models/bank_account_holder_type.py +++ b/advancedbilling/models/bank_account_holder_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class BankAccountHolderType(object): - """Implementation of the 'Bank Account Holder Type' enum. Defaults to personal @@ -17,18 +14,19 @@ class BankAccountHolderType(object): Attributes: PERSONAL: The enum member of type str. BUSINESS: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['personal', 'business'] - PERSONAL = 'personal' - BUSINESS = 'business' + _all_values = ["personal", "business"] + PERSONAL = "personal" + + BUSINESS = "business" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -38,9 +36,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/bank_account_payment_profile.py b/advancedbilling/models/bank_account_payment_profile.py index 6d67c4b8..24f975dd 100644 --- a/advancedbilling/models/bank_account_payment_profile.py +++ b/advancedbilling/models/bank_account_payment_profile.py @@ -1,54 +1,49 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payment_type import PaymentType +from advancedbilling.models.payment_type import ( + PaymentType, +) class BankAccountPaymentProfile(object): - """Implementation of the 'Bank Account Payment Profile' model. Attributes: - id (int): The Chargify-assigned ID of the stored bank account. This - value can be used as an input to payment_profile_id when creating - a subscription, in order to re-use a stored payment profile for - the same customer + id (int): The Chargify-assigned ID of the stored bank account. This value can + be used as an input to payment_profile_id when creating a subscription, + in order to re-use a stored payment profile for the same customer first_name (str): The first name of the bank account holder last_name (str): The last name of the bank account holder - customer_id (int): The Chargify-assigned id for the customer record to - which the bank account belongs - current_vault (BankAccountVault): The vault that stores the payment - profile with the provided vault_token. Use `bogus` for testing. - vault_token (str): The “token” provided by your vault storage for an - already stored payment profile - billing_address (str): The current billing street address for the bank - account - billing_city (str): The current billing address city for the bank - account - billing_state (str): The current billing address state for the bank + customer_id (int): The Chargify-assigned id for the customer record to which + the bank account belongs + current_vault (BankAccountVault): The vault that stores the payment profile + with the provided vault_token. Use `bogus` for testing. + vault_token (str): The “token” provided by your vault storage for an already + stored payment profile + billing_address (str): The current billing street address for the bank account + billing_city (str): The current billing address city for the bank account + billing_state (str): The current billing address state for the bank account + billing_zip (str): The current billing address zip code for the bank account + billing_country (str): The current billing address country for the bank account - billing_zip (str): The current billing address zip code for the bank - account - billing_country (str): The current billing address country for the - bank account customer_vault_token (str): (only for Authorize.Net CIM storage): the - customerProfileId for the owner of the customerPaymentProfileId - provided as the vault_token. - billing_address_2 (str): The current billing street address, second - line, for the bank account + customerProfileId for the owner of the customerPaymentProfileId provided + as the vault_token. + billing_address_2 (str): The current billing street address, second line, for + the bank account bank_name (str): The bank where the account resides - masked_bank_routing_number (str): A string representation of the - stored bank routing number with all but the last 4 digits marked - with X’s (i.e. ‘XXXXXXX1111’). payment_type will be bank_account - masked_bank_account_number (str): A string representation of the - stored bank account number with all but the last 4 digits marked - with X’s (i.e. ‘XXXXXXX1111’) + masked_bank_routing_number (str): A string representation of the stored bank + routing number with all but the last 4 digits marked with X’s (i.e. + ‘XXXXXXX1111’). payment_type will be bank_account + masked_bank_account_number (str): A string representation of the stored bank + account number with all but the last 4 digits marked with X’s (i.e. + ‘XXXXXXX1111’) bank_account_type (BankAccountType): Defaults to checking bank_account_holder_type (BankAccountHolderType): Defaults to personal payment_type (PaymentType): The model property of type PaymentType. @@ -56,154 +51,160 @@ class BankAccountPaymentProfile(object): providing the amounts of two small deposits made into the account site_gateway_setting_id (int): The model property of type int. gateway_handle (str): The model property of type str. - created_at (datetime): A timestamp indicating when this payment - profile was created - updated_at (datetime): A timestamp indicating when this payment - profile was last updated - additional_properties (Dict[str, object]): The additional properties - for the model. + created_at (datetime): A timestamp indicating when this payment profile was + created + updated_at (datetime): A timestamp indicating when this payment profile was + last updated + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "masked_bank_account_number": 'masked_bank_account_number', - "payment_type": 'payment_type', - "id": 'id', - "first_name": 'first_name', - "last_name": 'last_name', - "customer_id": 'customer_id', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "billing_address": 'billing_address', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "billing_country": 'billing_country', - "customer_vault_token": 'customer_vault_token', - "billing_address_2": 'billing_address_2', - "bank_name": 'bank_name', - "masked_bank_routing_number": 'masked_bank_routing_number', - "bank_account_type": 'bank_account_type', - "bank_account_holder_type": 'bank_account_holder_type', - "verified": 'verified', - "site_gateway_setting_id": 'site_gateway_setting_id', - "gateway_handle": 'gateway_handle', - "created_at": 'created_at', - "updated_at": 'updated_at' + "masked_bank_account_number": "masked_bank_account_number", + "payment_type": "payment_type", + "id": "id", + "first_name": "first_name", + "last_name": "last_name", + "customer_id": "customer_id", + "current_vault": "current_vault", + "vault_token": "vault_token", + "billing_address": "billing_address", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "billing_country": "billing_country", + "customer_vault_token": "customer_vault_token", + "billing_address_2": "billing_address_2", + "bank_name": "bank_name", + "masked_bank_routing_number": "masked_bank_routing_number", + "bank_account_type": "bank_account_type", + "bank_account_holder_type": "bank_account_holder_type", + "verified": "verified", + "site_gateway_setting_id": "site_gateway_setting_id", + "gateway_handle": "gateway_handle", + "created_at": "created_at", + "updated_at": "updated_at", } _optionals = [ - 'id', - 'first_name', - 'last_name', - 'customer_id', - 'current_vault', - 'vault_token', - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'bank_name', - 'masked_bank_routing_number', - 'bank_account_type', - 'bank_account_holder_type', - 'verified', - 'site_gateway_setting_id', - 'gateway_handle', - 'created_at', - 'updated_at', + "id", + "first_name", + "last_name", + "customer_id", + "current_vault", + "vault_token", + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "bank_name", + "masked_bank_routing_number", + "bank_account_type", + "bank_account_holder_type", + "verified", + "site_gateway_setting_id", + "gateway_handle", + "created_at", + "updated_at", ] _nullables = [ - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'site_gateway_setting_id', - 'gateway_handle', + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "site_gateway_setting_id", + "gateway_handle", ] - def __init__(self, - masked_bank_account_number=None, - payment_type='bank_account', - id=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - bank_name=APIHelper.SKIP, - masked_bank_routing_number=APIHelper.SKIP, - bank_account_type=APIHelper.SKIP, - bank_account_holder_type=APIHelper.SKIP, - verified=False, - site_gateway_setting_id=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BankAccountPaymentProfile class""" - + def __init__( + self, + masked_bank_account_number=None, + payment_type="bank_account", + id=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + bank_name=APIHelper.SKIP, + masked_bank_routing_number=APIHelper.SKIP, + bank_account_type=APIHelper.SKIP, + bank_account_holder_type=APIHelper.SKIP, + verified=False, + site_gateway_setting_id=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a BankAccountPaymentProfile instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 + self.billing_address_2 = billing_address_2 if bank_name is not APIHelper.SKIP: - self.bank_name = bank_name + self.bank_name = bank_name if masked_bank_routing_number is not APIHelper.SKIP: - self.masked_bank_routing_number = masked_bank_routing_number - self.masked_bank_account_number = masked_bank_account_number + self.masked_bank_routing_number = masked_bank_routing_number + self.masked_bank_account_number = masked_bank_account_number if bank_account_type is not APIHelper.SKIP: - self.bank_account_type = bank_account_type + self.bank_account_type = bank_account_type if bank_account_holder_type is not APIHelper.SKIP: - self.bank_account_holder_type = bank_account_holder_type - self.payment_type = payment_type - self.verified = verified + self.bank_account_holder_type = bank_account_holder_type + self.payment_type = payment_type + self.verified = verified if site_gateway_setting_id is not APIHelper.SKIP: - self.site_gateway_setting_id = site_gateway_setting_id + self.site_gateway_setting_id = site_gateway_setting_id if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None # Add additional model properties to the instance if additional_properties is None: @@ -213,7 +214,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -224,37 +225,109 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - masked_bank_account_number = dictionary.get("masked_bank_account_number") if dictionary.get("masked_bank_account_number") else None - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else 'bank_account' - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if "billing_address" in dictionary.keys() else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if "billing_city" in dictionary.keys() else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if "billing_state" in dictionary.keys() else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if "billing_zip" in dictionary.keys() else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if "billing_country" in dictionary.keys() else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if "customer_vault_token" in dictionary.keys() else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if "billing_address_2" in dictionary.keys() else APIHelper.SKIP - bank_name = dictionary.get("bank_name") if dictionary.get("bank_name") else APIHelper.SKIP - masked_bank_routing_number = dictionary.get("masked_bank_routing_number") if dictionary.get("masked_bank_routing_number") else APIHelper.SKIP - bank_account_type = dictionary.get("bank_account_type") if dictionary.get("bank_account_type") else APIHelper.SKIP - bank_account_holder_type = dictionary.get("bank_account_holder_type") if dictionary.get("bank_account_holder_type") else APIHelper.SKIP - verified = dictionary.get("verified") if dictionary.get("verified") else False - site_gateway_setting_id = dictionary.get("site_gateway_setting_id") if "site_gateway_setting_id" in dictionary.keys() else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if "gateway_handle" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + masked_bank_account_number =\ + dictionary.get("masked_bank_account_number")\ + if dictionary.get("masked_bank_account_number")\ + else None + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else "bank_account" + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if "billing_city" in dictionary.keys()\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if "billing_state" in dictionary.keys()\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if "billing_zip" in dictionary.keys()\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if "billing_country" in dictionary.keys()\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if "customer_vault_token" in dictionary.keys()\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if "billing_address_2" in dictionary.keys()\ + else APIHelper.SKIP + bank_name =\ + dictionary.get("bank_name")\ + if dictionary.get("bank_name")\ + else APIHelper.SKIP + masked_bank_routing_number =\ + dictionary.get("masked_bank_routing_number")\ + if dictionary.get("masked_bank_routing_number")\ + else APIHelper.SKIP + bank_account_type =\ + dictionary.get("bank_account_type")\ + if dictionary.get("bank_account_type")\ + else APIHelper.SKIP + bank_account_holder_type =\ + dictionary.get("bank_account_holder_type")\ + if dictionary.get("bank_account_holder_type")\ + else APIHelper.SKIP + verified =\ + dictionary.get("verified")\ + if dictionary.get("verified")\ + else False + site_gateway_setting_id =\ + dictionary.get("site_gateway_setting_id")\ + if "site_gateway_setting_id" in dictionary.keys()\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(masked_bank_account_number, payment_type, @@ -284,7 +357,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -295,73 +368,320 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.masked_bank_account_number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.payment_type, - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.masked_bank_account_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.payment_type, + type_callable=lambda value: + PaymentType.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('masked_bank_account_number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('payment_type'), - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("masked_bank_account_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("payment_type"), + type_callable=lambda value: + PaymentType.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!r}, ' - f'masked_bank_routing_number={(self.masked_bank_routing_number if hasattr(self, "masked_bank_routing_number") else None)!r}, ' - f'masked_bank_account_number={self.masked_bank_account_number!r}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!r}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!r}, ' - f'payment_type={self.payment_type!r}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!r}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _masked_bank_routing_number=( + self.masked_bank_routing_number + if hasattr(self, "masked_bank_routing_number") + else None + ) + _masked_bank_account_number=self.masked_bank_account_number + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _payment_type=self.payment_type + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"customer_id={_customer_id!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"billing_address={_billing_address!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"billing_country={_billing_country!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"bank_name={_bank_name!r}, " + f"masked_bank_routing_number={_masked_bank_routing_number!r}, " + f"masked_bank_account_number={_masked_bank_account_number!r}, " + f"bank_account_type={_bank_account_type!r}, " + f"bank_account_holder_type={_bank_account_holder_type!r}, " + f"payment_type={_payment_type!r}, " + f"verified={_verified!r}, " + f"site_gateway_setting_id={_site_gateway_setting_id!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!s}, ' - f'masked_bank_routing_number={(self.masked_bank_routing_number if hasattr(self, "masked_bank_routing_number") else None)!s}, ' - f'masked_bank_account_number={self.masked_bank_account_number!s}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!s}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!s}, ' - f'payment_type={self.payment_type!s}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!s}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _masked_bank_routing_number=( + self.masked_bank_routing_number + if hasattr(self, "masked_bank_routing_number") + else None + ) + _masked_bank_account_number=self.masked_bank_account_number + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _payment_type=self.payment_type + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"customer_id={_customer_id!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"billing_address={_billing_address!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"billing_country={_billing_country!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"bank_name={_bank_name!s}, " + f"masked_bank_routing_number={_masked_bank_routing_number!s}, " + f"masked_bank_account_number={_masked_bank_account_number!s}, " + f"bank_account_type={_bank_account_type!s}, " + f"bank_account_holder_type={_bank_account_holder_type!s}, " + f"payment_type={_payment_type!s}, " + f"verified={_verified!s}, " + f"site_gateway_setting_id={_site_gateway_setting_id!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bank_account_response.py b/advancedbilling/models/bank_account_response.py index 159eda24..b6a49094 100644 --- a/advancedbilling/models/bank_account_response.py +++ b/advancedbilling/models/bank_account_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.bank_account_payment_profile import BankAccountPaymentProfile +# ruff: noqa: E501 +from advancedbilling.models.bank_account_payment_profile import ( + BankAccountPaymentProfile, +) -class BankAccountResponse(object): +class BankAccountResponse(object): """Implementation of the 'Bank Account Response' model. Attributes: - payment_profile (BankAccountPaymentProfile): The model property of - type BankAccountPaymentProfile. - additional_properties (Dict[str, object]): The additional properties - for the model. + payment_profile (BankAccountPaymentProfile): The model property of type + BankAccountPaymentProfile. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_profile": 'payment_profile' + "payment_profile": "payment_profile", } - def __init__(self, - payment_profile=None, - additional_properties=None): - """Constructor for the BankAccountResponse class""" - + def __init__( + self, + payment_profile=None, + additional_properties=None): + """Initialize a BankAccountResponse instance.""" # Initialize members of the class - self.payment_profile = payment_profile + self.payment_profile = payment_profile # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_profile = BankAccountPaymentProfile.from_dictionary(dictionary.get('payment_profile')) if dictionary.get('payment_profile') else None + payment_profile =\ + BankAccountPaymentProfile.from_dictionary( + dictionary.get("payment_profile"))\ + if dictionary.get("payment_profile") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_profile, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bank_account_type.py b/advancedbilling/models/bank_account_type.py index 4ac44387..9bb841f9 100644 --- a/advancedbilling/models/bank_account_type.py +++ b/advancedbilling/models/bank_account_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class BankAccountType(object): - """Implementation of the 'Bank Account Type' enum. Defaults to checking @@ -17,18 +14,19 @@ class BankAccountType(object): Attributes: CHECKING: The enum member of type str. SAVINGS: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['checking', 'savings'] - CHECKING = 'checking' - SAVINGS = 'savings' + _all_values = ["checking", "savings"] + CHECKING = "checking" + + SAVINGS = "savings" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -38,9 +36,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/bank_account_vault.py b/advancedbilling/models/bank_account_vault.py index e396d16c..d09cdbc1 100644 --- a/advancedbilling/models/bank_account_vault.py +++ b/advancedbilling/models/bank_account_vault.py @@ -1,19 +1,16 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class BankAccountVault(object): - """Implementation of the 'Bank Account Vault' enum. - The vault that stores the payment profile with the provided vault_token. - Use `bogus` for testing. + The vault that stores the payment profile with the provided vault_token. Use + `bogus` for testing. Attributes: AUTHORIZENET: The enum member of type str. @@ -24,30 +21,32 @@ class BankAccountVault(object): MAXIO_PAYMENTS: The enum member of type str. MAXP: The enum member of type str. STRIPE_CONNECT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['authorizenet', 'blue_snap', 'bogus', 'forte', 'gocardless', 'maxio_payments', 'maxp', 'stripe_connect'] - AUTHORIZENET = 'authorizenet' - BLUE_SNAP = 'blue_snap' + _all_values = ["authorizenet", "blue_snap", "bogus", "forte", + "gocardless", "maxio_payments", "maxp", "stripe_connect"] + AUTHORIZENET = "authorizenet" - BOGUS = 'bogus' + BLUE_SNAP = "blue_snap" - FORTE = 'forte' + BOGUS = "bogus" - GOCARDLESS = 'gocardless' + FORTE = "forte" - MAXIO_PAYMENTS = 'maxio_payments' + GOCARDLESS = "gocardless" - MAXP = 'maxp' + MAXIO_PAYMENTS = "maxio_payments" - STRIPE_CONNECT = 'stripe_connect' + MAXP = "maxp" + + STRIPE_CONNECT = "stripe_connect" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -57,9 +56,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/bank_account_verification.py b/advancedbilling/models/bank_account_verification.py index c6f0a01f..a64d44ea 100644 --- a/advancedbilling/models/bank_account_verification.py +++ b/advancedbilling/models/bank_account_verification.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class BankAccountVerification(object): - """Implementation of the 'Bank Account Verification' model. Attributes: deposit_1_in_cents (int): The model property of type int. deposit_2_in_cents (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "deposit_1_in_cents": 'deposit_1_in_cents', - "deposit_2_in_cents": 'deposit_2_in_cents' + "deposit_1_in_cents": "deposit_1_in_cents", + "deposit_2_in_cents": "deposit_2_in_cents", } _optionals = [ - 'deposit_1_in_cents', - 'deposit_2_in_cents', + "deposit_1_in_cents", + "deposit_2_in_cents", ] - def __init__(self, - deposit_1_in_cents=APIHelper.SKIP, - deposit_2_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BankAccountVerification class""" - + def __init__( + self, + deposit_1_in_cents=APIHelper.SKIP, + deposit_2_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a BankAccountVerification instance.""" # Initialize members of the class if deposit_1_in_cents is not APIHelper.SKIP: - self.deposit_1_in_cents = deposit_1_in_cents + self.deposit_1_in_cents = deposit_1_in_cents if deposit_2_in_cents is not APIHelper.SKIP: - self.deposit_2_in_cents = deposit_2_in_cents + self.deposit_2_in_cents = deposit_2_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - deposit_1_in_cents = dictionary.get("deposit_1_in_cents") if dictionary.get("deposit_1_in_cents") else APIHelper.SKIP - deposit_2_in_cents = dictionary.get("deposit_2_in_cents") if dictionary.get("deposit_2_in_cents") else APIHelper.SKIP + deposit_1_in_cents =\ + dictionary.get("deposit_1_in_cents")\ + if dictionary.get("deposit_1_in_cents")\ + else APIHelper.SKIP + deposit_2_in_cents =\ + dictionary.get("deposit_2_in_cents")\ + if dictionary.get("deposit_2_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(deposit_1_in_cents, deposit_2_in_cents, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'deposit_1_in_cents={(self.deposit_1_in_cents if hasattr(self, "deposit_1_in_cents") else None)!r}, ' - f'deposit_2_in_cents={(self.deposit_2_in_cents if hasattr(self, "deposit_2_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _deposit_1_in_cents=( + self.deposit_1_in_cents + if hasattr(self, "deposit_1_in_cents") + else None + ) + _deposit_2_in_cents=( + self.deposit_2_in_cents + if hasattr(self, "deposit_2_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"deposit_1_in_cents={_deposit_1_in_cents!r}, " + f"deposit_2_in_cents={_deposit_2_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'deposit_1_in_cents={(self.deposit_1_in_cents if hasattr(self, "deposit_1_in_cents") else None)!s}, ' - f'deposit_2_in_cents={(self.deposit_2_in_cents if hasattr(self, "deposit_2_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _deposit_1_in_cents=( + self.deposit_1_in_cents + if hasattr(self, "deposit_1_in_cents") + else None + ) + _deposit_2_in_cents=( + self.deposit_2_in_cents + if hasattr(self, "deposit_2_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"deposit_1_in_cents={_deposit_1_in_cents!s}, " + f"deposit_2_in_cents={_deposit_2_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bank_account_verification_request.py b/advancedbilling/models/bank_account_verification_request.py index f61a6f08..d839c26f 100644 --- a/advancedbilling/models/bank_account_verification_request.py +++ b/advancedbilling/models/bank_account_verification_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.bank_account_verification import BankAccountVerification +# ruff: noqa: E501 +from advancedbilling.models.bank_account_verification import ( + BankAccountVerification, +) -class BankAccountVerificationRequest(object): +class BankAccountVerificationRequest(object): """Implementation of the 'Bank Account Verification Request' model. Attributes: - bank_account_verification (BankAccountVerification): The model - property of type BankAccountVerification. - additional_properties (Dict[str, object]): The additional properties - for the model. + bank_account_verification (BankAccountVerification): The model property of + type BankAccountVerification. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "bank_account_verification": 'bank_account_verification' + "bank_account_verification": "bank_account_verification", } - def __init__(self, - bank_account_verification=None, - additional_properties=None): - """Constructor for the BankAccountVerificationRequest class""" - + def __init__( + self, + bank_account_verification=None, + additional_properties=None): + """Initialize a BankAccountVerificationRequest instance.""" # Initialize members of the class - self.bank_account_verification = bank_account_verification + self.bank_account_verification = bank_account_verification # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - bank_account_verification = BankAccountVerification.from_dictionary(dictionary.get('bank_account_verification')) if dictionary.get('bank_account_verification') else None + bank_account_verification =\ + BankAccountVerification.from_dictionary( + dictionary.get("bank_account_verification"))\ + if dictionary.get("bank_account_verification") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(bank_account_verification, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'bank_account_verification={self.bank_account_verification!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _bank_account_verification=self.bank_account_verification + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"bank_account_verification={_bank_account_verification!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'bank_account_verification={self.bank_account_verification!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _bank_account_verification=self.bank_account_verification + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"bank_account_verification={_bank_account_verification!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/base_refund_error.py b/advancedbilling/models/base_refund_error.py index 61a5f456..f7feb650 100644 --- a/advancedbilling/models/base_refund_error.py +++ b/advancedbilling/models/base_refund_error.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class BaseRefundError(object): - """Implementation of the 'Base Refund Error' model. Attributes: base (List[Any]): The model property of type List[Any]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "base": 'base' + "base": "base", } _optionals = [ - 'base', + "base", ] - def __init__(self, - base=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BaseRefundError class""" - + def __init__( + self, + base=APIHelper.SKIP, + additional_properties=None): + """Initialize a BaseRefundError instance.""" # Initialize members of the class if base is not APIHelper.SKIP: - self.base = base + self.base = base # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - base = dictionary.get("base") if dictionary.get("base") else APIHelper.SKIP + base =\ + dictionary.get("base")\ + if dictionary.get("base")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(base, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'base={(self.base if hasattr(self, "base") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _base=( + self.base + if hasattr(self, "base") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"base={_base!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'base={(self.base if hasattr(self, "base") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _base=( + self.base + if hasattr(self, "base") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"base={_base!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/base_string_error.py b/advancedbilling/models/base_string_error.py index 17a730b3..3e3d700b 100644 --- a/advancedbilling/models/base_string_error.py +++ b/advancedbilling/models/base_string_error.py @@ -1,44 +1,42 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class BaseStringError(object): - """Implementation of the 'Base String Error' model. The error is base if it is not directly associated with a single attribute. Attributes: base (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "base": 'base' + "base": "base", } _optionals = [ - 'base', + "base", ] - def __init__(self, - base=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BaseStringError class""" - + def __init__( + self, + base=APIHelper.SKIP, + additional_properties=None): + """Initialize a BaseStringError instance.""" # Initialize members of the class if base is not APIHelper.SKIP: - self.base = base + self.base = base # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +46,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,24 +57,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - base = dictionary.get("base") if dictionary.get("base") else APIHelper.SKIP + base =\ + dictionary.get("base")\ + if dictionary.get("base")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(base, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'base={(self.base if hasattr(self, "base") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _base=( + self.base + if hasattr(self, "base") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"base={_base!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'base={(self.base if hasattr(self, "base") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _base=( + self.base + if hasattr(self, "base") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"base={_base!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/basic_date_field.py b/advancedbilling/models/basic_date_field.py index 7ec14100..349d4064 100644 --- a/advancedbilling/models/basic_date_field.py +++ b/advancedbilling/models/basic_date_field.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class BasicDateField(object): - """Implementation of the 'Basic Date Field' enum. Allows to filter by `created_at` or `updated_at`. @@ -17,16 +14,18 @@ class BasicDateField(object): Attributes: UPDATED_AT: The enum member of type str. CREATED_AT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - UPDATED_AT = 'updated_at' - CREATED_AT = 'created_at' + UPDATED_AT = "updated_at" + + CREATED_AT = "created_at" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/batch_job.py b/advancedbilling/models/batch_job.py index 0571a8dc..b8911f04 100644 --- a/advancedbilling/models/batch_job.py +++ b/advancedbilling/models/batch_job.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class BatchJob(object): - """Implementation of the 'Batch-Job' model. Attributes: @@ -19,54 +17,60 @@ class BatchJob(object): row_count (int): The model property of type int. created_at (datetime): The model property of type datetime. completed (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "finished_at": 'finished_at', - "row_count": 'row_count', - "created_at": 'created_at', - "completed": 'completed' + "id": "id", + "finished_at": "finished_at", + "row_count": "row_count", + "created_at": "created_at", + "completed": "completed", } _optionals = [ - 'id', - 'finished_at', - 'row_count', - 'created_at', - 'completed', + "id", + "finished_at", + "row_count", + "created_at", + "completed", ] _nullables = [ - 'finished_at', - 'row_count', - 'created_at', + "finished_at", + "row_count", + "created_at", ] - def __init__(self, - id=APIHelper.SKIP, - finished_at=APIHelper.SKIP, - row_count=APIHelper.SKIP, - created_at=APIHelper.SKIP, - completed=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BatchJob class""" - + def __init__( + self, + id=APIHelper.SKIP, + finished_at=APIHelper.SKIP, + row_count=APIHelper.SKIP, + created_at=APIHelper.SKIP, + completed=APIHelper.SKIP, + additional_properties=None): + """Initialize a BatchJob instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if finished_at is not APIHelper.SKIP: - self.finished_at = APIHelper.apply_datetime_converter(finished_at, APIHelper.RFC3339DateTime) if finished_at else None + self.finished_at =\ + APIHelper.apply_datetime_converter( + finished_at, APIHelper.RFC3339DateTime)\ + if finished_at else None if row_count is not APIHelper.SKIP: - self.row_count = row_count + self.row_count = row_count if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if completed is not APIHelper.SKIP: - self.completed = completed + self.completed = completed # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +80,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,24 +91,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - if 'finished_at' in dictionary.keys(): - finished_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("finished_at")).datetime if dictionary.get("finished_at") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + if "finished_at" in dictionary.keys(): + finished_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("finished_at")).datetime\ + if dictionary.get("finished_at") else None + else: finished_at = APIHelper.SKIP - row_count = dictionary.get("row_count") if "row_count" in dictionary.keys() else APIHelper.SKIP - if 'created_at' in dictionary.keys(): - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else None + row_count =\ + dictionary.get("row_count")\ + if "row_count" in dictionary.keys()\ + else APIHelper.SKIP + if "created_at" in dictionary.keys(): + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else None + else: created_at = APIHelper.SKIP - completed = dictionary.get("completed") if dictionary.get("completed") else APIHelper.SKIP + completed =\ + dictionary.get("completed")\ + if dictionary.get("completed")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, finished_at, @@ -114,19 +135,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'finished_at={(self.finished_at if hasattr(self, "finished_at") else None)!r}, ' - f'row_count={(self.row_count if hasattr(self, "row_count") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'completed={(self.completed if hasattr(self, "completed") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _finished_at=( + self.finished_at + if hasattr(self, "finished_at") + else None + ) + _row_count=( + self.row_count + if hasattr(self, "row_count") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _completed=( + self.completed + if hasattr(self, "completed") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"finished_at={_finished_at!r}, " + f"row_count={_row_count!r}, " + f"created_at={_created_at!r}, " + f"completed={_completed!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'finished_at={(self.finished_at if hasattr(self, "finished_at") else None)!s}, ' - f'row_count={(self.row_count if hasattr(self, "row_count") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'completed={(self.completed if hasattr(self, "completed") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _finished_at=( + self.finished_at + if hasattr(self, "finished_at") + else None + ) + _row_count=( + self.row_count + if hasattr(self, "row_count") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _completed=( + self.completed + if hasattr(self, "completed") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"finished_at={_finished_at!s}, " + f"row_count={_row_count!s}, " + f"created_at={_created_at!s}, " + f"completed={_completed!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/batch_job_response.py b/advancedbilling/models/batch_job_response.py index 5ef9a4c8..6ee9b2e4 100644 --- a/advancedbilling/models/batch_job_response.py +++ b/advancedbilling/models/batch_job_response.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.batch_job import BatchJob +# ruff: noqa: E501 +from advancedbilling.models.batch_job import ( + BatchJob, +) -class BatchJobResponse(object): +class BatchJobResponse(object): """Implementation of the 'Batch Job Response' model. Attributes: batchjob (BatchJob): The model property of type BatchJob. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "batchjob": 'batchjob' + "batchjob": "batchjob", } - def __init__(self, - batchjob=None, - additional_properties=None): - """Constructor for the BatchJobResponse class""" - + def __init__( + self, + batchjob=None, + additional_properties=None): + """Initialize a BatchJobResponse instance.""" # Initialize members of the class - self.batchjob = batchjob + self.batchjob = batchjob # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - batchjob = BatchJob.from_dictionary(dictionary.get('batchjob')) if dictionary.get('batchjob') else None + batchjob =\ + BatchJob.from_dictionary( + dictionary.get("batchjob"))\ + if dictionary.get("batchjob") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(batchjob, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'batchjob={self.batchjob!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _batchjob=self.batchjob + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"batchjob={_batchjob!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'batchjob={self.batchjob!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _batchjob=self.batchjob + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"batchjob={_batchjob!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/billing_manifest.py b/advancedbilling/models/billing_manifest.py index 3d6e79d8..c8c26277 100644 --- a/advancedbilling/models/billing_manifest.py +++ b/advancedbilling/models/billing_manifest.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.billing_manifest_item import BillingManifestItem +from advancedbilling.models.billing_manifest_item import ( + BillingManifestItem, +) class BillingManifest(object): - """Implementation of the 'Billing Manifest' model. Attributes: @@ -25,74 +25,80 @@ class BillingManifest(object): end_date (datetime): The model property of type datetime. period_type (str): The model property of type str. existing_balance_in_cents (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "line_items": 'line_items', - "total_in_cents": 'total_in_cents', - "total_discount_in_cents": 'total_discount_in_cents', - "total_tax_in_cents": 'total_tax_in_cents', - "subtotal_in_cents": 'subtotal_in_cents', - "start_date": 'start_date', - "end_date": 'end_date', - "period_type": 'period_type', - "existing_balance_in_cents": 'existing_balance_in_cents' + "line_items": "line_items", + "total_in_cents": "total_in_cents", + "total_discount_in_cents": "total_discount_in_cents", + "total_tax_in_cents": "total_tax_in_cents", + "subtotal_in_cents": "subtotal_in_cents", + "start_date": "start_date", + "end_date": "end_date", + "period_type": "period_type", + "existing_balance_in_cents": "existing_balance_in_cents", } _optionals = [ - 'line_items', - 'total_in_cents', - 'total_discount_in_cents', - 'total_tax_in_cents', - 'subtotal_in_cents', - 'start_date', - 'end_date', - 'period_type', - 'existing_balance_in_cents', + "line_items", + "total_in_cents", + "total_discount_in_cents", + "total_tax_in_cents", + "subtotal_in_cents", + "start_date", + "end_date", + "period_type", + "existing_balance_in_cents", ] _nullables = [ - 'start_date', - 'end_date', - 'period_type', + "start_date", + "end_date", + "period_type", ] - def __init__(self, - line_items=APIHelper.SKIP, - total_in_cents=APIHelper.SKIP, - total_discount_in_cents=APIHelper.SKIP, - total_tax_in_cents=APIHelper.SKIP, - subtotal_in_cents=APIHelper.SKIP, - start_date=APIHelper.SKIP, - end_date=APIHelper.SKIP, - period_type=APIHelper.SKIP, - existing_balance_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BillingManifest class""" - + def __init__( + self, + line_items=APIHelper.SKIP, + total_in_cents=APIHelper.SKIP, + total_discount_in_cents=APIHelper.SKIP, + total_tax_in_cents=APIHelper.SKIP, + subtotal_in_cents=APIHelper.SKIP, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + period_type=APIHelper.SKIP, + existing_balance_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a BillingManifest instance.""" # Initialize members of the class if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if total_in_cents is not APIHelper.SKIP: - self.total_in_cents = total_in_cents + self.total_in_cents = total_in_cents if total_discount_in_cents is not APIHelper.SKIP: - self.total_discount_in_cents = total_discount_in_cents + self.total_discount_in_cents = total_discount_in_cents if total_tax_in_cents is not APIHelper.SKIP: - self.total_tax_in_cents = total_tax_in_cents + self.total_tax_in_cents = total_tax_in_cents if subtotal_in_cents is not APIHelper.SKIP: - self.subtotal_in_cents = subtotal_in_cents + self.subtotal_in_cents = subtotal_in_cents if start_date is not APIHelper.SKIP: - self.start_date = APIHelper.apply_datetime_converter(start_date, APIHelper.RFC3339DateTime) if start_date else None + self.start_date =\ + APIHelper.apply_datetime_converter( + start_date, APIHelper.RFC3339DateTime)\ + if start_date else None if end_date is not APIHelper.SKIP: - self.end_date = APIHelper.apply_datetime_converter(end_date, APIHelper.RFC3339DateTime) if end_date else None + self.end_date =\ + APIHelper.apply_datetime_converter( + end_date, APIHelper.RFC3339DateTime)\ + if end_date else None if period_type is not APIHelper.SKIP: - self.period_type = period_type + self.period_type = period_type if existing_balance_in_cents is not APIHelper.SKIP: - self.existing_balance_in_cents = existing_balance_in_cents + self.existing_balance_in_cents = existing_balance_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -102,7 +108,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -113,32 +119,61 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary line_items = None - if dictionary.get('line_items') is not None: - line_items = [BillingManifestItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + BillingManifestItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP - total_in_cents = dictionary.get("total_in_cents") if dictionary.get("total_in_cents") else APIHelper.SKIP - total_discount_in_cents = dictionary.get("total_discount_in_cents") if dictionary.get("total_discount_in_cents") else APIHelper.SKIP - total_tax_in_cents = dictionary.get("total_tax_in_cents") if dictionary.get("total_tax_in_cents") else APIHelper.SKIP - subtotal_in_cents = dictionary.get("subtotal_in_cents") if dictionary.get("subtotal_in_cents") else APIHelper.SKIP - if 'start_date' in dictionary.keys(): - start_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("start_date")).datetime if dictionary.get("start_date") else None + total_in_cents =\ + dictionary.get("total_in_cents")\ + if dictionary.get("total_in_cents")\ + else APIHelper.SKIP + total_discount_in_cents =\ + dictionary.get("total_discount_in_cents")\ + if dictionary.get("total_discount_in_cents")\ + else APIHelper.SKIP + total_tax_in_cents =\ + dictionary.get("total_tax_in_cents")\ + if dictionary.get("total_tax_in_cents")\ + else APIHelper.SKIP + subtotal_in_cents =\ + dictionary.get("subtotal_in_cents")\ + if dictionary.get("subtotal_in_cents")\ + else APIHelper.SKIP + if "start_date" in dictionary.keys(): + start_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("start_date")).datetime\ + if dictionary.get("start_date") else None + else: start_date = APIHelper.SKIP - if 'end_date' in dictionary.keys(): - end_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_date")).datetime if dictionary.get("end_date") else None + if "end_date" in dictionary.keys(): + end_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("end_date")).datetime\ + if dictionary.get("end_date") else None + else: end_date = APIHelper.SKIP - period_type = dictionary.get("period_type") if "period_type" in dictionary.keys() else APIHelper.SKIP - existing_balance_in_cents = dictionary.get("existing_balance_in_cents") if dictionary.get("existing_balance_in_cents") else APIHelper.SKIP + period_type =\ + dictionary.get("period_type")\ + if "period_type" in dictionary.keys()\ + else APIHelper.SKIP + existing_balance_in_cents =\ + dictionary.get("existing_balance_in_cents")\ + if dictionary.get("existing_balance_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(line_items, total_in_cents, @@ -152,27 +187,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'total_in_cents={(self.total_in_cents if hasattr(self, "total_in_cents") else None)!r}, ' - f'total_discount_in_cents={(self.total_discount_in_cents if hasattr(self, "total_discount_in_cents") else None)!r}, ' - f'total_tax_in_cents={(self.total_tax_in_cents if hasattr(self, "total_tax_in_cents") else None)!r}, ' - f'subtotal_in_cents={(self.subtotal_in_cents if hasattr(self, "subtotal_in_cents") else None)!r}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'period_type={(self.period_type if hasattr(self, "period_type") else None)!r}, ' - f'existing_balance_in_cents={(self.existing_balance_in_cents if hasattr(self, "existing_balance_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _total_in_cents=( + self.total_in_cents + if hasattr(self, "total_in_cents") + else None + ) + _total_discount_in_cents=( + self.total_discount_in_cents + if hasattr(self, "total_discount_in_cents") + else None + ) + _total_tax_in_cents=( + self.total_tax_in_cents + if hasattr(self, "total_tax_in_cents") + else None + ) + _subtotal_in_cents=( + self.subtotal_in_cents + if hasattr(self, "subtotal_in_cents") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _period_type=( + self.period_type + if hasattr(self, "period_type") + else None + ) + _existing_balance_in_cents=( + self.existing_balance_in_cents + if hasattr(self, "existing_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"line_items={_line_items!r}, " + f"total_in_cents={_total_in_cents!r}, " + f"total_discount_in_cents={_total_discount_in_cents!r}, " + f"total_tax_in_cents={_total_tax_in_cents!r}, " + f"subtotal_in_cents={_subtotal_in_cents!r}, " + f"start_date={_start_date!r}, " + f"end_date={_end_date!r}, " + f"period_type={_period_type!r}, " + f"existing_balance_in_cents={_existing_balance_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'total_in_cents={(self.total_in_cents if hasattr(self, "total_in_cents") else None)!s}, ' - f'total_discount_in_cents={(self.total_discount_in_cents if hasattr(self, "total_discount_in_cents") else None)!s}, ' - f'total_tax_in_cents={(self.total_tax_in_cents if hasattr(self, "total_tax_in_cents") else None)!s}, ' - f'subtotal_in_cents={(self.subtotal_in_cents if hasattr(self, "subtotal_in_cents") else None)!s}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'period_type={(self.period_type if hasattr(self, "period_type") else None)!s}, ' - f'existing_balance_in_cents={(self.existing_balance_in_cents if hasattr(self, "existing_balance_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _total_in_cents=( + self.total_in_cents + if hasattr(self, "total_in_cents") + else None + ) + _total_discount_in_cents=( + self.total_discount_in_cents + if hasattr(self, "total_discount_in_cents") + else None + ) + _total_tax_in_cents=( + self.total_tax_in_cents + if hasattr(self, "total_tax_in_cents") + else None + ) + _subtotal_in_cents=( + self.subtotal_in_cents + if hasattr(self, "subtotal_in_cents") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _period_type=( + self.period_type + if hasattr(self, "period_type") + else None + ) + _existing_balance_in_cents=( + self.existing_balance_in_cents + if hasattr(self, "existing_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"line_items={_line_items!s}, " + f"total_in_cents={_total_in_cents!s}, " + f"total_discount_in_cents={_total_discount_in_cents!s}, " + f"total_tax_in_cents={_total_tax_in_cents!s}, " + f"subtotal_in_cents={_subtotal_in_cents!s}, " + f"start_date={_start_date!s}, " + f"end_date={_end_date!s}, " + f"period_type={_period_type!s}, " + f"existing_balance_in_cents={_existing_balance_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/billing_manifest_item.py b/advancedbilling/models/billing_manifest_item.py index 8e40a02e..ebfc2797 100644 --- a/advancedbilling/models/billing_manifest_item.py +++ b/advancedbilling/models/billing_manifest_item.py @@ -1,23 +1,21 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class BillingManifestItem(object): - """Implementation of the 'Billing Manifest Item' model. Attributes: transaction_type (LineItemTransactionType): A handle for the line item transaction type - kind (BillingManifestLineItemKind): A handle for the billing manifest - line item kind + kind (BillingManifestLineItemKind): A handle for the billing manifest line + item kind amount_in_cents (int): The model property of type int. memo (str): The model property of type str. discount_amount_in_cents (int): The model property of type int. @@ -30,93 +28,93 @@ class BillingManifestItem(object): product_name (str): The model property of type str. period_range_start (str): The model property of type str. period_range_end (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "transaction_type": 'transaction_type', - "kind": 'kind', - "amount_in_cents": 'amount_in_cents', - "memo": 'memo', - "discount_amount_in_cents": 'discount_amount_in_cents', - "taxable_amount_in_cents": 'taxable_amount_in_cents', - "component_id": 'component_id', - "component_handle": 'component_handle', - "component_name": 'component_name', - "product_id": 'product_id', - "product_handle": 'product_handle', - "product_name": 'product_name', - "period_range_start": 'period_range_start', - "period_range_end": 'period_range_end' + "transaction_type": "transaction_type", + "kind": "kind", + "amount_in_cents": "amount_in_cents", + "memo": "memo", + "discount_amount_in_cents": "discount_amount_in_cents", + "taxable_amount_in_cents": "taxable_amount_in_cents", + "component_id": "component_id", + "component_handle": "component_handle", + "component_name": "component_name", + "product_id": "product_id", + "product_handle": "product_handle", + "product_name": "product_name", + "period_range_start": "period_range_start", + "period_range_end": "period_range_end", } _optionals = [ - 'transaction_type', - 'kind', - 'amount_in_cents', - 'memo', - 'discount_amount_in_cents', - 'taxable_amount_in_cents', - 'component_id', - 'component_handle', - 'component_name', - 'product_id', - 'product_handle', - 'product_name', - 'period_range_start', - 'period_range_end', + "transaction_type", + "kind", + "amount_in_cents", + "memo", + "discount_amount_in_cents", + "taxable_amount_in_cents", + "component_id", + "component_handle", + "component_name", + "product_id", + "product_handle", + "product_name", + "period_range_start", + "period_range_end", ] - def __init__(self, - transaction_type=APIHelper.SKIP, - kind=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - memo=APIHelper.SKIP, - discount_amount_in_cents=APIHelper.SKIP, - taxable_amount_in_cents=APIHelper.SKIP, - component_id=APIHelper.SKIP, - component_handle=APIHelper.SKIP, - component_name=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_handle=APIHelper.SKIP, - product_name=APIHelper.SKIP, - period_range_start=APIHelper.SKIP, - period_range_end=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BillingManifestItem class""" - + def __init__( + self, + transaction_type=APIHelper.SKIP, + kind=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + memo=APIHelper.SKIP, + discount_amount_in_cents=APIHelper.SKIP, + taxable_amount_in_cents=APIHelper.SKIP, + component_id=APIHelper.SKIP, + component_handle=APIHelper.SKIP, + component_name=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_handle=APIHelper.SKIP, + product_name=APIHelper.SKIP, + period_range_start=APIHelper.SKIP, + period_range_end=APIHelper.SKIP, + additional_properties=None): + """Initialize a BillingManifestItem instance.""" # Initialize members of the class if transaction_type is not APIHelper.SKIP: - self.transaction_type = transaction_type + self.transaction_type = transaction_type if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if discount_amount_in_cents is not APIHelper.SKIP: - self.discount_amount_in_cents = discount_amount_in_cents + self.discount_amount_in_cents = discount_amount_in_cents if taxable_amount_in_cents is not APIHelper.SKIP: - self.taxable_amount_in_cents = taxable_amount_in_cents + self.taxable_amount_in_cents = taxable_amount_in_cents if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if component_handle is not APIHelper.SKIP: - self.component_handle = component_handle + self.component_handle = component_handle if component_name is not APIHelper.SKIP: - self.component_name = component_name + self.component_name = component_name if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if product_name is not APIHelper.SKIP: - self.product_name = product_name + self.product_name = product_name if period_range_start is not APIHelper.SKIP: - self.period_range_start = period_range_start + self.period_range_start = period_range_start if period_range_end is not APIHelper.SKIP: - self.period_range_end = period_range_end + self.period_range_end = period_range_end # Add additional model properties to the instance if additional_properties is None: @@ -126,7 +124,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -137,27 +135,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - transaction_type = dictionary.get("transaction_type") if dictionary.get("transaction_type") else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - discount_amount_in_cents = dictionary.get("discount_amount_in_cents") if dictionary.get("discount_amount_in_cents") else APIHelper.SKIP - taxable_amount_in_cents = dictionary.get("taxable_amount_in_cents") if dictionary.get("taxable_amount_in_cents") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else APIHelper.SKIP - component_name = dictionary.get("component_name") if dictionary.get("component_name") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_handle = dictionary.get("product_handle") if dictionary.get("product_handle") else APIHelper.SKIP - product_name = dictionary.get("product_name") if dictionary.get("product_name") else APIHelper.SKIP - period_range_start = dictionary.get("period_range_start") if dictionary.get("period_range_start") else APIHelper.SKIP - period_range_end = dictionary.get("period_range_end") if dictionary.get("period_range_end") else APIHelper.SKIP + transaction_type =\ + dictionary.get("transaction_type")\ + if dictionary.get("transaction_type")\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + discount_amount_in_cents =\ + dictionary.get("discount_amount_in_cents")\ + if dictionary.get("discount_amount_in_cents")\ + else APIHelper.SKIP + taxable_amount_in_cents =\ + dictionary.get("taxable_amount_in_cents")\ + if dictionary.get("taxable_amount_in_cents")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + component_handle =\ + dictionary.get("component_handle")\ + if dictionary.get("component_handle")\ + else APIHelper.SKIP + component_name =\ + dictionary.get("component_name")\ + if dictionary.get("component_name")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_handle =\ + dictionary.get("product_handle")\ + if dictionary.get("product_handle")\ + else APIHelper.SKIP + product_name =\ + dictionary.get("product_name")\ + if dictionary.get("product_name")\ + else APIHelper.SKIP + period_range_start =\ + dictionary.get("period_range_start")\ + if dictionary.get("period_range_start")\ + else APIHelper.SKIP + period_range_end =\ + dictionary.get("period_range_end")\ + if dictionary.get("period_range_end")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(transaction_type, kind, @@ -176,37 +218,187 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'transaction_type={(self.transaction_type if hasattr(self, "transaction_type") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'discount_amount_in_cents={(self.discount_amount_in_cents if hasattr(self, "discount_amount_in_cents") else None)!r}, ' - f'taxable_amount_in_cents={(self.taxable_amount_in_cents if hasattr(self, "taxable_amount_in_cents") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!r}, ' - f'component_name={(self.component_name if hasattr(self, "component_name") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!r}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!r}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _transaction_type=( + self.transaction_type + if hasattr(self, "transaction_type") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _discount_amount_in_cents=( + self.discount_amount_in_cents + if hasattr(self, "discount_amount_in_cents") + else None + ) + _taxable_amount_in_cents=( + self.taxable_amount_in_cents + if hasattr(self, "taxable_amount_in_cents") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _component_name=( + self.component_name + if hasattr(self, "component_name") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_type={_transaction_type!r}, " + f"kind={_kind!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"memo={_memo!r}, " + f"discount_amount_in_cents={_discount_amount_in_cents!r}, " + f"taxable_amount_in_cents={_taxable_amount_in_cents!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"component_name={_component_name!r}, " + f"product_id={_product_id!r}, " + f"product_handle={_product_handle!r}, " + f"product_name={_product_name!r}, " + f"period_range_start={_period_range_start!r}, " + f"period_range_end={_period_range_end!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'transaction_type={(self.transaction_type if hasattr(self, "transaction_type") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'discount_amount_in_cents={(self.discount_amount_in_cents if hasattr(self, "discount_amount_in_cents") else None)!s}, ' - f'taxable_amount_in_cents={(self.taxable_amount_in_cents if hasattr(self, "taxable_amount_in_cents") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!s}, ' - f'component_name={(self.component_name if hasattr(self, "component_name") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!s}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!s}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _transaction_type=( + self.transaction_type + if hasattr(self, "transaction_type") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _discount_amount_in_cents=( + self.discount_amount_in_cents + if hasattr(self, "discount_amount_in_cents") + else None + ) + _taxable_amount_in_cents=( + self.taxable_amount_in_cents + if hasattr(self, "taxable_amount_in_cents") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _component_name=( + self.component_name + if hasattr(self, "component_name") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_type={_transaction_type!s}, " + f"kind={_kind!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"memo={_memo!s}, " + f"discount_amount_in_cents={_discount_amount_in_cents!s}, " + f"taxable_amount_in_cents={_taxable_amount_in_cents!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"component_name={_component_name!s}, " + f"product_id={_product_id!s}, " + f"product_handle={_product_handle!s}, " + f"product_name={_product_name!s}, " + f"period_range_start={_period_range_start!s}, " + f"period_range_end={_period_range_end!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/billing_manifest_line_item_kind.py b/advancedbilling/models/billing_manifest_line_item_kind.py index abfb0d50..c0ba11cf 100644 --- a/advancedbilling/models/billing_manifest_line_item_kind.py +++ b/advancedbilling/models/billing_manifest_line_item_kind.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class BillingManifestLineItemKind(object): - """Implementation of the 'Billing Manifest Line Item Kind' enum. A handle for the billing manifest line item kind @@ -21,24 +18,26 @@ class BillingManifestLineItemKind(object): COUPON: The enum member of type str. COMPONENT: The enum member of type str. TAX: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - BASELINE = 'baseline' - INITIAL = 'initial' + BASELINE = "baseline" + + INITIAL = "initial" - TRIAL = 'trial' + TRIAL = "trial" - COUPON = 'coupon' + COUPON = "coupon" - COMPONENT = 'component' + COMPONENT = "component" - TAX = 'tax' + TAX = "tax" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/billing_schedule.py b/advancedbilling/models/billing_schedule.py index 4ca015eb..6b59e2ad 100644 --- a/advancedbilling/models/billing_schedule.py +++ b/advancedbilling/models/billing_schedule.py @@ -1,51 +1,49 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class BillingSchedule(object): - """Implementation of the 'Billing Schedule' model. - This attribute is particularly useful when you need to align billing - events for different components on distinct schedules within a - subscription. This only works for site with Multifrequency enabled. + This attribute is particularly useful when you need to align billing events for + different components on distinct schedules within a subscription. This only works + for site with Multifrequency enabled. Attributes: - initial_billing_at (date): The initial_billing_at attribute in Maxio - allows you to specify a custom starting date for billing cycles - associated with components that have their own billing frequency - set. Only ISO8601 format is supported. - additional_properties (Dict[str, object]): The additional properties - for the model. + initial_billing_at (date): The initial_billing_at attribute in Maxio allows + you to specify a custom starting date for billing cycles associated with + components that have their own billing frequency set. Only ISO8601 format + is supported. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "initial_billing_at": 'initial_billing_at' + "initial_billing_at": "initial_billing_at", } _optionals = [ - 'initial_billing_at', + "initial_billing_at", ] - def __init__(self, - initial_billing_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BillingSchedule class""" - + def __init__( + self, + initial_billing_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a BillingSchedule instance.""" # Initialize members of the class if initial_billing_at is not APIHelper.SKIP: - self.initial_billing_at = initial_billing_at + self.initial_billing_at = initial_billing_at # Add additional model properties to the instance if additional_properties is None: @@ -55,7 +53,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -66,21 +64,25 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - initial_billing_at = dateutil.parser.parse(dictionary.get('initial_billing_at')).date() if dictionary.get('initial_billing_at') else APIHelper.SKIP + initial_billing_at = dateutil.parser.parse( + dictionary.get("initial_billing_at")).date()\ + if dictionary.get("initial_billing_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(initial_billing_at, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -91,7 +93,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -101,11 +102,31 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'initial_billing_at={(self.initial_billing_at if hasattr(self, "initial_billing_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _initial_billing_at=( + self.initial_billing_at + if hasattr(self, "initial_billing_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"initial_billing_at={_initial_billing_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'initial_billing_at={(self.initial_billing_at if hasattr(self, "initial_billing_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _initial_billing_at=( + self.initial_billing_at + if hasattr(self, "initial_billing_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"initial_billing_at={_initial_billing_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/breakouts.py b/advancedbilling/models/breakouts.py index c417d81e..6a37a277 100644 --- a/advancedbilling/models/breakouts.py +++ b/advancedbilling/models/breakouts.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Breakouts(object): - """Implementation of the 'Breakouts' model. Attributes: @@ -18,43 +16,43 @@ class Breakouts(object): plan_amount_formatted (str): The model property of type str. usage_amount_in_cents (int): The model property of type int. usage_amount_formatted (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "plan_amount_in_cents": 'plan_amount_in_cents', - "plan_amount_formatted": 'plan_amount_formatted', - "usage_amount_in_cents": 'usage_amount_in_cents', - "usage_amount_formatted": 'usage_amount_formatted' + "plan_amount_in_cents": "plan_amount_in_cents", + "plan_amount_formatted": "plan_amount_formatted", + "usage_amount_in_cents": "usage_amount_in_cents", + "usage_amount_formatted": "usage_amount_formatted", } _optionals = [ - 'plan_amount_in_cents', - 'plan_amount_formatted', - 'usage_amount_in_cents', - 'usage_amount_formatted', + "plan_amount_in_cents", + "plan_amount_formatted", + "usage_amount_in_cents", + "usage_amount_formatted", ] - def __init__(self, - plan_amount_in_cents=APIHelper.SKIP, - plan_amount_formatted=APIHelper.SKIP, - usage_amount_in_cents=APIHelper.SKIP, - usage_amount_formatted=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Breakouts class""" - + def __init__( + self, + plan_amount_in_cents=APIHelper.SKIP, + plan_amount_formatted=APIHelper.SKIP, + usage_amount_in_cents=APIHelper.SKIP, + usage_amount_formatted=APIHelper.SKIP, + additional_properties=None): + """Initialize a Breakouts instance.""" # Initialize members of the class if plan_amount_in_cents is not APIHelper.SKIP: - self.plan_amount_in_cents = plan_amount_in_cents + self.plan_amount_in_cents = plan_amount_in_cents if plan_amount_formatted is not APIHelper.SKIP: - self.plan_amount_formatted = plan_amount_formatted + self.plan_amount_formatted = plan_amount_formatted if usage_amount_in_cents is not APIHelper.SKIP: - self.usage_amount_in_cents = usage_amount_in_cents + self.usage_amount_in_cents = usage_amount_in_cents if usage_amount_formatted is not APIHelper.SKIP: - self.usage_amount_formatted = usage_amount_formatted + self.usage_amount_formatted = usage_amount_formatted # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - plan_amount_in_cents = dictionary.get("plan_amount_in_cents") if dictionary.get("plan_amount_in_cents") else APIHelper.SKIP - plan_amount_formatted = dictionary.get("plan_amount_formatted") if dictionary.get("plan_amount_formatted") else APIHelper.SKIP - usage_amount_in_cents = dictionary.get("usage_amount_in_cents") if dictionary.get("usage_amount_in_cents") else APIHelper.SKIP - usage_amount_formatted = dictionary.get("usage_amount_formatted") if dictionary.get("usage_amount_formatted") else APIHelper.SKIP + plan_amount_in_cents =\ + dictionary.get("plan_amount_in_cents")\ + if dictionary.get("plan_amount_in_cents")\ + else APIHelper.SKIP + plan_amount_formatted =\ + dictionary.get("plan_amount_formatted")\ + if dictionary.get("plan_amount_formatted")\ + else APIHelper.SKIP + usage_amount_in_cents =\ + dictionary.get("usage_amount_in_cents")\ + if dictionary.get("usage_amount_in_cents")\ + else APIHelper.SKIP + usage_amount_formatted =\ + dictionary.get("usage_amount_formatted")\ + if dictionary.get("usage_amount_formatted")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(plan_amount_in_cents, plan_amount_formatted, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'plan_amount_in_cents={(self.plan_amount_in_cents if hasattr(self, "plan_amount_in_cents") else None)!r}, ' - f'plan_amount_formatted={(self.plan_amount_formatted if hasattr(self, "plan_amount_formatted") else None)!r}, ' - f'usage_amount_in_cents={(self.usage_amount_in_cents if hasattr(self, "usage_amount_in_cents") else None)!r}, ' - f'usage_amount_formatted={(self.usage_amount_formatted if hasattr(self, "usage_amount_formatted") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _plan_amount_in_cents=( + self.plan_amount_in_cents + if hasattr(self, "plan_amount_in_cents") + else None + ) + _plan_amount_formatted=( + self.plan_amount_formatted + if hasattr(self, "plan_amount_formatted") + else None + ) + _usage_amount_in_cents=( + self.usage_amount_in_cents + if hasattr(self, "usage_amount_in_cents") + else None + ) + _usage_amount_formatted=( + self.usage_amount_formatted + if hasattr(self, "usage_amount_formatted") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"plan_amount_in_cents={_plan_amount_in_cents!r}, " + f"plan_amount_formatted={_plan_amount_formatted!r}, " + f"usage_amount_in_cents={_usage_amount_in_cents!r}, " + f"usage_amount_formatted={_usage_amount_formatted!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'plan_amount_in_cents={(self.plan_amount_in_cents if hasattr(self, "plan_amount_in_cents") else None)!s}, ' - f'plan_amount_formatted={(self.plan_amount_formatted if hasattr(self, "plan_amount_formatted") else None)!s}, ' - f'usage_amount_in_cents={(self.usage_amount_in_cents if hasattr(self, "usage_amount_in_cents") else None)!s}, ' - f'usage_amount_formatted={(self.usage_amount_formatted if hasattr(self, "usage_amount_formatted") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _plan_amount_in_cents=( + self.plan_amount_in_cents + if hasattr(self, "plan_amount_in_cents") + else None + ) + _plan_amount_formatted=( + self.plan_amount_formatted + if hasattr(self, "plan_amount_formatted") + else None + ) + _usage_amount_in_cents=( + self.usage_amount_in_cents + if hasattr(self, "usage_amount_in_cents") + else None + ) + _usage_amount_formatted=( + self.usage_amount_formatted + if hasattr(self, "usage_amount_formatted") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"plan_amount_in_cents={_plan_amount_in_cents!s}, " + f"plan_amount_formatted={_plan_amount_formatted!s}, " + f"usage_amount_in_cents={_usage_amount_in_cents!s}, " + f"usage_amount_formatted={_usage_amount_formatted!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bulk_components_price_point_assignment.py b/advancedbilling/models/bulk_components_price_point_assignment.py index 6600d1ab..127f906b 100644 --- a/advancedbilling/models/bulk_components_price_point_assignment.py +++ b/advancedbilling/models/bulk_components_price_point_assignment.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_price_point_assignment import ComponentPricePointAssignment +from advancedbilling.models.component_price_point_assignment import ( + ComponentPricePointAssignment, +) class BulkComponentsPricePointAssignment(object): - """Implementation of the 'Bulk Components Price Point Assignment' model. Attributes: - components (List[ComponentPricePointAssignment]): The model property - of type List[ComponentPricePointAssignment]. - additional_properties (Dict[str, object]): The additional properties - for the model. + components (List[ComponentPricePointAssignment]): The model property of type + List[ComponentPricePointAssignment]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "components": 'components' + "components": "components", } _optionals = [ - 'components', + "components", ] - def __init__(self, - components=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BulkComponentsPricePointAssignment class""" - + def __init__( + self, + components=APIHelper.SKIP, + additional_properties=None): + """Initialize a BulkComponentsPricePointAssignment instance.""" # Initialize members of the class if components is not APIHelper.SKIP: - self.components = components + self.components = components # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,28 +59,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary components = None - if dictionary.get('components') is not None: - components = [ComponentPricePointAssignment.from_dictionary(x) for x in dictionary.get('components')] + if dictionary.get("components") is not None: + components = [ + ComponentPricePointAssignment.from_dictionary(x) + for x in dictionary.get("components") + ] else: components = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(components, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'components={(self.components if hasattr(self, "components") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _components=( + self.components + if hasattr(self, "components") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"components={_components!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'components={(self.components if hasattr(self, "components") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _components=( + self.components + if hasattr(self, "components") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"components={_components!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bulk_create_product_price_points_request.py b/advancedbilling/models/bulk_create_product_price_points_request.py index b47f3bfd..49036de1 100644 --- a/advancedbilling/models/bulk_create_product_price_points_request.py +++ b/advancedbilling/models/bulk_create_product_price_points_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_product_price_point import CreateProductPricePoint +# ruff: noqa: E501 +from advancedbilling.models.create_product_price_point import ( + CreateProductPricePoint, +) -class BulkCreateProductPricePointsRequest(object): +class BulkCreateProductPricePointsRequest(object): """Implementation of the 'Bulk Create Product Price Points Request' model. Attributes: - price_points (List[CreateProductPricePoint]): The model property of - type List[CreateProductPricePoint]. - additional_properties (Dict[str, object]): The additional properties - for the model. + price_points (List[CreateProductPricePoint]): The model property of type + List[CreateProductPricePoint]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_points": 'price_points' + "price_points": "price_points", } - def __init__(self, - price_points=None, - additional_properties=None): - """Constructor for the BulkCreateProductPricePointsRequest class""" - + def __init__( + self, + price_points=None, + additional_properties=None): + """Initialize a BulkCreateProductPricePointsRequest instance.""" # Initialize members of the class - self.price_points = price_points + self.price_points = price_points # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary price_points = None - if dictionary.get('price_points') is not None: - price_points = [CreateProductPricePoint.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + CreateProductPricePoint.from_dictionary(x) + for x in dictionary.get("price_points") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_points, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bulk_create_product_price_points_response.py b/advancedbilling/models/bulk_create_product_price_points_response.py index 5f567c33..f3595899 100644 --- a/advancedbilling/models/bulk_create_product_price_points_response.py +++ b/advancedbilling/models/bulk_create_product_price_points_response.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.product_price_point import ProductPricePoint +from advancedbilling.models.product_price_point import ( + ProductPricePoint, +) class BulkCreateProductPricePointsResponse(object): - """Implementation of the 'Bulk Create Product Price Points Response' model. Attributes: price_points (List[ProductPricePoint]): The model property of type List[ProductPricePoint]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_points": 'price_points' + "price_points": "price_points", } _optionals = [ - 'price_points', + "price_points", ] - def __init__(self, - price_points=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BulkCreateProductPricePointsResponse class""" - + def __init__( + self, + price_points=APIHelper.SKIP, + additional_properties=None): + """Initialize a BulkCreateProductPricePointsResponse instance.""" # Initialize members of the class if price_points is not APIHelper.SKIP: - self.price_points = price_points + self.price_points = price_points # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,28 +59,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary price_points = None - if dictionary.get('price_points') is not None: - price_points = [ProductPricePoint.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ProductPricePoint.from_dictionary(x) + for x in dictionary.get("price_points") + ] else: price_points = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_points, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bulk_create_segments.py b/advancedbilling/models/bulk_create_segments.py index ea1479eb..e5cf535a 100644 --- a/advancedbilling/models/bulk_create_segments.py +++ b/advancedbilling/models/bulk_create_segments.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_segment import CreateSegment +from advancedbilling.models.create_segment import ( + CreateSegment, +) class BulkCreateSegments(object): - """Implementation of the 'Bulk Create Segments' model. Attributes: segments (List[CreateSegment]): The model property of type List[CreateSegment]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segments": 'segments' + "segments": "segments", } _optionals = [ - 'segments', + "segments", ] - def __init__(self, - segments=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BulkCreateSegments class""" - + def __init__( + self, + segments=APIHelper.SKIP, + additional_properties=None): + """Initialize a BulkCreateSegments instance.""" # Initialize members of the class if segments is not APIHelper.SKIP: - self.segments = segments + self.segments = segments # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,28 +59,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary segments = None - if dictionary.get('segments') is not None: - segments = [CreateSegment.from_dictionary(x) for x in dictionary.get('segments')] + if dictionary.get("segments") is not None: + segments = [ + CreateSegment.from_dictionary(x) + for x in dictionary.get("segments") + ] else: segments = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segments, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segments={(self.segments if hasattr(self, "segments") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segments=( + self.segments + if hasattr(self, "segments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segments={(self.segments if hasattr(self, "segments") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segments=( + self.segments + if hasattr(self, "segments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bulk_update_segments.py b/advancedbilling/models/bulk_update_segments.py index 565040d8..eaf7c30d 100644 --- a/advancedbilling/models/bulk_update_segments.py +++ b/advancedbilling/models/bulk_update_segments.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.bulk_update_segments_item import BulkUpdateSegmentsItem +from advancedbilling.models.bulk_update_segments_item import ( + BulkUpdateSegmentsItem, +) class BulkUpdateSegments(object): - """Implementation of the 'Bulk Update Segments' model. Attributes: segments (List[BulkUpdateSegmentsItem]): The model property of type List[BulkUpdateSegmentsItem]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segments": 'segments' + "segments": "segments", } _optionals = [ - 'segments', + "segments", ] - def __init__(self, - segments=APIHelper.SKIP, - additional_properties=None): - """Constructor for the BulkUpdateSegments class""" - + def __init__( + self, + segments=APIHelper.SKIP, + additional_properties=None): + """Initialize a BulkUpdateSegments instance.""" # Initialize members of the class if segments is not APIHelper.SKIP: - self.segments = segments + self.segments = segments # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,28 +59,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary segments = None - if dictionary.get('segments') is not None: - segments = [BulkUpdateSegmentsItem.from_dictionary(x) for x in dictionary.get('segments')] + if dictionary.get("segments") is not None: + segments = [ + BulkUpdateSegmentsItem.from_dictionary(x) + for x in dictionary.get("segments") + ] else: segments = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segments, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segments={(self.segments if hasattr(self, "segments") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segments=( + self.segments + if hasattr(self, "segments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segments={(self.segments if hasattr(self, "segments") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segments=( + self.segments + if hasattr(self, "segments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/bulk_update_segments_item.py b/advancedbilling/models/bulk_update_segments_item.py index 0f1210b2..21b3a1e0 100644 --- a/advancedbilling/models/bulk_update_segments_item.py +++ b/advancedbilling/models/bulk_update_segments_item.py @@ -1,49 +1,49 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +# ruff: noqa: E501 +from advancedbilling.models.create_or_update_segment_price import ( + CreateOrUpdateSegmentPrice, +) -class BulkUpdateSegmentsItem(object): +class BulkUpdateSegmentsItem(object): """Implementation of the 'Bulk Update Segments Item' model. Attributes: id (int): The ID of the segment you want to update. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. prices (List[CreateOrUpdateSegmentPrice]): The model property of type List[CreateOrUpdateSegmentPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "pricing_scheme": 'pricing_scheme', - "prices": 'prices' + "id": "id", + "pricing_scheme": "pricing_scheme", + "prices": "prices", } - def __init__(self, - id=None, - pricing_scheme=None, - prices=None, - additional_properties=None): - """Constructor for the BulkUpdateSegmentsItem class""" - + def __init__( + self, + id=None, + pricing_scheme=None, + prices=None, + additional_properties=None): + """Initialize a BulkUpdateSegmentsItem instance.""" # Initialize members of the class - self.id = id - self.pricing_scheme = pricing_scheme - self.prices = prices + self.id = id + self.pricing_scheme = pricing_scheme + self.prices = prices # Add additional model properties to the instance if additional_properties is None: @@ -53,7 +53,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -64,18 +64,29 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None prices = None - if dictionary.get('prices') is not None: - prices = [CreateOrUpdateSegmentPrice.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + CreateOrUpdateSegmentPrice.from_dictionary(x) + for x in dictionary.get("prices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, pricing_scheme, @@ -83,15 +94,31 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={self.prices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={self.prices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/calendar_billing.py b/advancedbilling/models/calendar_billing.py index 4a0f08e9..c8faf3bb 100644 --- a/advancedbilling/models/calendar_billing.py +++ b/advancedbilling/models/calendar_billing.py @@ -1,56 +1,54 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CalendarBilling(object): - """Implementation of the 'Calendar Billing' model. (Optional). Cannot be used when also specifying next_billing_at Attributes: - snap_day (int | SnapDay | None): A day of month that subscription will - be processed on. Can be 1 up to 28 or 'end'. - calendar_billing_first_charge (FirstChargeType): The model property of - type FirstChargeType. - additional_properties (Dict[str, object]): The additional properties - for the model. + snap_day (int | SnapDay | None): A day of month that subscription will be + processed on. Can be 1 up to 28 or 'end'. + calendar_billing_first_charge (FirstChargeType): The model property of type + FirstChargeType. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "snap_day": 'snap_day', - "calendar_billing_first_charge": 'calendar_billing_first_charge' + "snap_day": "snap_day", + "calendar_billing_first_charge": "calendar_billing_first_charge", } _optionals = [ - 'snap_day', - 'calendar_billing_first_charge', + "snap_day", + "calendar_billing_first_charge", ] _nullables = [ - 'snap_day', + "snap_day", ] - def __init__(self, - snap_day=APIHelper.SKIP, - calendar_billing_first_charge=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CalendarBilling class""" - + def __init__( + self, + snap_day=APIHelper.SKIP, + calendar_billing_first_charge=APIHelper.SKIP, + additional_properties=None): + """Initialize a CalendarBilling instance.""" # Initialize members of the class if snap_day is not APIHelper.SKIP: - self.snap_day = snap_day + self.snap_day = snap_day if calendar_billing_first_charge is not APIHelper.SKIP: - self.calendar_billing_first_charge = calendar_billing_first_charge + self.calendar_billing_first_charge = calendar_billing_first_charge # Add additional model properties to the instance if additional_properties is None: @@ -60,7 +58,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -71,19 +69,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - if 'snap_day' in dictionary.keys(): - snap_day = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CalendarBillingSnapDay'), dictionary.get('snap_day'), False) if dictionary.get('snap_day') is not None else None + if "snap_day" in dictionary.keys(): + snap_day = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CalendarBillingSnapDay"), + dictionary.get("snap_day"), + False)\ + if dictionary.get("snap_day") is not None\ + else None else: snap_day = APIHelper.SKIP - calendar_billing_first_charge = dictionary.get("calendar_billing_first_charge") if dictionary.get("calendar_billing_first_charge") else APIHelper.SKIP + calendar_billing_first_charge =\ + dictionary.get("calendar_billing_first_charge")\ + if dictionary.get("calendar_billing_first_charge")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(snap_day, calendar_billing_first_charge, @@ -91,7 +102,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -102,7 +113,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -112,13 +122,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'snap_day={(self.snap_day if hasattr(self, "snap_day") else None)!r}, ' - f'calendar_billing_first_charge={(self.calendar_billing_first_charge if hasattr(self, "calendar_billing_first_charge") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _snap_day=( + self.snap_day + if hasattr(self, "snap_day") + else None + ) + _calendar_billing_first_charge=( + self.calendar_billing_first_charge + if hasattr(self, "calendar_billing_first_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"snap_day={_snap_day!r}, " + f"calendar_billing_first_charge={_calendar_billing_first_charge!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'snap_day={(self.snap_day if hasattr(self, "snap_day") else None)!s}, ' - f'calendar_billing_first_charge={(self.calendar_billing_first_charge if hasattr(self, "calendar_billing_first_charge") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _snap_day=( + self.snap_day + if hasattr(self, "snap_day") + else None + ) + _calendar_billing_first_charge=( + self.calendar_billing_first_charge + if hasattr(self, "calendar_billing_first_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"snap_day={_snap_day!s}, " + f"calendar_billing_first_charge={_calendar_billing_first_charge!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/cancel_grouped_subscriptions_request.py b/advancedbilling/models/cancel_grouped_subscriptions_request.py index 55b292f0..14a59693 100644 --- a/advancedbilling/models/cancel_grouped_subscriptions_request.py +++ b/advancedbilling/models/cancel_grouped_subscriptions_request.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CancelGroupedSubscriptionsRequest(object): - """Implementation of the 'Cancel Grouped Subscriptions Request' model. Attributes: charge_unbilled_usage (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "charge_unbilled_usage": 'charge_unbilled_usage' + "charge_unbilled_usage": "charge_unbilled_usage", } _optionals = [ - 'charge_unbilled_usage', + "charge_unbilled_usage", ] - def __init__(self, - charge_unbilled_usage=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CancelGroupedSubscriptionsRequest class""" - + def __init__( + self, + charge_unbilled_usage=APIHelper.SKIP, + additional_properties=None): + """Initialize a CancelGroupedSubscriptionsRequest instance.""" # Initialize members of the class if charge_unbilled_usage is not APIHelper.SKIP: - self.charge_unbilled_usage = charge_unbilled_usage + self.charge_unbilled_usage = charge_unbilled_usage # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - charge_unbilled_usage = dictionary.get("charge_unbilled_usage") if "charge_unbilled_usage" in dictionary.keys() else APIHelper.SKIP + charge_unbilled_usage =\ + dictionary.get("charge_unbilled_usage")\ + if "charge_unbilled_usage" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(charge_unbilled_usage, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'charge_unbilled_usage={(self.charge_unbilled_usage if hasattr(self, "charge_unbilled_usage") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _charge_unbilled_usage=( + self.charge_unbilled_usage + if hasattr(self, "charge_unbilled_usage") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"charge_unbilled_usage={_charge_unbilled_usage!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'charge_unbilled_usage={(self.charge_unbilled_usage if hasattr(self, "charge_unbilled_usage") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _charge_unbilled_usage=( + self.charge_unbilled_usage + if hasattr(self, "charge_unbilled_usage") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"charge_unbilled_usage={_charge_unbilled_usage!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/cancellation_method.py b/advancedbilling/models/cancellation_method.py index d62fb89a..b677c198 100644 --- a/advancedbilling/models/cancellation_method.py +++ b/advancedbilling/models/cancellation_method.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CancellationMethod(object): - """Implementation of the 'Cancellation Method' enum. The process used to cancel the subscription, if the subscription has been @@ -22,26 +19,28 @@ class CancellationMethod(object): BILLING_PORTAL: The enum member of type str. UNKNOWN: The enum member of type str. IMPORTED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['merchant_ui', 'merchant_api', 'dunning', 'billing_portal', 'unknown', 'imported'] - MERCHANT_UI = 'merchant_ui' - MERCHANT_API = 'merchant_api' + _all_values = ["merchant_ui", "merchant_api", "dunning", "billing_portal", + "unknown", "imported"] + MERCHANT_UI = "merchant_ui" - DUNNING = 'dunning' + MERCHANT_API = "merchant_api" - BILLING_PORTAL = 'billing_portal' + DUNNING = "dunning" - UNKNOWN = 'unknown' + BILLING_PORTAL = "billing_portal" - IMPORTED = 'imported' + UNKNOWN = "unknown" + + IMPORTED = "imported" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -51,9 +50,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/cancellation_options.py b/advancedbilling/models/cancellation_options.py index 8b391ddc..650bd2f6 100644 --- a/advancedbilling/models/cancellation_options.py +++ b/advancedbilling/models/cancellation_options.py @@ -1,50 +1,85 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CancellationOptions(object): - """Implementation of the 'Cancellation Options' model. Attributes: - cancellation_message (str): For your internal use. An indication as to - why the subscription is being canceled. - reason_code (str): The reason code associated with the cancellation. - See the list of reason codes associated with your site. - additional_properties (Dict[str, object]): The additional properties - for the model. + cancellation_message (str): An indication as to why the subscription is being + canceled. For your internal use. + reason_code (str): The reason code associated with the cancellation. Use the + [List Reason Codes]($e/Reason%20Codes/listReasonCodes) endpoint to + retrieve the reason codes associated with your site. + cancel_at_end_of_period (bool): When true, the subscription is cancelled at + the current period end instead of immediately. To use this option, the + Schedule Subscription Cancellation feature must be enabled on your site. + scheduled_cancellation_at (datetime): Schedules the cancellation on the + provided date. This is option is not applicable for prepaid + subscriptions. To use this option, the Schedule Subscription Cancellation + feature must be enabled on your site. + refund_prepayment_account_balance (bool): Applies to prepaid subscriptions. + When true, which is the default, the remaining prepaid balance is + refunded as part of cancellation processing. When false, prepaid balance + is not refunded as part of cancellation processing. To use this option, + the Schedule Subscription Cancellation feature must be enabled on your + site. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "cancellation_message": 'cancellation_message', - "reason_code": 'reason_code' + "cancellation_message": "cancellation_message", + "reason_code": "reason_code", + "cancel_at_end_of_period": "cancel_at_end_of_period", + "scheduled_cancellation_at": "scheduled_cancellation_at", + "refund_prepayment_account_balance": "refund_prepayment_account_balance", } _optionals = [ - 'cancellation_message', - 'reason_code', + "cancellation_message", + "reason_code", + "cancel_at_end_of_period", + "scheduled_cancellation_at", + "refund_prepayment_account_balance", ] - def __init__(self, - cancellation_message=APIHelper.SKIP, - reason_code=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CancellationOptions class""" + _nullables = [ + "scheduled_cancellation_at", + ] + def __init__( + self, + cancellation_message=APIHelper.SKIP, + reason_code=APIHelper.SKIP, + cancel_at_end_of_period=APIHelper.SKIP, + scheduled_cancellation_at=APIHelper.SKIP, + refund_prepayment_account_balance=APIHelper.SKIP, + additional_properties=None): + """Initialize a CancellationOptions instance.""" # Initialize members of the class if cancellation_message is not APIHelper.SKIP: - self.cancellation_message = cancellation_message + self.cancellation_message = cancellation_message if reason_code is not APIHelper.SKIP: - self.reason_code = reason_code + self.reason_code = reason_code + if cancel_at_end_of_period is not APIHelper.SKIP: + self.cancel_at_end_of_period = cancel_at_end_of_period + if scheduled_cancellation_at is not APIHelper.SKIP: + self.scheduled_cancellation_at =\ + APIHelper.apply_datetime_converter( + scheduled_cancellation_at, APIHelper.RFC3339DateTime)\ + if scheduled_cancellation_at else None + if refund_prepayment_account_balance is not APIHelper.SKIP: + self.refund_prepayment_account_balance =\ + refund_prepayment_account_balance # Add additional model properties to the instance if additional_properties is None: @@ -54,7 +89,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -65,28 +100,120 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - cancellation_message = dictionary.get("cancellation_message") if dictionary.get("cancellation_message") else APIHelper.SKIP - reason_code = dictionary.get("reason_code") if dictionary.get("reason_code") else APIHelper.SKIP + cancellation_message =\ + dictionary.get("cancellation_message")\ + if dictionary.get("cancellation_message")\ + else APIHelper.SKIP + reason_code =\ + dictionary.get("reason_code")\ + if dictionary.get("reason_code")\ + else APIHelper.SKIP + cancel_at_end_of_period =\ + dictionary.get("cancel_at_end_of_period")\ + if "cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP + if "scheduled_cancellation_at" in dictionary.keys(): + scheduled_cancellation_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("scheduled_cancellation_at")).datetime\ + if dictionary.get("scheduled_cancellation_at") else None + + else: + scheduled_cancellation_at = APIHelper.SKIP + refund_prepayment_account_balance =\ + dictionary.get("refund_prepayment_account_balance")\ + if "refund_prepayment_account_balance" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(cancellation_message, reason_code, + cancel_at_end_of_period, + scheduled_cancellation_at, + refund_prepayment_account_balance, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!r}, ' - f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _reason_code=( + self.reason_code + if hasattr(self, "reason_code") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _scheduled_cancellation_at=( + self.scheduled_cancellation_at + if hasattr(self, "scheduled_cancellation_at") + else None + ) + _refund_prepayment_account_balance=( + self.refund_prepayment_account_balance + if hasattr(self, "refund_prepayment_account_balance") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"cancellation_message={_cancellation_message!r}, " + f"reason_code={_reason_code!r}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!r}, " + f"scheduled_cancellation_at={_scheduled_cancellation_at!r}, " + f"refund_prepayment_account_balance={_refund_prepayment_account_balance!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!s}, ' - f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _reason_code=( + self.reason_code + if hasattr(self, "reason_code") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _scheduled_cancellation_at=( + self.scheduled_cancellation_at + if hasattr(self, "scheduled_cancellation_at") + else None + ) + _refund_prepayment_account_balance=( + self.refund_prepayment_account_balance + if hasattr(self, "refund_prepayment_account_balance") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"cancellation_message={_cancellation_message!s}, " + f"reason_code={_reason_code!s}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!s}, " + f"scheduled_cancellation_at={_scheduled_cancellation_at!s}, " + f"refund_prepayment_account_balance={_refund_prepayment_account_balance!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/cancellation_request.py b/advancedbilling/models/cancellation_request.py index 15c21897..27820d53 100644 --- a/advancedbilling/models/cancellation_request.py +++ b/advancedbilling/models/cancellation_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.cancellation_options import CancellationOptions +# ruff: noqa: E501 +from advancedbilling.models.cancellation_options import ( + CancellationOptions, +) -class CancellationRequest(object): +class CancellationRequest(object): """Implementation of the 'Cancellation Request' model. Attributes: subscription (CancellationOptions): The model property of type CancellationOptions. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription": 'subscription' + "subscription": "subscription", } - def __init__(self, - subscription=None, - additional_properties=None): - """Constructor for the CancellationRequest class""" - + def __init__( + self, + subscription=None, + additional_properties=None): + """Initialize a CancellationRequest instance.""" # Initialize members of the class - self.subscription = subscription + self.subscription = subscription # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription = CancellationOptions.from_dictionary(dictionary.get('subscription')) if dictionary.get('subscription') else None + subscription =\ + CancellationOptions.from_dictionary( + dictionary.get("subscription"))\ + if dictionary.get("subscription") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/card_type.py b/advancedbilling/models/card_type.py index 569fa2cd..9f9d10dd 100644 --- a/advancedbilling/models/card_type.py +++ b/advancedbilling/models/card_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CardType(object): - """Implementation of the 'Card Type' enum. The type of card used. @@ -51,86 +48,92 @@ class CardType(object): SWITCH: The enum member of type str. SOLO: The enum member of type str. LASER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['visa', 'master', 'elo', 'cabal', 'alelo', 'discover', 'american_express', 'naranja', 'diners_club', 'jcb', 'dankort', 'maestro', 'maestro_no_luhn', 'forbrugsforeningen', 'sodexo', 'alia', 'vr', 'unionpay', 'carnet', 'cartes_bancaires', 'olimpica', 'creditel', 'confiable', 'synchrony', 'routex', 'mada', 'bp_plus', 'passcard', 'edenred', 'anda', 'tarjeta-d', 'hipercard', 'bogus', 'switch', 'solo', 'laser'] - VISA = 'visa' - MASTER = 'master' + _all_values = ["visa", "master", "elo", "cabal", "alelo", "discover", + "american_express", "naranja", "diners_club", "jcb", "dankort", "maestro", + "maestro_no_luhn", "forbrugsforeningen", "sodexo", "alia", "vr", "unionpay", + "carnet", "cartes_bancaires", "olimpica", "creditel", "confiable", + "synchrony", "routex", "mada", "bp_plus", "passcard", "edenred", "anda", + "tarjeta-d", "hipercard", "bogus", "switch", "solo", "laser"] + VISA = "visa" - ELO = 'elo' + MASTER = "master" - CABAL = 'cabal' + ELO = "elo" - ALELO = 'alelo' + CABAL = "cabal" - DISCOVER = 'discover' + ALELO = "alelo" - AMERICAN_EXPRESS = 'american_express' + DISCOVER = "discover" - NARANJA = 'naranja' + AMERICAN_EXPRESS = "american_express" - DINERS_CLUB = 'diners_club' + NARANJA = "naranja" - JCB = 'jcb' + DINERS_CLUB = "diners_club" - DANKORT = 'dankort' + JCB = "jcb" - MAESTRO = 'maestro' + DANKORT = "dankort" - MAESTRO_NO_LUHN = 'maestro_no_luhn' + MAESTRO = "maestro" - FORBRUGSFORENINGEN = 'forbrugsforeningen' + MAESTRO_NO_LUHN = "maestro_no_luhn" - SODEXO = 'sodexo' + FORBRUGSFORENINGEN = "forbrugsforeningen" - ALIA = 'alia' + SODEXO = "sodexo" - VR = 'vr' + ALIA = "alia" - UNIONPAY = 'unionpay' + VR = "vr" - CARNET = 'carnet' + UNIONPAY = "unionpay" - CARTES_BANCAIRES = 'cartes_bancaires' + CARNET = "carnet" - OLIMPICA = 'olimpica' + CARTES_BANCAIRES = "cartes_bancaires" - CREDITEL = 'creditel' + OLIMPICA = "olimpica" - CONFIABLE = 'confiable' + CREDITEL = "creditel" - SYNCHRONY = 'synchrony' + CONFIABLE = "confiable" - ROUTEX = 'routex' + SYNCHRONY = "synchrony" - MADA = 'mada' + ROUTEX = "routex" - BP_PLUS = 'bp_plus' + MADA = "mada" - PASSCARD = 'passcard' + BP_PLUS = "bp_plus" - EDENRED = 'edenred' + PASSCARD = "passcard" - ANDA = 'anda' + EDENRED = "edenred" - TARJETAD = 'tarjeta-d' + ANDA = "anda" - HIPERCARD = 'hipercard' + TARJETAD = "tarjeta-d" - BOGUS = 'bogus' + HIPERCARD = "hipercard" - SWITCH = 'switch' + BOGUS = "bogus" - SOLO = 'solo' + SWITCH = "switch" - LASER = 'laser' + SOLO = "solo" + + LASER = "laser" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -140,9 +143,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/change_chargeback_status_event.py b/advancedbilling/models/change_chargeback_status_event.py index b46a63b9..691f539e 100644 --- a/advancedbilling/models/change_chargeback_status_event.py +++ b/advancedbilling/models/change_chargeback_status_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.change_chargeback_status_event_data import ChangeChargebackStatusEventData +from advancedbilling.models.change_chargeback_status_event_data import ( + ChangeChargebackStatusEventData, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class ChangeChargebackStatusEvent(object): - """Implementation of the 'Change Chargeback Status Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. + event_type (InvoiceEventType): The model property of type InvoiceEventType. event_data (ChangeChargebackStatusEventData): Example schema for an `change_chargeback_status` event - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='change_chargeback_status', - event_data=None, - additional_properties=None): - """Constructor for the ChangeChargebackStatusEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="change_chargeback_status", + event_data=None, + additional_properties=None): + """Initialize a ChangeChargebackStatusEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'change_chargeback_status' - event_data = ChangeChargebackStatusEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "change_chargeback_status" + event_data =\ + ChangeChargebackStatusEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: ChangeChargebackStatusEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + ChangeChargebackStatusEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: ChangeChargebackStatusEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + ChangeChargebackStatusEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/change_chargeback_status_event_data.py b/advancedbilling/models/change_chargeback_status_event_data.py index 53ff99ac..3a10dbae 100644 --- a/advancedbilling/models/change_chargeback_status_event_data.py +++ b/advancedbilling/models/change_chargeback_status_event_data.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.chargeback_status import ChargebackStatus +from advancedbilling.models.chargeback_status import ( + ChargebackStatus, +) class ChangeChargebackStatusEventData(object): - """Implementation of the 'Change Chargeback Status Event Data' model. Example schema for an `change_chargeback_status` event @@ -19,23 +19,23 @@ class ChangeChargebackStatusEventData(object): Attributes: chargeback_status (ChargebackStatus): The model property of type ChargebackStatus. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargeback_status": 'chargeback_status' + "chargeback_status": "chargeback_status", } - def __init__(self, - chargeback_status=None, - additional_properties=None): - """Constructor for the ChangeChargebackStatusEventData class""" - + def __init__( + self, + chargeback_status=None, + additional_properties=None): + """Initialize a ChangeChargebackStatusEventData instance.""" # Initialize members of the class - self.chargeback_status = chargeback_status + self.chargeback_status = chargeback_status # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,21 +56,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargeback_status = dictionary.get("chargeback_status") if dictionary.get("chargeback_status") else None + chargeback_status =\ + dictionary.get("chargeback_status")\ + if dictionary.get("chargeback_status")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargeback_status, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -81,23 +86,38 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.chargeback_status, - type_callable=lambda value: ChargebackStatus.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.chargeback_status, + type_callable=lambda value: + ChargebackStatus.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('chargeback_status'), - type_callable=lambda value: ChargebackStatus.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("chargeback_status"), + type_callable=lambda value: + ChargebackStatus.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargeback_status={self.chargeback_status!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargeback_status=self.chargeback_status + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargeback_status={_chargeback_status!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargeback_status={self.chargeback_status!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargeback_status=self.chargeback_status + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargeback_status={_chargeback_status!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/change_invoice_collection_method_event.py b/advancedbilling/models/change_invoice_collection_method_event.py index 6bc4c6ae..eeeea460 100644 --- a/advancedbilling/models/change_invoice_collection_method_event.py +++ b/advancedbilling/models/change_invoice_collection_method_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.change_invoice_collection_method_event_data import ChangeInvoiceCollectionMethodEventData +from advancedbilling.models.change_invoice_collection_method_event_data import ( + ChangeInvoiceCollectionMethodEventData, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class ChangeInvoiceCollectionMethodEvent(object): - """Implementation of the 'Change Invoice Collection Method Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (ChangeInvoiceCollectionMethodEventData): Example schema - for an `change_invoice_collection_method` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (ChangeInvoiceCollectionMethodEventData): Example schema for an + `change_invoice_collection_method` event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='change_invoice_collection_method', - event_data=None, - additional_properties=None): - """Constructor for the ChangeInvoiceCollectionMethodEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="change_invoice_collection_method", + event_data=None, + additional_properties=None): + """Initialize a ChangeInvoiceCollectionMethodEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'change_invoice_collection_method' - event_data = ChangeInvoiceCollectionMethodEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "change_invoice_collection_method" + event_data =\ + ChangeInvoiceCollectionMethodEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: ChangeInvoiceCollectionMethodEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + ChangeInvoiceCollectionMethodEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: ChangeInvoiceCollectionMethodEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + ChangeInvoiceCollectionMethodEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/change_invoice_collection_method_event_data.py b/advancedbilling/models/change_invoice_collection_method_event_data.py index fcf90f68..652424f8 100644 --- a/advancedbilling/models/change_invoice_collection_method_event_data.py +++ b/advancedbilling/models/change_invoice_collection_method_event_data.py @@ -1,44 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ChangeInvoiceCollectionMethodEventData(object): - """Implementation of the 'Change Invoice Collection Method Event Data' model. Example schema for an `change_invoice_collection_method` event Attributes: - from_collection_method (str): The previous collection method of the - invoice. + from_collection_method (str): The previous collection method of the invoice. to_collection_method (str): The new collection method of the invoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "from_collection_method": 'from_collection_method', - "to_collection_method": 'to_collection_method' + "from_collection_method": "from_collection_method", + "to_collection_method": "to_collection_method", } - def __init__(self, - from_collection_method=None, - to_collection_method=None, - additional_properties=None): - """Constructor for the ChangeInvoiceCollectionMethodEventData class""" - + def __init__( + self, + from_collection_method=None, + to_collection_method=None, + additional_properties=None): + """Initialize a ChangeInvoiceCollectionMethodEventData instance.""" # Initialize members of the class - self.from_collection_method = from_collection_method - self.to_collection_method = to_collection_method + self.from_collection_method = from_collection_method + self.to_collection_method = to_collection_method # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,15 +56,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - from_collection_method = dictionary.get("from_collection_method") if dictionary.get("from_collection_method") else None - to_collection_method = dictionary.get("to_collection_method") if dictionary.get("to_collection_method") else None + from_collection_method =\ + dictionary.get("from_collection_method")\ + if dictionary.get("from_collection_method")\ + else None + to_collection_method =\ + dictionary.get("to_collection_method")\ + if dictionary.get("to_collection_method")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(from_collection_method, to_collection_method, @@ -75,7 +80,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -86,29 +91,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.from_collection_method, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.to_collection_method, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.from_collection_method, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.to_collection_method, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('from_collection_method'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('to_collection_method'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("from_collection_method"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("to_collection_method"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'from_collection_method={self.from_collection_method!r}, ' - f'to_collection_method={self.to_collection_method!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _from_collection_method=self.from_collection_method + _to_collection_method=self.to_collection_method + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"from_collection_method={_from_collection_method!r}, " + f"to_collection_method={_to_collection_method!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'from_collection_method={self.from_collection_method!s}, ' - f'to_collection_method={self.to_collection_method!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _from_collection_method=self.from_collection_method + _to_collection_method=self.to_collection_method + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"from_collection_method={_from_collection_method!s}, " + f"to_collection_method={_to_collection_method!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/change_invoice_status_event.py b/advancedbilling/models/change_invoice_status_event.py index ea4d22a7..c1e10bdc 100644 --- a/advancedbilling/models/change_invoice_status_event.py +++ b/advancedbilling/models/change_invoice_status_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.change_invoice_status_event_data import ChangeInvoiceStatusEventData +from advancedbilling.models.change_invoice_status_event_data import ( + ChangeInvoiceStatusEventData, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class ChangeInvoiceStatusEvent(object): - """Implementation of the 'Change Invoice Status Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. + event_type (InvoiceEventType): The model property of type InvoiceEventType. event_data (ChangeInvoiceStatusEventData): Example schema for an `change_invoice_status` event - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='change_invoice_status', - event_data=None, - additional_properties=None): - """Constructor for the ChangeInvoiceStatusEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="change_invoice_status", + event_data=None, + additional_properties=None): + """Initialize a ChangeInvoiceStatusEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'change_invoice_status' - event_data = ChangeInvoiceStatusEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "change_invoice_status" + event_data =\ + ChangeInvoiceStatusEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: ChangeInvoiceStatusEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + ChangeInvoiceStatusEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: ChangeInvoiceStatusEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + ChangeInvoiceStatusEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/change_invoice_status_event_data.py b/advancedbilling/models/change_invoice_status_event_data.py index b405103d..57c4c526 100644 --- a/advancedbilling/models/change_invoice_status_event_data.py +++ b/advancedbilling/models/change_invoice_status_event_data.py @@ -1,74 +1,74 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_status import InvoiceStatus +from advancedbilling.models.invoice_status import ( + InvoiceStatus, +) class ChangeInvoiceStatusEventData(object): - """Implementation of the 'Change Invoice Status Event Data' model. Example schema for an `change_invoice_status` event Attributes: - gateway_trans_id (str): Identifier for the transaction within the - payment gateway. + gateway_trans_id (str): Identifier for the transaction within the payment + gateway. amount (str): The monetary value associated with the linked payment, expressed in dollars. - from_status (InvoiceStatus): The status of the invoice before any - changes occurred. See [Invoice - Statuses](https://maxio.zendesk.com/hc/en-us/articles/2425228782964 - 5-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. - to_status (InvoiceStatus): The updated status of the invoice after - changes have been made. See [Invoice - Statuses](https://maxio.zendesk.com/hc/en-us/articles/2425228782964 - 5-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. - consolidation_level (InvoiceConsolidationLevel): The model property of - type InvoiceConsolidationLevel. - additional_properties (Dict[str, object]): The additional properties - for the model. + from_status (InvoiceStatus): The status of the invoice before any changes + occurred. See [Invoice + Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advan + ced-Billing-Invoices-Overview#invoice-statuses) for more. + to_status (InvoiceStatus): The updated status of the invoice after changes + have been made. See [Invoice + Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advan + ced-Billing-Invoices-Overview#invoice-statuses) for more. + consolidation_level (InvoiceConsolidationLevel): The model property of type + InvoiceConsolidationLevel. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "from_status": 'from_status', - "to_status": 'to_status', - "gateway_trans_id": 'gateway_trans_id', - "amount": 'amount', - "consolidation_level": 'consolidation_level' + "from_status": "from_status", + "to_status": "to_status", + "gateway_trans_id": "gateway_trans_id", + "amount": "amount", + "consolidation_level": "consolidation_level", } _optionals = [ - 'gateway_trans_id', - 'amount', - 'consolidation_level', + "gateway_trans_id", + "amount", + "consolidation_level", ] - def __init__(self, - from_status=None, - to_status=None, - gateway_trans_id=APIHelper.SKIP, - amount=APIHelper.SKIP, - consolidation_level=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ChangeInvoiceStatusEventData class""" - + def __init__( + self, + from_status=None, + to_status=None, + gateway_trans_id=APIHelper.SKIP, + amount=APIHelper.SKIP, + consolidation_level=APIHelper.SKIP, + additional_properties=None): + """Initialize a ChangeInvoiceStatusEventData instance.""" # Initialize members of the class if gateway_trans_id is not APIHelper.SKIP: - self.gateway_trans_id = gateway_trans_id + self.gateway_trans_id = gateway_trans_id if amount is not APIHelper.SKIP: - self.amount = amount - self.from_status = from_status - self.to_status = to_status + self.amount = amount + self.from_status = from_status + self.to_status = to_status if consolidation_level is not APIHelper.SKIP: - self.consolidation_level = consolidation_level + self.consolidation_level = consolidation_level # Add additional model properties to the instance if additional_properties is None: @@ -78,7 +78,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -89,18 +89,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - from_status = dictionary.get("from_status") if dictionary.get("from_status") else None - to_status = dictionary.get("to_status") if dictionary.get("to_status") else None - gateway_trans_id = dictionary.get("gateway_trans_id") if dictionary.get("gateway_trans_id") else APIHelper.SKIP - amount = dictionary.get("amount") if dictionary.get("amount") else APIHelper.SKIP - consolidation_level = dictionary.get("consolidation_level") if dictionary.get("consolidation_level") else APIHelper.SKIP + from_status =\ + dictionary.get("from_status")\ + if dictionary.get("from_status")\ + else None + to_status =\ + dictionary.get("to_status")\ + if dictionary.get("to_status")\ + else None + gateway_trans_id =\ + dictionary.get("gateway_trans_id")\ + if dictionary.get("gateway_trans_id")\ + else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else APIHelper.SKIP + consolidation_level =\ + dictionary.get("consolidation_level")\ + if dictionary.get("consolidation_level")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(from_status, to_status, @@ -111,7 +128,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -122,35 +139,86 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.from_status, - type_callable=lambda value: InvoiceStatus.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.to_status, - type_callable=lambda value: InvoiceStatus.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.from_status, + type_callable=lambda value: + InvoiceStatus.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.to_status, + type_callable=lambda value: + InvoiceStatus.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('from_status'), - type_callable=lambda value: InvoiceStatus.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('to_status'), - type_callable=lambda value: InvoiceStatus.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("from_status"), + type_callable=lambda value: + InvoiceStatus.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("to_status"), + type_callable=lambda value: + InvoiceStatus.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'gateway_trans_id={(self.gateway_trans_id if hasattr(self, "gateway_trans_id") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'from_status={self.from_status!r}, ' - f'to_status={self.to_status!r}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _gateway_trans_id=( + self.gateway_trans_id + if hasattr(self, "gateway_trans_id") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _from_status=self.from_status + _to_status=self.to_status + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"gateway_trans_id={_gateway_trans_id!r}, " + f"amount={_amount!r}, " + f"from_status={_from_status!r}, " + f"to_status={_to_status!r}, " + f"consolidation_level={_consolidation_level!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'gateway_trans_id={(self.gateway_trans_id if hasattr(self, "gateway_trans_id") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'from_status={self.from_status!s}, ' - f'to_status={self.to_status!s}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _gateway_trans_id=( + self.gateway_trans_id + if hasattr(self, "gateway_trans_id") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _from_status=self.from_status + _to_status=self.to_status + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"gateway_trans_id={_gateway_trans_id!s}, " + f"amount={_amount!s}, " + f"from_status={_from_status!s}, " + f"to_status={_to_status!s}, " + f"consolidation_level={_consolidation_level!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/chargeback_status.py b/advancedbilling/models/chargeback_status.py index fc7f2cf8..7a8f5566 100644 --- a/advancedbilling/models/chargeback_status.py +++ b/advancedbilling/models/chargeback_status.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ChargebackStatus(object): - """Implementation of the 'Chargeback Status' enum. The current chargeback status. @@ -19,22 +16,23 @@ class ChargebackStatus(object): LOST: The enum member of type str. WON: The enum member of type str. CLOSED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['open', 'lost', 'won', 'closed'] - OPEN = 'open' - LOST = 'lost' + _all_values = ["open", "lost", "won", "closed"] + OPEN = "open" - WON = 'won' + LOST = "lost" - CLOSED = 'closed' + WON = "won" + + CLOSED = "closed" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -44,9 +42,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/chargify_ebb.py b/advancedbilling/models/chargify_ebb.py index 2bc825fe..70fad524 100644 --- a/advancedbilling/models/chargify_ebb.py +++ b/advancedbilling/models/chargify_ebb.py @@ -1,89 +1,91 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ChargifyEBB(object): - """Implementation of the 'Chargify EBB' model. Attributes: - timestamp (datetime): This timestamp determines what billing period - the event will be billed in. If your request payload does not - include it, Chargify will add `chargify.timestamp` to the event - payload and set the value to `now`. + timestamp (datetime): This timestamp determines what billing period the event + will be billed in. If your request payload does not include it, Chargify + will add `chargify.timestamp` to the event payload and set the value to + `now`. id (str): A unique ID set by Chargify. This field is reserved. If - `chargify.id` is present in the request payload, it will be - overwritten. - created_at (datetime): An ISO-8601 timestamp, set by Chargify at the - time each event is recorded. This field is reserved. If - `chargify.created_at` is present in the request payload, it will - be overwritten. - uniqueness_token (str): User-defined string scoped per-stream. - Duplicate events within a stream will be silently ignored. Tokens - expire after 31 days. - subscription_id (int): Id of Maxio Advanced Billing Subscription which - is connected to this event. Provide `subscription_id` if you - configured `chargify.subscription_id` as Subscription Identifier - in your Event Stream. + `chargify.id` is present in the request payload, it will be overwritten. + created_at (datetime): An ISO-8601 timestamp, set by Chargify at the time + each event is recorded. This field is reserved. If `chargify.created_at` + is present in the request payload, it will be overwritten. + uniqueness_token (str): User-defined string scoped per-stream. Duplicate + events within a stream will be silently ignored. Tokens expire after 31 + days. + subscription_id (int): Id of Maxio Advanced Billing Subscription which is + connected to this event. Provide `subscription_id` if you configured + `chargify.subscription_id` as Subscription Identifier in your Event + Stream. subscription_reference (str): Reference of Maxio Advanced Billing Subscription which is connected to this event. Provide `subscription_reference` if you configured - `chargify.subscription_reference` as Subscription Identifier in - your Event Stream. - additional_properties (Dict[str, object]): The additional properties - for the model. + `chargify.subscription_reference` as Subscription Identifier in your + Event Stream. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "timestamp": 'timestamp', - "id": 'id', - "created_at": 'created_at', - "uniqueness_token": 'uniqueness_token', - "subscription_id": 'subscription_id', - "subscription_reference": 'subscription_reference' + "timestamp": "timestamp", + "id": "id", + "created_at": "created_at", + "uniqueness_token": "uniqueness_token", + "subscription_id": "subscription_id", + "subscription_reference": "subscription_reference", } _optionals = [ - 'timestamp', - 'id', - 'created_at', - 'uniqueness_token', - 'subscription_id', - 'subscription_reference', + "timestamp", + "id", + "created_at", + "uniqueness_token", + "subscription_id", + "subscription_reference", ] - def __init__(self, - timestamp=APIHelper.SKIP, - id=APIHelper.SKIP, - created_at=APIHelper.SKIP, - uniqueness_token=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - subscription_reference=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ChargifyEBB class""" - + def __init__( + self, + timestamp=APIHelper.SKIP, + id=APIHelper.SKIP, + created_at=APIHelper.SKIP, + uniqueness_token=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + subscription_reference=APIHelper.SKIP, + additional_properties=None): + """Initialize a ChargifyEBB instance.""" # Initialize members of the class if timestamp is not APIHelper.SKIP: - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None if id is not APIHelper.SKIP: - self.id = id + self.id = id if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if uniqueness_token is not APIHelper.SKIP: - self.uniqueness_token = uniqueness_token + self.uniqueness_token = uniqueness_token if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if subscription_reference is not APIHelper.SKIP: - self.subscription_reference = subscription_reference + self.subscription_reference = subscription_reference # Add additional model properties to the instance if additional_properties is None: @@ -93,7 +95,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -104,19 +106,37 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else APIHelper.SKIP - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - uniqueness_token = dictionary.get("uniqueness_token") if dictionary.get("uniqueness_token") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - subscription_reference = dictionary.get("subscription_reference") if dictionary.get("subscription_reference") else APIHelper.SKIP + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + uniqueness_token =\ + dictionary.get("uniqueness_token")\ + if dictionary.get("uniqueness_token")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + subscription_reference =\ + dictionary.get("subscription_reference")\ + if dictionary.get("subscription_reference")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(timestamp, id, @@ -127,21 +147,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!r}, ' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'uniqueness_token={(self.uniqueness_token if hasattr(self, "uniqueness_token") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'subscription_reference={(self.subscription_reference if hasattr(self, "subscription_reference") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _uniqueness_token=( + self.uniqueness_token + if hasattr(self, "uniqueness_token") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _subscription_reference=( + self.subscription_reference + if hasattr(self, "subscription_reference") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"timestamp={_timestamp!r}, " + f"id={_id!r}, " + f"created_at={_created_at!r}, " + f"uniqueness_token={_uniqueness_token!r}, " + f"subscription_id={_subscription_id!r}, " + f"subscription_reference={_subscription_reference!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!s}, ' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'uniqueness_token={(self.uniqueness_token if hasattr(self, "uniqueness_token") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'subscription_reference={(self.subscription_reference if hasattr(self, "subscription_reference") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _uniqueness_token=( + self.uniqueness_token + if hasattr(self, "uniqueness_token") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _subscription_reference=( + self.subscription_reference + if hasattr(self, "subscription_reference") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"timestamp={_timestamp!s}, " + f"id={_id!s}, " + f"created_at={_created_at!s}, " + f"uniqueness_token={_uniqueness_token!s}, " + f"subscription_id={_subscription_id!s}, " + f"subscription_reference={_subscription_reference!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/cleanup_scope.py b/advancedbilling/models/cleanup_scope.py index 06f62050..0c5e7231 100644 --- a/advancedbilling/models/cleanup_scope.py +++ b/advancedbilling/models/cleanup_scope.py @@ -1,35 +1,33 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CleanupScope(object): - """Implementation of the 'Cleanup scope' enum. - all: Will clear all products, customers, and related subscriptions from - the site. customers: Will clear only customers and related subscriptions - (leaving the products untouched) for the site. Revenue will also be reset - to 0. + all: Will clear all products, customers, and related subscriptions from the site. + customers: Will clear only customers and related subscriptions (leaving the + products untouched) for the site. Revenue will also be reset to 0. Attributes: ALL: The enum member of type str. CUSTOMERS: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - ALL = 'all' - CUSTOMERS = 'customers' + ALL = "all" + + CUSTOMERS = "customers" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/clone_component_price_point.py b/advancedbilling/models/clone_component_price_point.py new file mode 100644 index 00000000..e06e299b --- /dev/null +++ b/advancedbilling/models/clone_component_price_point.py @@ -0,0 +1,116 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class CloneComponentPricePoint(object): + """Implementation of the 'Clone Component Price Point' model. + + Attributes: + name (str): The model property of type str. + handle (str): The model property of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "name": "name", + "handle": "handle", + } + + _optionals = [ + "handle", + ] + + def __init__( + self, + name=None, + handle=APIHelper.SKIP, + additional_properties=None): + """Initialize a CloneComponentPricePoint instance.""" + # Initialize members of the class + self.name = name + if handle is not APIHelper.SKIP: + self.handle = handle + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(name, + handle, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/clone_component_price_point_request.py b/advancedbilling/models/clone_component_price_point_request.py new file mode 100644 index 00000000..f7e435bc --- /dev/null +++ b/advancedbilling/models/clone_component_price_point_request.py @@ -0,0 +1,93 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.models.clone_component_price_point import ( + CloneComponentPricePoint, +) + + +class CloneComponentPricePointRequest(object): + """Implementation of the 'Clone Component Price Point Request' model. + + Attributes: + price_point (CloneComponentPricePoint): The model property of type + CloneComponentPricePoint. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "price_point": "price_point", + } + + def __init__( + self, + price_point=None, + additional_properties=None): + """Initialize a CloneComponentPricePointRequest instance.""" + # Initialize members of the class + self.price_point = price_point + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + price_point =\ + CloneComponentPricePoint.from_dictionary( + dictionary.get("price_point"))\ + if dictionary.get("price_point") else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(price_point, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/collection_method.py b/advancedbilling/models/collection_method.py index 814476bb..ba44f79e 100644 --- a/advancedbilling/models/collection_method.py +++ b/advancedbilling/models/collection_method.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CollectionMethod(object): - """Implementation of the 'Collection Method' enum. The type of payment collection to be used in the subscription. For legacy - Statements Architecture valid options are - `invoice`, `automatic`. For - current Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. + Statements Architecture valid options are - `invoice`, `automatic`. For current + Relationship Invoicing Architecture valid options are - `remittance`, + `automatic`, `prepaid`. Attributes: AUTOMATIC: The enum member of type str. REMITTANCE: The enum member of type str. PREPAID: The enum member of type str. INVOICE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['automatic', 'remittance', 'prepaid', 'invoice'] - AUTOMATIC = 'automatic' - REMITTANCE = 'remittance' + _all_values = ["automatic", "remittance", "prepaid", "invoice"] + AUTOMATIC = "automatic" - PREPAID = 'prepaid' + REMITTANCE = "remittance" - INVOICE = 'invoice' + PREPAID = "prepaid" + + INVOICE = "invoice" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -47,9 +45,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/component.py b/advancedbilling/models/component.py index 8856ee3e..b9920f1f 100644 --- a/advancedbilling/models/component.py +++ b/advancedbilling/models/component.py @@ -1,306 +1,305 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_price import ComponentPrice +from advancedbilling.models.component_price import ( + ComponentPrice, +) class Component(object): - """Implementation of the 'Component' model. Attributes: - id (int): The unique ID assigned to the component by Chargify. This ID - can be used to fetch the component from the API. - name (str): The name of the Component, suitable for display on - statements. i.e. Text Messages. + id (int): The unique ID assigned to the component by Chargify. This ID can be + used to fetch the component from the API. + name (str): The name of the Component, suitable for display on statements. + i.e. Text Messages. handle (str): The component API handle - pricing_scheme (PricingScheme): The model property of type - PricingScheme. - unit_name (str): The name of the unit that the component’s usage is - measured in. i.e. message - unit_price (str): The amount the customer will be charged per unit. - This field is only populated for ‘per_unit’ pricing schemes, - otherwise it may be null. - product_family_id (int): The id of the Product Family to which the - Component belongs + pricing_scheme (PricingScheme): The model property of type PricingScheme. + unit_name (str): The name of the unit that the component’s usage is measured + in. i.e. message + unit_price (str): The amount the customer will be charged per unit. This + field is only populated for ‘per_unit’ pricing schemes, otherwise it may + be null. + product_family_id (int): The id of the Product Family to which the Component + belongs product_family_name (str): The name of the Product Family to which the Component belongs - product_family_handle (str): The handle of the Product Family to which - the Component belongs + product_family_handle (str): The handle of the Product Family to which the + Component belongs price_per_unit_in_cents (int): deprecated - use unit_price instead kind (ComponentKind): A handle for the component type - archived (bool): Boolean flag describing whether a component is - archived or not. + archived (bool): Boolean flag describing whether a component is archived or + not. description (str): The description of the component. default_price_point_id (int): The model property of type int. - overage_prices (List[ComponentPrice]): Applicable only to prepaid - usage components. An array of overage price brackets. - prices (List[ComponentPrice]): An array of price brackets. If the - component uses the ‘per_unit’ pricing scheme, this array will be - empty. - price_point_count (int): Count for the number of price points - associated with the component - price_points_url (str): URL that points to the location to read the - existing price points via GET request + overage_prices (List[ComponentPrice]): Applicable only to prepaid usage + components. An array of overage price brackets. + prices (List[ComponentPrice]): An array of price brackets. If the component + uses the ‘per_unit’ pricing scheme, this array will be empty. + price_point_count (int): Count for the number of price points associated with + the component + price_points_url (str): URL that points to the location to read the existing + price points via GET request default_price_point_name (str): The model property of type str. - taxable (bool): Boolean flag describing whether a component is taxable - or not. - tax_code (str): A string representing the tax code related to the - component type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. + taxable (bool): Boolean flag describing whether a component is taxable or not. + tax_code (str): A string representing the tax code related to the component + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. recurring (bool): The model property of type bool. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - created_at (datetime): Timestamp indicating when this component was - created - updated_at (datetime): Timestamp indicating when this component was - updated - archived_at (datetime): Timestamp indicating when this component was - archived - hide_date_range_on_invoice (bool): (Only available on Relationship - Invoicing sites) Boolean flag describing if the service date range - should show for the component on generated invoices. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. + created_at (datetime): Timestamp indicating when this component was created + updated_at (datetime): Timestamp indicating when this component was updated + archived_at (datetime): Timestamp indicating when this component was archived + hide_date_range_on_invoice (bool): (Only available on Relationship Invoicing + sites) Boolean flag describing if the service date range should show for + the component on generated invoices. allow_fractional_quantities (bool): The model property of type bool. item_category (ItemCategory): One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other use_site_exchange_rate (bool): The model property of type bool. accounting_code (str): E.g. Internal ID or SKU Number - event_based_billing_metric_id (int): (Only for Event Based Components) - This is an ID of a metric attached to the component. This metric - is used to bill upon collected events. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component's - default price point would renew every 30 days. This property is - only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component's default price point, either month or day. - This property is only available for sites with Multifrequency - enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + event_based_billing_metric_id (int): (Only for Event Based Components) This + is an ID of a metric attached to the component. This metric is used to + bill upon collected events. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component's default price point + would renew every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component's default price point, either month or day. This property + is only available for sites with Multifrequency enabled. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "handle": 'handle', - "pricing_scheme": 'pricing_scheme', - "unit_name": 'unit_name', - "unit_price": 'unit_price', - "product_family_id": 'product_family_id', - "product_family_name": 'product_family_name', - "product_family_handle": 'product_family_handle', - "price_per_unit_in_cents": 'price_per_unit_in_cents', - "kind": 'kind', - "archived": 'archived', - "description": 'description', - "default_price_point_id": 'default_price_point_id', - "overage_prices": 'overage_prices', - "prices": 'prices', - "price_point_count": 'price_point_count', - "price_points_url": 'price_points_url', - "default_price_point_name": 'default_price_point_name', - "taxable": 'taxable', - "tax_code": 'tax_code', - "recurring": 'recurring', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "created_at": 'created_at', - "updated_at": 'updated_at', - "archived_at": 'archived_at', - "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "allow_fractional_quantities": 'allow_fractional_quantities', - "item_category": 'item_category', - "use_site_exchange_rate": 'use_site_exchange_rate', - "accounting_code": 'accounting_code', - "event_based_billing_metric_id": 'event_based_billing_metric_id', - "interval": 'interval', - "interval_unit": 'interval_unit' + "id": "id", + "name": "name", + "handle": "handle", + "pricing_scheme": "pricing_scheme", + "unit_name": "unit_name", + "unit_price": "unit_price", + "product_family_id": "product_family_id", + "product_family_name": "product_family_name", + "product_family_handle": "product_family_handle", + "price_per_unit_in_cents": "price_per_unit_in_cents", + "kind": "kind", + "archived": "archived", + "description": "description", + "default_price_point_id": "default_price_point_id", + "overage_prices": "overage_prices", + "prices": "prices", + "price_point_count": "price_point_count", + "price_points_url": "price_points_url", + "default_price_point_name": "default_price_point_name", + "taxable": "taxable", + "tax_code": "tax_code", + "recurring": "recurring", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "created_at": "created_at", + "updated_at": "updated_at", + "archived_at": "archived_at", + "hide_date_range_on_invoice": "hide_date_range_on_invoice", + "allow_fractional_quantities": "allow_fractional_quantities", + "item_category": "item_category", + "use_site_exchange_rate": "use_site_exchange_rate", + "accounting_code": "accounting_code", + "event_based_billing_metric_id": "event_based_billing_metric_id", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'id', - 'name', - 'handle', - 'pricing_scheme', - 'unit_name', - 'unit_price', - 'product_family_id', - 'product_family_name', - 'product_family_handle', - 'price_per_unit_in_cents', - 'kind', - 'archived', - 'description', - 'default_price_point_id', - 'overage_prices', - 'prices', - 'price_point_count', - 'price_points_url', - 'default_price_point_name', - 'taxable', - 'tax_code', - 'recurring', - 'upgrade_charge', - 'downgrade_credit', - 'created_at', - 'updated_at', - 'archived_at', - 'hide_date_range_on_invoice', - 'allow_fractional_quantities', - 'item_category', - 'use_site_exchange_rate', - 'accounting_code', - 'event_based_billing_metric_id', - 'interval', - 'interval_unit', + "id", + "name", + "handle", + "pricing_scheme", + "unit_name", + "unit_price", + "product_family_id", + "product_family_name", + "product_family_handle", + "price_per_unit_in_cents", + "kind", + "archived", + "description", + "default_price_point_id", + "overage_prices", + "prices", + "price_point_count", + "price_points_url", + "default_price_point_name", + "taxable", + "tax_code", + "recurring", + "upgrade_charge", + "downgrade_credit", + "created_at", + "updated_at", + "archived_at", + "hide_date_range_on_invoice", + "allow_fractional_quantities", + "item_category", + "use_site_exchange_rate", + "accounting_code", + "event_based_billing_metric_id", + "interval", + "interval_unit", ] _nullables = [ - 'handle', - 'pricing_scheme', - 'unit_price', - 'price_per_unit_in_cents', - 'description', - 'default_price_point_id', - 'overage_prices', - 'prices', - 'price_points_url', - 'tax_code', - 'upgrade_charge', - 'downgrade_credit', - 'archived_at', - 'item_category', - 'use_site_exchange_rate', - 'accounting_code', - 'interval_unit', + "handle", + "pricing_scheme", + "unit_price", + "price_per_unit_in_cents", + "description", + "default_price_point_id", + "overage_prices", + "prices", + "price_points_url", + "tax_code", + "upgrade_charge", + "downgrade_credit", + "archived_at", + "item_category", + "use_site_exchange_rate", + "accounting_code", + "interval_unit", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - unit_name=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - product_family_id=APIHelper.SKIP, - product_family_name=APIHelper.SKIP, - product_family_handle=APIHelper.SKIP, - price_per_unit_in_cents=APIHelper.SKIP, - kind=APIHelper.SKIP, - archived=APIHelper.SKIP, - description=APIHelper.SKIP, - default_price_point_id=APIHelper.SKIP, - overage_prices=APIHelper.SKIP, - prices=APIHelper.SKIP, - price_point_count=APIHelper.SKIP, - price_points_url=APIHelper.SKIP, - default_price_point_name=APIHelper.SKIP, - taxable=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - recurring=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - hide_date_range_on_invoice=APIHelper.SKIP, - allow_fractional_quantities=APIHelper.SKIP, - item_category=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - accounting_code=APIHelper.SKIP, - event_based_billing_metric_id=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Component class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + unit_name=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + product_family_id=APIHelper.SKIP, + product_family_name=APIHelper.SKIP, + product_family_handle=APIHelper.SKIP, + price_per_unit_in_cents=APIHelper.SKIP, + kind=APIHelper.SKIP, + archived=APIHelper.SKIP, + description=APIHelper.SKIP, + default_price_point_id=APIHelper.SKIP, + overage_prices=APIHelper.SKIP, + prices=APIHelper.SKIP, + price_point_count=APIHelper.SKIP, + price_points_url=APIHelper.SKIP, + default_price_point_name=APIHelper.SKIP, + taxable=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + recurring=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + hide_date_range_on_invoice=APIHelper.SKIP, + allow_fractional_quantities=APIHelper.SKIP, + item_category=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + accounting_code=APIHelper.SKIP, + event_based_billing_metric_id=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a Component instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if unit_name is not APIHelper.SKIP: - self.unit_name = unit_name + self.unit_name = unit_name if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if product_family_id is not APIHelper.SKIP: - self.product_family_id = product_family_id + self.product_family_id = product_family_id if product_family_name is not APIHelper.SKIP: - self.product_family_name = product_family_name + self.product_family_name = product_family_name if product_family_handle is not APIHelper.SKIP: - self.product_family_handle = product_family_handle + self.product_family_handle = product_family_handle if price_per_unit_in_cents is not APIHelper.SKIP: - self.price_per_unit_in_cents = price_per_unit_in_cents + self.price_per_unit_in_cents = price_per_unit_in_cents if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if archived is not APIHelper.SKIP: - self.archived = archived + self.archived = archived if description is not APIHelper.SKIP: - self.description = description + self.description = description if default_price_point_id is not APIHelper.SKIP: - self.default_price_point_id = default_price_point_id + self.default_price_point_id = default_price_point_id if overage_prices is not APIHelper.SKIP: - self.overage_prices = overage_prices + self.overage_prices = overage_prices if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices if price_point_count is not APIHelper.SKIP: - self.price_point_count = price_point_count + self.price_point_count = price_point_count if price_points_url is not APIHelper.SKIP: - self.price_points_url = price_points_url + self.price_points_url = price_points_url if default_price_point_name is not APIHelper.SKIP: - self.default_price_point_name = default_price_point_name + self.default_price_point_name = default_price_point_name if taxable is not APIHelper.SKIP: - self.taxable = taxable + self.taxable = taxable if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if archived_at is not APIHelper.SKIP: - self.archived_at = APIHelper.apply_datetime_converter(archived_at, APIHelper.RFC3339DateTime) if archived_at else None + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None if hide_date_range_on_invoice is not APIHelper.SKIP: - self.hide_date_range_on_invoice = hide_date_range_on_invoice + self.hide_date_range_on_invoice = hide_date_range_on_invoice if allow_fractional_quantities is not APIHelper.SKIP: - self.allow_fractional_quantities = allow_fractional_quantities + self.allow_fractional_quantities = allow_fractional_quantities if item_category is not APIHelper.SKIP: - self.item_category = item_category + self.item_category = item_category if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if accounting_code is not APIHelper.SKIP: - self.accounting_code = accounting_code + self.accounting_code = accounting_code if event_based_billing_metric_id is not APIHelper.SKIP: - self.event_based_billing_metric_id = event_based_billing_metric_id + self.event_based_billing_metric_id = event_based_billing_metric_id if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -310,7 +309,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -321,57 +320,162 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if "handle" in dictionary.keys() else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if "pricing_scheme" in dictionary.keys() else APIHelper.SKIP - unit_name = dictionary.get("unit_name") if dictionary.get("unit_name") else APIHelper.SKIP - unit_price = dictionary.get("unit_price") if "unit_price" in dictionary.keys() else APIHelper.SKIP - product_family_id = dictionary.get("product_family_id") if dictionary.get("product_family_id") else APIHelper.SKIP - product_family_name = dictionary.get("product_family_name") if dictionary.get("product_family_name") else APIHelper.SKIP - product_family_handle = dictionary.get("product_family_handle") if dictionary.get("product_family_handle") else APIHelper.SKIP - price_per_unit_in_cents = dictionary.get("price_per_unit_in_cents") if "price_per_unit_in_cents" in dictionary.keys() else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - archived = dictionary.get("archived") if "archived" in dictionary.keys() else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - default_price_point_id = dictionary.get("default_price_point_id") if "default_price_point_id" in dictionary.keys() else APIHelper.SKIP - if 'overage_prices' in dictionary.keys(): - overage_prices = [ComponentPrice.from_dictionary(x) for x in dictionary.get('overage_prices')] if dictionary.get('overage_prices') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if "handle" in dictionary.keys()\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if "pricing_scheme" in dictionary.keys()\ + else APIHelper.SKIP + unit_name =\ + dictionary.get("unit_name")\ + if dictionary.get("unit_name")\ + else APIHelper.SKIP + unit_price =\ + dictionary.get("unit_price")\ + if "unit_price" in dictionary.keys()\ + else APIHelper.SKIP + product_family_id =\ + dictionary.get("product_family_id")\ + if dictionary.get("product_family_id")\ + else APIHelper.SKIP + product_family_name =\ + dictionary.get("product_family_name")\ + if dictionary.get("product_family_name")\ + else APIHelper.SKIP + product_family_handle =\ + dictionary.get("product_family_handle")\ + if dictionary.get("product_family_handle")\ + else APIHelper.SKIP + price_per_unit_in_cents =\ + dictionary.get("price_per_unit_in_cents")\ + if "price_per_unit_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + archived =\ + dictionary.get("archived")\ + if "archived" in dictionary.keys()\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + default_price_point_id =\ + dictionary.get("default_price_point_id")\ + if "default_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + if "overage_prices" in dictionary.keys(): + overage_prices = [ + ComponentPrice.from_dictionary(x) + for x in dictionary.get("overage_prices") + ] if dictionary.get("overage_prices") else None else: overage_prices = APIHelper.SKIP - if 'prices' in dictionary.keys(): - prices = [ComponentPrice.from_dictionary(x) for x in dictionary.get('prices')] if dictionary.get('prices') else None + if "prices" in dictionary.keys(): + prices = [ + ComponentPrice.from_dictionary(x) + for x in dictionary.get("prices") + ] if dictionary.get("prices") else None else: prices = APIHelper.SKIP - price_point_count = dictionary.get("price_point_count") if dictionary.get("price_point_count") else APIHelper.SKIP - price_points_url = dictionary.get("price_points_url") if "price_points_url" in dictionary.keys() else APIHelper.SKIP - default_price_point_name = dictionary.get("default_price_point_name") if dictionary.get("default_price_point_name") else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if "tax_code" in dictionary.keys() else APIHelper.SKIP - recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - if 'archived_at' in dictionary.keys(): - archived_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("archived_at")).datetime if dictionary.get("archived_at") else None + price_point_count =\ + dictionary.get("price_point_count")\ + if dictionary.get("price_point_count")\ + else APIHelper.SKIP + price_points_url =\ + dictionary.get("price_points_url")\ + if "price_points_url" in dictionary.keys()\ + else APIHelper.SKIP + default_price_point_name =\ + dictionary.get("default_price_point_name")\ + if dictionary.get("default_price_point_name")\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if "tax_code" in dictionary.keys()\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if "recurring" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + else: archived_at = APIHelper.SKIP - hide_date_range_on_invoice = dictionary.get("hide_date_range_on_invoice") if "hide_date_range_on_invoice" in dictionary.keys() else APIHelper.SKIP - allow_fractional_quantities = dictionary.get("allow_fractional_quantities") if "allow_fractional_quantities" in dictionary.keys() else APIHelper.SKIP - item_category = dictionary.get("item_category") if "item_category" in dictionary.keys() else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - accounting_code = dictionary.get("accounting_code") if "accounting_code" in dictionary.keys() else APIHelper.SKIP - event_based_billing_metric_id = dictionary.get("event_based_billing_metric_id") if dictionary.get("event_based_billing_metric_id") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + hide_date_range_on_invoice =\ + dictionary.get("hide_date_range_on_invoice")\ + if "hide_date_range_on_invoice" in dictionary.keys()\ + else APIHelper.SKIP + allow_fractional_quantities =\ + dictionary.get("allow_fractional_quantities")\ + if "allow_fractional_quantities" in dictionary.keys()\ + else APIHelper.SKIP + item_category =\ + dictionary.get("item_category")\ + if "item_category" in dictionary.keys()\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + accounting_code =\ + dictionary.get("accounting_code")\ + if "accounting_code" in dictionary.keys()\ + else APIHelper.SKIP + event_based_billing_metric_id =\ + dictionary.get("event_based_billing_metric_id")\ + if dictionary.get("event_based_billing_metric_id")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -411,79 +515,439 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'unit_name={(self.unit_name if hasattr(self, "unit_name") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!r}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!r}, ' - f'product_family_handle={(self.product_family_handle if hasattr(self, "product_family_handle") else None)!r}, ' - f'price_per_unit_in_cents={(self.price_per_unit_in_cents if hasattr(self, "price_per_unit_in_cents") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'archived={(self.archived if hasattr(self, "archived") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'default_price_point_id={(self.default_price_point_id if hasattr(self, "default_price_point_id") else None)!r}, ' - f'overage_prices={(self.overage_prices if hasattr(self, "overage_prices") else None)!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'price_point_count={(self.price_point_count if hasattr(self, "price_point_count") else None)!r}, ' - f'price_points_url={(self.price_points_url if hasattr(self, "price_points_url") else None)!r}, ' - f'default_price_point_name={(self.default_price_point_name if hasattr(self, "default_price_point_name") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!r}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!r}, ' - f'item_category={(self.item_category if hasattr(self, "item_category") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!r}, ' - f'event_based_billing_metric_id={(self.event_based_billing_metric_id if hasattr(self, "event_based_billing_metric_id") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _unit_name=( + self.unit_name + if hasattr(self, "unit_name") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _product_family_handle=( + self.product_family_handle + if hasattr(self, "product_family_handle") + else None + ) + _price_per_unit_in_cents=( + self.price_per_unit_in_cents + if hasattr(self, "price_per_unit_in_cents") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _archived=( + self.archived + if hasattr(self, "archived") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _default_price_point_id=( + self.default_price_point_id + if hasattr(self, "default_price_point_id") + else None + ) + _overage_prices=( + self.overage_prices + if hasattr(self, "overage_prices") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _price_point_count=( + self.price_point_count + if hasattr(self, "price_point_count") + else None + ) + _price_points_url=( + self.price_points_url + if hasattr(self, "price_points_url") + else None + ) + _default_price_point_name=( + self.default_price_point_name + if hasattr(self, "default_price_point_name") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _item_category=( + self.item_category + if hasattr(self, "item_category") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _event_based_billing_metric_id=( + self.event_based_billing_metric_id + if hasattr(self, "event_based_billing_metric_id") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"handle={_handle!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"unit_name={_unit_name!r}, " + f"unit_price={_unit_price!r}, " + f"product_family_id={_product_family_id!r}, " + f"product_family_name={_product_family_name!r}, " + f"product_family_handle={_product_family_handle!r}, " + f"price_per_unit_in_cents={_price_per_unit_in_cents!r}, " + f"kind={_kind!r}, " + f"archived={_archived!r}, " + f"description={_description!r}, " + f"default_price_point_id={_default_price_point_id!r}, " + f"overage_prices={_overage_prices!r}, " + f"prices={_prices!r}, " + f"price_point_count={_price_point_count!r}, " + f"price_points_url={_price_points_url!r}, " + f"default_price_point_name={_default_price_point_name!r}, " + f"taxable={_taxable!r}, " + f"tax_code={_tax_code!r}, " + f"recurring={_recurring!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"archived_at={_archived_at!r}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!r}, " + f"allow_fractional_quantities={_allow_fractional_quantities!r}, " + f"item_category={_item_category!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"accounting_code={_accounting_code!r}, " + f"event_based_billing_metric_id={_event_based_billing_metric_id!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'unit_name={(self.unit_name if hasattr(self, "unit_name") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!s}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!s}, ' - f'product_family_handle={(self.product_family_handle if hasattr(self, "product_family_handle") else None)!s}, ' - f'price_per_unit_in_cents={(self.price_per_unit_in_cents if hasattr(self, "price_per_unit_in_cents") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'archived={(self.archived if hasattr(self, "archived") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'default_price_point_id={(self.default_price_point_id if hasattr(self, "default_price_point_id") else None)!s}, ' - f'overage_prices={(self.overage_prices if hasattr(self, "overage_prices") else None)!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'price_point_count={(self.price_point_count if hasattr(self, "price_point_count") else None)!s}, ' - f'price_points_url={(self.price_points_url if hasattr(self, "price_points_url") else None)!s}, ' - f'default_price_point_name={(self.default_price_point_name if hasattr(self, "default_price_point_name") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!s}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!s}, ' - f'item_category={(self.item_category if hasattr(self, "item_category") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!s}, ' - f'event_based_billing_metric_id={(self.event_based_billing_metric_id if hasattr(self, "event_based_billing_metric_id") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _unit_name=( + self.unit_name + if hasattr(self, "unit_name") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _product_family_handle=( + self.product_family_handle + if hasattr(self, "product_family_handle") + else None + ) + _price_per_unit_in_cents=( + self.price_per_unit_in_cents + if hasattr(self, "price_per_unit_in_cents") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _archived=( + self.archived + if hasattr(self, "archived") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _default_price_point_id=( + self.default_price_point_id + if hasattr(self, "default_price_point_id") + else None + ) + _overage_prices=( + self.overage_prices + if hasattr(self, "overage_prices") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _price_point_count=( + self.price_point_count + if hasattr(self, "price_point_count") + else None + ) + _price_points_url=( + self.price_points_url + if hasattr(self, "price_points_url") + else None + ) + _default_price_point_name=( + self.default_price_point_name + if hasattr(self, "default_price_point_name") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _item_category=( + self.item_category + if hasattr(self, "item_category") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _event_based_billing_metric_id=( + self.event_based_billing_metric_id + if hasattr(self, "event_based_billing_metric_id") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"handle={_handle!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"unit_name={_unit_name!s}, " + f"unit_price={_unit_price!s}, " + f"product_family_id={_product_family_id!s}, " + f"product_family_name={_product_family_name!s}, " + f"product_family_handle={_product_family_handle!s}, " + f"price_per_unit_in_cents={_price_per_unit_in_cents!s}, " + f"kind={_kind!s}, " + f"archived={_archived!s}, " + f"description={_description!s}, " + f"default_price_point_id={_default_price_point_id!s}, " + f"overage_prices={_overage_prices!s}, " + f"prices={_prices!s}, " + f"price_point_count={_price_point_count!s}, " + f"price_points_url={_price_points_url!s}, " + f"default_price_point_name={_default_price_point_name!s}, " + f"taxable={_taxable!s}, " + f"tax_code={_tax_code!s}, " + f"recurring={_recurring!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"archived_at={_archived_at!s}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!s}, " + f"allow_fractional_quantities={_allow_fractional_quantities!s}, " + f"item_category={_item_category!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"accounting_code={_accounting_code!s}, " + f"event_based_billing_metric_id={_event_based_billing_metric_id!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_allocation_change.py b/advancedbilling/models/component_allocation_change.py index 7a546eed..e6dcccf9 100644 --- a/advancedbilling/models/component_allocation_change.py +++ b/advancedbilling/models/component_allocation_change.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ComponentAllocationChange(object): - """Implementation of the 'Component Allocation Change' model. Attributes: @@ -20,48 +18,48 @@ class ComponentAllocationChange(object): component_handle (str): The model property of type str. memo (str): The model property of type str. allocation_id (int): The model property of type int. - allocated_quantity (int | str | None): The model property of type int - | str | None. - additional_properties (Dict[str, object]): The additional properties - for the model. + allocated_quantity (int | str | None): The model property of type int | str | + None. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "previous_allocation": 'previous_allocation', - "new_allocation": 'new_allocation', - "component_id": 'component_id', - "component_handle": 'component_handle', - "memo": 'memo', - "allocation_id": 'allocation_id', - "allocated_quantity": 'allocated_quantity' + "previous_allocation": "previous_allocation", + "new_allocation": "new_allocation", + "component_id": "component_id", + "component_handle": "component_handle", + "memo": "memo", + "allocation_id": "allocation_id", + "allocated_quantity": "allocated_quantity", } _optionals = [ - 'allocated_quantity', + "allocated_quantity", ] - def __init__(self, - previous_allocation=None, - new_allocation=None, - component_id=None, - component_handle=None, - memo=None, - allocation_id=None, - allocated_quantity=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentAllocationChange class""" - + def __init__( + self, + previous_allocation=None, + new_allocation=None, + component_id=None, + component_handle=None, + memo=None, + allocation_id=None, + allocated_quantity=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentAllocationChange instance.""" # Initialize members of the class - self.previous_allocation = previous_allocation - self.new_allocation = new_allocation - self.component_id = component_id - self.component_handle = component_handle - self.memo = memo - self.allocation_id = allocation_id + self.previous_allocation = previous_allocation + self.new_allocation = new_allocation + self.component_id = component_id + self.component_handle = component_handle + self.memo = memo + self.allocation_id = allocation_id if allocated_quantity is not APIHelper.SKIP: - self.allocated_quantity = allocated_quantity + self.allocated_quantity = allocated_quantity # Add additional model properties to the instance if additional_properties is None: @@ -71,7 +69,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -82,21 +80,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - previous_allocation = dictionary.get("previous_allocation") if dictionary.get("previous_allocation") else None - new_allocation = dictionary.get("new_allocation") if dictionary.get("new_allocation") else None - component_id = dictionary.get("component_id") if dictionary.get("component_id") else None - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - allocation_id = dictionary.get("allocation_id") if dictionary.get("allocation_id") else None - allocated_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('ComponentAllocationChangeAllocatedQuantity'), dictionary.get('allocated_quantity'), False) if dictionary.get('allocated_quantity') is not None else APIHelper.SKIP + previous_allocation =\ + dictionary.get("previous_allocation")\ + if dictionary.get("previous_allocation")\ + else None + new_allocation =\ + dictionary.get("new_allocation")\ + if dictionary.get("new_allocation")\ + else None + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else None + component_handle =\ + dictionary.get("component_handle")\ + if dictionary.get("component_handle")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + allocation_id =\ + dictionary.get("allocation_id")\ + if dictionary.get("allocation_id")\ + else None + allocated_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("ComponentAllocationChangeAllocatedQuantity"), + dictionary.get("allocated_quantity"), + False)\ + if dictionary.get("allocated_quantity") is not None\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(previous_allocation, new_allocation, @@ -109,7 +135,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -120,55 +146,146 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.previous_allocation, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.new_allocation, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.component_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.component_handle, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.allocation_id, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.previous_allocation, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.new_allocation, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.component_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.component_handle, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.allocation_id, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('previous_allocation'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('new_allocation'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('component_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('component_handle'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('allocation_id'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("previous_allocation"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_allocation"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("component_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("component_handle"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("allocation_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'previous_allocation={self.previous_allocation!r}, ' - f'new_allocation={self.new_allocation!r}, ' - f'component_id={self.component_id!r}, ' - f'component_handle={self.component_handle!r}, ' - f'memo={self.memo!r}, ' - f'allocation_id={self.allocation_id!r}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _previous_allocation=self.previous_allocation + _new_allocation=self.new_allocation + _component_id=self.component_id + _component_handle=self.component_handle + _memo=self.memo + _allocation_id=self.allocation_id + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_allocation={_previous_allocation!r}, " + f"new_allocation={_new_allocation!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"memo={_memo!r}, " + f"allocation_id={_allocation_id!r}, " + f"allocated_quantity={_allocated_quantity!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'previous_allocation={self.previous_allocation!s}, ' - f'new_allocation={self.new_allocation!s}, ' - f'component_id={self.component_id!s}, ' - f'component_handle={self.component_handle!s}, ' - f'memo={self.memo!s}, ' - f'allocation_id={self.allocation_id!s}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _previous_allocation=self.previous_allocation + _new_allocation=self.new_allocation + _component_id=self.component_id + _component_handle=self.component_handle + _memo=self.memo + _allocation_id=self.allocation_id + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_allocation={_previous_allocation!s}, " + f"new_allocation={_new_allocation!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"memo={_memo!s}, " + f"allocation_id={_allocation_id!s}, " + f"allocated_quantity={_allocated_quantity!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_allocation_error_item.py b/advancedbilling/models/component_allocation_error_item.py index 6e44fd35..abf11cd7 100644 --- a/advancedbilling/models/component_allocation_error_item.py +++ b/advancedbilling/models/component_allocation_error_item.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ComponentAllocationErrorItem(object): - """Implementation of the 'Component Allocation Error Item' model. Attributes: @@ -18,43 +16,43 @@ class ComponentAllocationErrorItem(object): message (str): The model property of type str. kind (str): The model property of type str. on (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "message": 'message', - "kind": 'kind', - "on": 'on' + "component_id": "component_id", + "message": "message", + "kind": "kind", + "on": "on", } _optionals = [ - 'component_id', - 'message', - 'kind', - 'on', + "component_id", + "message", + "kind", + "on", ] - def __init__(self, - component_id=APIHelper.SKIP, - message=APIHelper.SKIP, - kind=APIHelper.SKIP, - on=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentAllocationErrorItem class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + message=APIHelper.SKIP, + kind=APIHelper.SKIP, + on=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentAllocationErrorItem instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if message is not APIHelper.SKIP: - self.message = message + self.message = message if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if on is not APIHelper.SKIP: - self.on = on + self.on = on # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - message = dictionary.get("message") if dictionary.get("message") else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - on = dictionary.get("on") if dictionary.get("on") else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + message =\ + dictionary.get("message")\ + if dictionary.get("message")\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + on =\ + dictionary.get("on")\ + if dictionary.get("on")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, message, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'message={(self.message if hasattr(self, "message") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'on={(self.on if hasattr(self, "on") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _message=( + self.message + if hasattr(self, "message") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _on=( + self.on + if hasattr(self, "on") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"message={_message!r}, " + f"kind={_kind!r}, " + f"on={_on!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'message={(self.message if hasattr(self, "message") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'on={(self.on if hasattr(self, "on") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _message=( + self.message + if hasattr(self, "message") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _on=( + self.on + if hasattr(self, "on") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"message={_message!s}, " + f"kind={_kind!s}, " + f"on={_on!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_cost_data.py b/advancedbilling/models/component_cost_data.py index 71e7d5cb..07da3869 100644 --- a/advancedbilling/models/component_cost_data.py +++ b/advancedbilling/models/component_cost_data.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_cost_data_rate_tier import ComponentCostDataRateTier +from advancedbilling.models.component_cost_data_rate_tier import ( + ComponentCostDataRateTier, +) class ComponentCostData(object): - """Implementation of the 'Component Cost Data' model. Attributes: @@ -20,68 +20,68 @@ class ComponentCostData(object): product_id (int): The model property of type int. quantity (str): The model property of type str. amount (str): The model property of type str. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. tiers (List[ComponentCostDataRateTier]): The model property of type List[ComponentCostDataRateTier]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_code_id": 'component_code_id', - "price_point_id": 'price_point_id', - "product_id": 'product_id', - "quantity": 'quantity', - "amount": 'amount', - "pricing_scheme": 'pricing_scheme', - "tiers": 'tiers' + "component_code_id": "component_code_id", + "price_point_id": "price_point_id", + "product_id": "product_id", + "quantity": "quantity", + "amount": "amount", + "pricing_scheme": "pricing_scheme", + "tiers": "tiers", } _optionals = [ - 'component_code_id', - 'price_point_id', - 'product_id', - 'quantity', - 'amount', - 'pricing_scheme', - 'tiers', + "component_code_id", + "price_point_id", + "product_id", + "quantity", + "amount", + "pricing_scheme", + "tiers", ] _nullables = [ - 'component_code_id', + "component_code_id", ] - def __init__(self, - component_code_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - product_id=APIHelper.SKIP, - quantity=APIHelper.SKIP, - amount=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - tiers=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentCostData class""" - + def __init__( + self, + component_code_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + product_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + amount=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + tiers=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentCostData instance.""" # Initialize members of the class if component_code_id is not APIHelper.SKIP: - self.component_code_id = component_code_id + self.component_code_id = component_code_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if tiers is not APIHelper.SKIP: - self.tiers = tiers + self.tiers = tiers # Add additional model properties to the instance if additional_properties is None: @@ -91,7 +91,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -102,24 +102,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_code_id = dictionary.get("component_code_id") if "component_code_id" in dictionary.keys() else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - amount = dictionary.get("amount") if dictionary.get("amount") else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else APIHelper.SKIP + component_code_id =\ + dictionary.get("component_code_id")\ + if "component_code_id" in dictionary.keys()\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP tiers = None - if dictionary.get('tiers') is not None: - tiers = [ComponentCostDataRateTier.from_dictionary(x) for x in dictionary.get('tiers')] + if dictionary.get("tiers") is not None: + tiers = [ + ComponentCostDataRateTier.from_dictionary(x) + for x in dictionary.get("tiers") + ] else: tiers = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_code_id, price_point_id, @@ -132,7 +155,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -143,7 +166,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -153,23 +175,103 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_code_id={(self.component_code_id if hasattr(self, "component_code_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'tiers={(self.tiers if hasattr(self, "tiers") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_code_id=( + self.component_code_id + if hasattr(self, "component_code_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _tiers=( + self.tiers + if hasattr(self, "tiers") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_code_id={_component_code_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"product_id={_product_id!r}, " + f"quantity={_quantity!r}, " + f"amount={_amount!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"tiers={_tiers!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_code_id={(self.component_code_id if hasattr(self, "component_code_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'tiers={(self.tiers if hasattr(self, "tiers") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_code_id=( + self.component_code_id + if hasattr(self, "component_code_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _tiers=( + self.tiers + if hasattr(self, "tiers") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_code_id={_component_code_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"product_id={_product_id!s}, " + f"quantity={_quantity!s}, " + f"amount={_amount!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"tiers={_tiers!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_cost_data_rate_tier.py b/advancedbilling/models/component_cost_data_rate_tier.py index dc3b518c..6820427c 100644 --- a/advancedbilling/models/component_cost_data_rate_tier.py +++ b/advancedbilling/models/component_cost_data_rate_tier.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ComponentCostDataRateTier(object): - """Implementation of the 'Component Cost Data Rate Tier' model. Attributes: @@ -19,52 +17,52 @@ class ComponentCostDataRateTier(object): quantity (str): The model property of type str. unit_price (str): The model property of type str. amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "starting_quantity": 'starting_quantity', - "ending_quantity": 'ending_quantity', - "quantity": 'quantity', - "unit_price": 'unit_price', - "amount": 'amount' + "starting_quantity": "starting_quantity", + "ending_quantity": "ending_quantity", + "quantity": "quantity", + "unit_price": "unit_price", + "amount": "amount", } _optionals = [ - 'starting_quantity', - 'ending_quantity', - 'quantity', - 'unit_price', - 'amount', + "starting_quantity", + "ending_quantity", + "quantity", + "unit_price", + "amount", ] _nullables = [ - 'ending_quantity', + "ending_quantity", ] - def __init__(self, - starting_quantity=APIHelper.SKIP, - ending_quantity=APIHelper.SKIP, - quantity=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentCostDataRateTier class""" - + def __init__( + self, + starting_quantity=APIHelper.SKIP, + ending_quantity=APIHelper.SKIP, + quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentCostDataRateTier instance.""" # Initialize members of the class if starting_quantity is not APIHelper.SKIP: - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity if ending_quantity is not APIHelper.SKIP: - self.ending_quantity = ending_quantity + self.ending_quantity = ending_quantity if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount # Add additional model properties to the instance if additional_properties is None: @@ -74,7 +72,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -85,18 +83,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - starting_quantity = dictionary.get("starting_quantity") if dictionary.get("starting_quantity") else APIHelper.SKIP - ending_quantity = dictionary.get("ending_quantity") if "ending_quantity" in dictionary.keys() else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - unit_price = dictionary.get("unit_price") if dictionary.get("unit_price") else APIHelper.SKIP - amount = dictionary.get("amount") if dictionary.get("amount") else APIHelper.SKIP + starting_quantity =\ + dictionary.get("starting_quantity")\ + if dictionary.get("starting_quantity")\ + else APIHelper.SKIP + ending_quantity =\ + dictionary.get("ending_quantity")\ + if "ending_quantity" in dictionary.keys()\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + unit_price =\ + dictionary.get("unit_price")\ + if dictionary.get("unit_price")\ + else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(starting_quantity, ending_quantity, @@ -107,7 +122,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -118,7 +133,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -128,19 +142,79 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!r}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starting_quantity={_starting_quantity!r}, " + f"ending_quantity={_ending_quantity!r}, " + f"quantity={_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"amount={_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!s}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starting_quantity={_starting_quantity!s}, " + f"ending_quantity={_ending_quantity!s}, " + f"quantity={_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"amount={_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_currency_price.py b/advancedbilling/models/component_currency_price.py index 9f85386e..c545cdae 100644 --- a/advancedbilling/models/component_currency_price.py +++ b/advancedbilling/models/component_currency_price.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ComponentCurrencyPrice(object): - """Implementation of the 'Component Currency Price' model. Attributes: @@ -20,53 +18,53 @@ class ComponentCurrencyPrice(object): formatted_price (str): The model property of type str. price_id (int): The model property of type int. price_point_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "currency": 'currency', - "price": 'price', - "formatted_price": 'formatted_price', - "price_id": 'price_id', - "price_point_id": 'price_point_id' + "id": "id", + "currency": "currency", + "price": "price", + "formatted_price": "formatted_price", + "price_id": "price_id", + "price_point_id": "price_point_id", } _optionals = [ - 'id', - 'currency', - 'price', - 'formatted_price', - 'price_id', - 'price_point_id', + "id", + "currency", + "price", + "formatted_price", + "price_id", + "price_point_id", ] - def __init__(self, - id=APIHelper.SKIP, - currency=APIHelper.SKIP, - price=APIHelper.SKIP, - formatted_price=APIHelper.SKIP, - price_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentCurrencyPrice class""" - + def __init__( + self, + id=APIHelper.SKIP, + currency=APIHelper.SKIP, + price=APIHelper.SKIP, + formatted_price=APIHelper.SKIP, + price_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentCurrencyPrice instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if price is not APIHelper.SKIP: - self.price = price + self.price = price if formatted_price is not APIHelper.SKIP: - self.formatted_price = formatted_price + self.formatted_price = formatted_price if price_id is not APIHelper.SKIP: - self.price_id = price_id + self.price_id = price_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +74,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,19 +85,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - price = dictionary.get("price") if dictionary.get("price") else APIHelper.SKIP - formatted_price = dictionary.get("formatted_price") if dictionary.get("formatted_price") else APIHelper.SKIP - price_id = dictionary.get("price_id") if dictionary.get("price_id") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + price =\ + dictionary.get("price")\ + if dictionary.get("price")\ + else APIHelper.SKIP + formatted_price =\ + dictionary.get("formatted_price")\ + if dictionary.get("formatted_price")\ + else APIHelper.SKIP + price_id =\ + dictionary.get("price_id")\ + if dictionary.get("price_id")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, currency, @@ -110,21 +128,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'price={(self.price if hasattr(self, "price") else None)!r}, ' - f'formatted_price={(self.formatted_price if hasattr(self, "formatted_price") else None)!r}, ' - f'price_id={(self.price_id if hasattr(self, "price_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _formatted_price=( + self.formatted_price + if hasattr(self, "formatted_price") + else None + ) + _price_id=( + self.price_id + if hasattr(self, "price_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"currency={_currency!r}, " + f"price={_price!r}, " + f"formatted_price={_formatted_price!r}, " + f"price_id={_price_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'price={(self.price if hasattr(self, "price") else None)!s}, ' - f'formatted_price={(self.formatted_price if hasattr(self, "formatted_price") else None)!s}, ' - f'price_id={(self.price_id if hasattr(self, "price_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _formatted_price=( + self.formatted_price + if hasattr(self, "formatted_price") + else None + ) + _price_id=( + self.price_id + if hasattr(self, "price_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"currency={_currency!s}, " + f"price={_price!s}, " + f"formatted_price={_formatted_price!s}, " + f"price_id={_price_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_currency_prices_response.py b/advancedbilling/models/component_currency_prices_response.py index a3e2076b..b539adb9 100644 --- a/advancedbilling/models/component_currency_prices_response.py +++ b/advancedbilling/models/component_currency_prices_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.component_currency_price import ComponentCurrencyPrice +# ruff: noqa: E501 +from advancedbilling.models.component_currency_price import ( + ComponentCurrencyPrice, +) -class ComponentCurrencyPricesResponse(object): +class ComponentCurrencyPricesResponse(object): """Implementation of the 'Component Currency Prices Response' model. Attributes: - currency_prices (List[ComponentCurrencyPrice]): The model property of - type List[ComponentCurrencyPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + currency_prices (List[ComponentCurrencyPrice]): The model property of type + List[ComponentCurrencyPrice]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency_prices": 'currency_prices' + "currency_prices": "currency_prices", } - def __init__(self, - currency_prices=None, - additional_properties=None): - """Constructor for the ComponentCurrencyPricesResponse class""" - + def __init__( + self, + currency_prices=None, + additional_properties=None): + """Initialize a ComponentCurrencyPricesResponse instance.""" # Initialize members of the class - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [ComponentCurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + ComponentCurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency_prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_custom_price.py b/advancedbilling/models/component_custom_price.py index a5456e4e..522961fb 100644 --- a/advancedbilling/models/component_custom_price.py +++ b/advancedbilling/models/component_custom_price.py @@ -1,112 +1,122 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.price import Price class ComponentCustomPrice(object): - """Implementation of the 'Component Custom Price' model. - Create or update custom pricing unique to the subscription. Used in place - of `price_point_id`. + Create or update custom pricing unique to the subscription. Used in place of + `price_point_id`. Attributes: tax_included (bool): Whether or not the price point includes tax pricing_scheme (PricingScheme): Omit for On/Off components - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. - prices (List[Price]): On/off components only need one price bracket - starting at 1 - renew_prepaid_allocation (bool): Applicable only to prepaid usage - components. Controls whether the allocated quantity renews each - period. + list_price_point_id (int): Optional id of the price point to use for list + price calculations when overriding the customer price. + use_default_list_price (bool): When true, list price calculations will + continue to use the default price point even when a `custom_price` is + supplied. + prices (List[Price]): On/off components only need one price bracket starting + at 1. + renew_prepaid_allocation (bool): Applicable only to prepaid usage components. + Controls whether the allocated quantity renews each period. rollover_prepaid_remainder (bool): Applicable only to prepaid usage - components. Controls whether remaining units roll over to the next - period. - expiration_interval (int): Applicable only when rollover is enabled. - Number of `expiration_interval_unit`s after which rollover amounts - expire. - expiration_interval_unit (ExpirationIntervalUnit): Applicable only - when rollover is enabled. Interval unit for rollover expiration - (month or day). - additional_properties (Dict[str, object]): The additional properties - for the model. + components. Controls whether remaining units roll over to the next period. + expiration_interval (int): Applicable only when rollover is enabled. Number + of `expiration_interval_unit`s after which rollover amounts expire. + expiration_interval_unit (ExpirationIntervalUnit): Applicable only when + rollover is enabled. Interval unit for rollover expiration (month or day). + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prices": 'prices', - "tax_included": 'tax_included', - "pricing_scheme": 'pricing_scheme', - "interval": 'interval', - "interval_unit": 'interval_unit', - "renew_prepaid_allocation": 'renew_prepaid_allocation', - "rollover_prepaid_remainder": 'rollover_prepaid_remainder', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit' + "prices": "prices", + "tax_included": "tax_included", + "pricing_scheme": "pricing_scheme", + "interval": "interval", + "interval_unit": "interval_unit", + "list_price_point_id": "list_price_point_id", + "use_default_list_price": "use_default_list_price", + "renew_prepaid_allocation": "renew_prepaid_allocation", + "rollover_prepaid_remainder": "rollover_prepaid_remainder", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", } _optionals = [ - 'tax_included', - 'pricing_scheme', - 'interval', - 'interval_unit', - 'renew_prepaid_allocation', - 'rollover_prepaid_remainder', - 'expiration_interval', - 'expiration_interval_unit', + "tax_included", + "pricing_scheme", + "interval", + "interval_unit", + "list_price_point_id", + "use_default_list_price", + "renew_prepaid_allocation", + "rollover_prepaid_remainder", + "expiration_interval", + "expiration_interval_unit", ] _nullables = [ - 'interval_unit', - 'expiration_interval', - 'expiration_interval_unit', + "interval_unit", + "list_price_point_id", + "expiration_interval", + "expiration_interval_unit", ] - def __init__(self, - prices=None, - tax_included=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - renew_prepaid_allocation=APIHelper.SKIP, - rollover_prepaid_remainder=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentCustomPrice class""" - + def __init__( + self, + prices=None, + tax_included=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + list_price_point_id=APIHelper.SKIP, + use_default_list_price=APIHelper.SKIP, + renew_prepaid_allocation=APIHelper.SKIP, + rollover_prepaid_remainder=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentCustomPrice instance.""" # Initialize members of the class if tax_included is not APIHelper.SKIP: - self.tax_included = tax_included + self.tax_included = tax_included if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit - self.prices = prices + self.interval_unit = interval_unit + if list_price_point_id is not APIHelper.SKIP: + self.list_price_point_id = list_price_point_id + if use_default_list_price is not APIHelper.SKIP: + self.use_default_list_price = use_default_list_price + self.prices = prices if renew_prepaid_allocation is not APIHelper.SKIP: - self.renew_prepaid_allocation = renew_prepaid_allocation + self.renew_prepaid_allocation = renew_prepaid_allocation if rollover_prepaid_remainder is not APIHelper.SKIP: - self.rollover_prepaid_remainder = rollover_prepaid_remainder + self.rollover_prepaid_remainder = rollover_prepaid_remainder if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -116,7 +126,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -127,30 +137,69 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] - tax_included = dictionary.get("tax_included") if "tax_included" in dictionary.keys() else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP - renew_prepaid_allocation = dictionary.get("renew_prepaid_allocation") if "renew_prepaid_allocation" in dictionary.keys() else APIHelper.SKIP - rollover_prepaid_remainder = dictionary.get("rollover_prepaid_remainder") if "rollover_prepaid_remainder" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if "expiration_interval" in dictionary.keys() else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + list_price_point_id =\ + dictionary.get("list_price_point_id")\ + if "list_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + use_default_list_price =\ + dictionary.get("use_default_list_price")\ + if "use_default_list_price" in dictionary.keys()\ + else APIHelper.SKIP + renew_prepaid_allocation =\ + dictionary.get("renew_prepaid_allocation")\ + if "renew_prepaid_allocation" in dictionary.keys()\ + else APIHelper.SKIP + rollover_prepaid_remainder =\ + dictionary.get("rollover_prepaid_remainder")\ + if "rollover_prepaid_remainder" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if "expiration_interval" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prices, tax_included, pricing_scheme, interval, interval_unit, + list_price_point_id, + use_default_list_price, renew_prepaid_allocation, rollover_prepaid_remainder, expiration_interval, @@ -159,7 +208,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -170,43 +219,162 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.prices, - type_callable=lambda value: Price.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.prices, + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('prices'), - type_callable=lambda value: Price.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("prices"), + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'prices={self.prices!r}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!r}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _list_price_point_id=( + self.list_price_point_id + if hasattr(self, "list_price_point_id") + else None + ) + _use_default_list_price=( + self.use_default_list_price + if hasattr(self, "use_default_list_price") + else None + ) + _prices=self.prices + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"tax_included={_tax_included!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"list_price_point_id={_list_price_point_id!r}, " + f"use_default_list_price={_use_default_list_price!r}, " + f"prices={_prices!r}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!r}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'prices={self.prices!s}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!s}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _list_price_point_id=( + self.list_price_point_id + if hasattr(self, "list_price_point_id") + else None + ) + _use_default_list_price=( + self.use_default_list_price + if hasattr(self, "use_default_list_price") + else None + ) + _prices=self.prices + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"tax_included={_tax_included!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"list_price_point_id={_list_price_point_id!s}, " + f"use_default_list_price={_use_default_list_price!s}, " + f"prices={_prices!s}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!s}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_kind.py b/advancedbilling/models/component_kind.py index e2470e13..985fc1aa 100644 --- a/advancedbilling/models/component_kind.py +++ b/advancedbilling/models/component_kind.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ComponentKind(object): - """Implementation of the 'Component Kind' enum. A handle for the component type @@ -20,24 +17,26 @@ class ComponentKind(object): ON_OFF_COMPONENT: The enum member of type str. PREPAID_USAGE_COMPONENT: The enum member of type str. EVENT_BASED_COMPONENT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['metered_component', 'quantity_based_component', 'on_off_component', 'prepaid_usage_component', 'event_based_component'] - METERED_COMPONENT = 'metered_component' - QUANTITY_BASED_COMPONENT = 'quantity_based_component' + _all_values = ["metered_component", "quantity_based_component", + "on_off_component", "prepaid_usage_component", "event_based_component"] + METERED_COMPONENT = "metered_component" - ON_OFF_COMPONENT = 'on_off_component' + QUANTITY_BASED_COMPONENT = "quantity_based_component" - PREPAID_USAGE_COMPONENT = 'prepaid_usage_component' + ON_OFF_COMPONENT = "on_off_component" - EVENT_BASED_COMPONENT = 'event_based_component' + PREPAID_USAGE_COMPONENT = "prepaid_usage_component" + + EVENT_BASED_COMPONENT = "event_based_component" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -47,9 +46,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/component_price.py b/advancedbilling/models/component_price.py index 4933dffa..fedc6c9b 100644 --- a/advancedbilling/models/component_price.py +++ b/advancedbilling/models/component_price.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ComponentPrice(object): - """Implementation of the 'Component Price' model. Attributes: @@ -22,68 +20,68 @@ class ComponentPrice(object): price_point_id (int): The model property of type int. formatted_unit_price (str): The model property of type str. segment_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "component_id": 'component_id', - "starting_quantity": 'starting_quantity', - "ending_quantity": 'ending_quantity', - "unit_price": 'unit_price', - "price_point_id": 'price_point_id', - "formatted_unit_price": 'formatted_unit_price', - "segment_id": 'segment_id' + "id": "id", + "component_id": "component_id", + "starting_quantity": "starting_quantity", + "ending_quantity": "ending_quantity", + "unit_price": "unit_price", + "price_point_id": "price_point_id", + "formatted_unit_price": "formatted_unit_price", + "segment_id": "segment_id", } _optionals = [ - 'id', - 'component_id', - 'starting_quantity', - 'ending_quantity', - 'unit_price', - 'price_point_id', - 'formatted_unit_price', - 'segment_id', + "id", + "component_id", + "starting_quantity", + "ending_quantity", + "unit_price", + "price_point_id", + "formatted_unit_price", + "segment_id", ] _nullables = [ - 'ending_quantity', - 'segment_id', + "ending_quantity", + "segment_id", ] - def __init__(self, - id=APIHelper.SKIP, - component_id=APIHelper.SKIP, - starting_quantity=APIHelper.SKIP, - ending_quantity=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - formatted_unit_price=APIHelper.SKIP, - segment_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentPrice class""" - + def __init__( + self, + id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + starting_quantity=APIHelper.SKIP, + ending_quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + formatted_unit_price=APIHelper.SKIP, + segment_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentPrice instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if starting_quantity is not APIHelper.SKIP: - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity if ending_quantity is not APIHelper.SKIP: - self.ending_quantity = ending_quantity + self.ending_quantity = ending_quantity if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if formatted_unit_price is not APIHelper.SKIP: - self.formatted_unit_price = formatted_unit_price + self.formatted_unit_price = formatted_unit_price if segment_id is not APIHelper.SKIP: - self.segment_id = segment_id + self.segment_id = segment_id # Add additional model properties to the instance if additional_properties is None: @@ -93,7 +91,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -104,21 +102,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - starting_quantity = dictionary.get("starting_quantity") if dictionary.get("starting_quantity") else APIHelper.SKIP - ending_quantity = dictionary.get("ending_quantity") if "ending_quantity" in dictionary.keys() else APIHelper.SKIP - unit_price = dictionary.get("unit_price") if dictionary.get("unit_price") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - formatted_unit_price = dictionary.get("formatted_unit_price") if dictionary.get("formatted_unit_price") else APIHelper.SKIP - segment_id = dictionary.get("segment_id") if "segment_id" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + starting_quantity =\ + dictionary.get("starting_quantity")\ + if dictionary.get("starting_quantity")\ + else APIHelper.SKIP + ending_quantity =\ + dictionary.get("ending_quantity")\ + if "ending_quantity" in dictionary.keys()\ + else APIHelper.SKIP + unit_price =\ + dictionary.get("unit_price")\ + if dictionary.get("unit_price")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + formatted_unit_price =\ + dictionary.get("formatted_unit_price")\ + if dictionary.get("formatted_unit_price")\ + else APIHelper.SKIP + segment_id =\ + dictionary.get("segment_id")\ + if "segment_id" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, component_id, @@ -131,25 +155,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!r}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'formatted_unit_price={(self.formatted_unit_price if hasattr(self, "formatted_unit_price") else None)!r}, ' - f'segment_id={(self.segment_id if hasattr(self, "segment_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _formatted_unit_price=( + self.formatted_unit_price + if hasattr(self, "formatted_unit_price") + else None + ) + _segment_id=( + self.segment_id + if hasattr(self, "segment_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"component_id={_component_id!r}, " + f"starting_quantity={_starting_quantity!r}, " + f"ending_quantity={_ending_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"price_point_id={_price_point_id!r}, " + f"formatted_unit_price={_formatted_unit_price!r}, " + f"segment_id={_segment_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!s}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'formatted_unit_price={(self.formatted_unit_price if hasattr(self, "formatted_unit_price") else None)!s}, ' - f'segment_id={(self.segment_id if hasattr(self, "segment_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _formatted_unit_price=( + self.formatted_unit_price + if hasattr(self, "formatted_unit_price") + else None + ) + _segment_id=( + self.segment_id + if hasattr(self, "segment_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"component_id={_component_id!s}, " + f"starting_quantity={_starting_quantity!s}, " + f"ending_quantity={_ending_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"price_point_id={_price_point_id!s}, " + f"formatted_unit_price={_formatted_unit_price!s}, " + f"segment_id={_segment_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_price_point.py b/advancedbilling/models/component_price_point.py index f042ae36..081ee30c 100644 --- a/advancedbilling/models/component_price_point.py +++ b/advancedbilling/models/component_price_point.py @@ -1,33 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_currency_price import ComponentCurrencyPrice -from advancedbilling.models.component_price import ComponentPrice +from advancedbilling.models.component_currency_price import ( + ComponentCurrencyPrice, +) +from advancedbilling.models.component_price import ( + ComponentPrice, +) class ComponentPricePoint(object): - """Implementation of the 'Component Price Point' model. Attributes: id (int): The model property of type int. - mtype (PricePointType): Price point type. We expose the following - types: 1. **default**: a price point that is marked as a default - price for a certain product. 2. **custom**: a custom price point. - 3. **catalog**: a price point that is **not** marked as a default - price for a certain product and is **not** a custom one. + mtype (PricePointType): Price point type. We expose the following types: 1. + **default**: a price point that is marked as a default price for a + certain product. 2. **custom**: a custom price point. 3. **catalog**: a + price point that is **not** marked as a default price for a certain + product and is **not** a custom one. default (bool): Note: Refer to type attribute instead name (str): The model property of type str. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. component_id (int): The model property of type int. handle (str): The model property of type str. archived_at (datetime): The model property of type datetime. @@ -35,186 +37,193 @@ class ComponentPricePoint(object): updated_at (datetime): The model property of type datetime. prices (List[ComponentPrice]): The model property of type List[ComponentPrice]. - use_site_exchange_rate (bool): Whether to use the site level exchange - rate or define your own prices for each currency if you have - multiple currencies defined on the site. Defaults to true during - creation. - subscription_id (int): (only used for Custom Pricing - ie. when the - price point's type is `custom`) The id of the subscription that - the custom price point is for. + use_site_exchange_rate (bool): Whether to use the site level exchange rate or + define your own prices for each currency if you have multiple currencies + defined on the site. Defaults to true during creation. + subscription_id (int): (only used for Custom Pricing - ie. when the price + point's type is `custom`) The id of the subscription that the custom + price point is for. tax_included (bool): The model property of type bool. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. - currency_prices (List[ComponentCurrencyPrice]): An array of currency - pricing data is available when multiple currencies are defined for - the site. It varies based on the use_site_exchange_rate setting - for the price point. This parameter is present only in the - response of read endpoints, after including the appropriate query - parameter. - overage_prices (List[ComponentPrice]): Applicable only to prepaid - usage components. An array of overage price brackets. - overage_pricing_scheme (PricingScheme): Applicable only to prepaid - usage components. Pricing scheme for overage pricing. - renew_prepaid_allocation (bool): Applicable only to prepaid usage - components. Boolean which controls whether or not the allocated - quantity should be renewed at the beginning of each period. + currency_prices (List[ComponentCurrencyPrice]): An array of currency pricing + data is available when multiple currencies are defined for the site. It + varies based on the use_site_exchange_rate setting for the price point. + This parameter is present only in the response of read endpoints, after + including the appropriate query parameter. The clone endpoint always + returns currency prices if they are present. + overage_prices (List[ComponentPrice]): Applicable only to prepaid usage + components. An array of overage price brackets. + overage_pricing_scheme (PricingScheme): Applicable only to prepaid usage + components. Pricing scheme for overage pricing. + renew_prepaid_allocation (bool): Applicable only to prepaid usage components. + Boolean which controls whether or not the allocated quantity should be + renewed at the beginning of each period. rollover_prepaid_remainder (bool): Applicable only to prepaid usage - components. Boolean which controls whether or not remaining units - should be rolled over to the next period. - expiration_interval (int): Applicable only to prepaid usage components - where rollover_prepaid_remainder is true. The number of - `expiration_interval_unit`s after which rollover amounts should - expire. - expiration_interval_unit (ExpirationIntervalUnit): Applicable only to - prepaid usage components where rollover_prepaid_remainder is true. - A string representing the expiration interval unit for this - component, either month or day. - additional_properties (Dict[str, object]): The additional properties - for the model. + components. Boolean which controls whether or not remaining units should + be rolled over to the next period. + expiration_interval (int): Applicable only to prepaid usage components where + rollover_prepaid_remainder is true. The number of + `expiration_interval_unit`s after which rollover amounts should expire. + expiration_interval_unit (ExpirationIntervalUnit): Applicable only to prepaid + usage components where rollover_prepaid_remainder is true. A string + representing the expiration interval unit for this component, either + month or day. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "mtype": 'type', - "default": 'default', - "name": 'name', - "pricing_scheme": 'pricing_scheme', - "component_id": 'component_id', - "handle": 'handle', - "archived_at": 'archived_at', - "created_at": 'created_at', - "updated_at": 'updated_at', - "prices": 'prices', - "use_site_exchange_rate": 'use_site_exchange_rate', - "subscription_id": 'subscription_id', - "tax_included": 'tax_included', - "interval": 'interval', - "interval_unit": 'interval_unit', - "currency_prices": 'currency_prices', - "overage_prices": 'overage_prices', - "overage_pricing_scheme": 'overage_pricing_scheme', - "renew_prepaid_allocation": 'renew_prepaid_allocation', - "rollover_prepaid_remainder": 'rollover_prepaid_remainder', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit' + "id": "id", + "mtype": "type", + "default": "default", + "name": "name", + "pricing_scheme": "pricing_scheme", + "component_id": "component_id", + "handle": "handle", + "archived_at": "archived_at", + "created_at": "created_at", + "updated_at": "updated_at", + "prices": "prices", + "use_site_exchange_rate": "use_site_exchange_rate", + "subscription_id": "subscription_id", + "tax_included": "tax_included", + "interval": "interval", + "interval_unit": "interval_unit", + "currency_prices": "currency_prices", + "overage_prices": "overage_prices", + "overage_pricing_scheme": "overage_pricing_scheme", + "renew_prepaid_allocation": "renew_prepaid_allocation", + "rollover_prepaid_remainder": "rollover_prepaid_remainder", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", } _optionals = [ - 'id', - 'mtype', - 'default', - 'name', - 'pricing_scheme', - 'component_id', - 'handle', - 'archived_at', - 'created_at', - 'updated_at', - 'prices', - 'use_site_exchange_rate', - 'subscription_id', - 'tax_included', - 'interval', - 'interval_unit', - 'currency_prices', - 'overage_prices', - 'overage_pricing_scheme', - 'renew_prepaid_allocation', - 'rollover_prepaid_remainder', - 'expiration_interval', - 'expiration_interval_unit', + "id", + "mtype", + "default", + "name", + "pricing_scheme", + "component_id", + "handle", + "archived_at", + "created_at", + "updated_at", + "prices", + "use_site_exchange_rate", + "subscription_id", + "tax_included", + "interval", + "interval_unit", + "currency_prices", + "overage_prices", + "overage_pricing_scheme", + "renew_prepaid_allocation", + "rollover_prepaid_remainder", + "expiration_interval", + "expiration_interval_unit", ] _nullables = [ - 'handle', - 'archived_at', - 'interval', - 'interval_unit', - 'expiration_interval', - 'expiration_interval_unit', + "handle", + "archived_at", + "interval", + "interval_unit", + "expiration_interval", + "expiration_interval_unit", ] - def __init__(self, - id=APIHelper.SKIP, - mtype=APIHelper.SKIP, - default=APIHelper.SKIP, - name=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - component_id=APIHelper.SKIP, - handle=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - prices=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - tax_included=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - currency_prices=APIHelper.SKIP, - overage_prices=APIHelper.SKIP, - overage_pricing_scheme=APIHelper.SKIP, - renew_prepaid_allocation=APIHelper.SKIP, - rollover_prepaid_remainder=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentPricePoint class""" - + def __init__( + self, + id=APIHelper.SKIP, + mtype=APIHelper.SKIP, + default=APIHelper.SKIP, + name=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + component_id=APIHelper.SKIP, + handle=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + prices=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + tax_included=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + currency_prices=APIHelper.SKIP, + overage_prices=APIHelper.SKIP, + overage_pricing_scheme=APIHelper.SKIP, + renew_prepaid_allocation=APIHelper.SKIP, + rollover_prepaid_remainder=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentPricePoint instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if mtype is not APIHelper.SKIP: - self.mtype = mtype + self.mtype = mtype if default is not APIHelper.SKIP: - self.default = default + self.default = default if name is not APIHelper.SKIP: - self.name = name + self.name = name if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if archived_at is not APIHelper.SKIP: - self.archived_at = APIHelper.apply_datetime_converter(archived_at, APIHelper.RFC3339DateTime) if archived_at else None + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if tax_included is not APIHelper.SKIP: - self.tax_included = tax_included + self.tax_included = tax_included if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if currency_prices is not APIHelper.SKIP: - self.currency_prices = currency_prices + self.currency_prices = currency_prices if overage_prices is not APIHelper.SKIP: - self.overage_prices = overage_prices + self.overage_prices = overage_prices if overage_pricing_scheme is not APIHelper.SKIP: - self.overage_pricing_scheme = overage_pricing_scheme + self.overage_pricing_scheme = overage_pricing_scheme if renew_prepaid_allocation is not APIHelper.SKIP: - self.renew_prepaid_allocation = renew_prepaid_allocation + self.renew_prepaid_allocation = renew_prepaid_allocation if rollover_prepaid_remainder is not APIHelper.SKIP: - self.rollover_prepaid_remainder = rollover_prepaid_remainder + self.rollover_prepaid_remainder = rollover_prepaid_remainder if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -224,7 +233,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -235,51 +244,120 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP - default = dictionary.get("default") if "default" in dictionary.keys() else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - handle = dictionary.get("handle") if "handle" in dictionary.keys() else APIHelper.SKIP - if 'archived_at' in dictionary.keys(): - archived_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("archived_at")).datetime if dictionary.get("archived_at") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else APIHelper.SKIP + default =\ + dictionary.get("default")\ + if "default" in dictionary.keys()\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if "handle" in dictionary.keys()\ + else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + else: archived_at = APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [ComponentPrice.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + ComponentPrice.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - tax_included = dictionary.get("tax_included") if "tax_included" in dictionary.keys() else APIHelper.SKIP - interval = dictionary.get("interval") if "interval" in dictionary.keys() else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if "interval" in dictionary.keys()\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [ComponentCurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + ComponentCurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] else: currency_prices = APIHelper.SKIP overage_prices = None - if dictionary.get('overage_prices') is not None: - overage_prices = [ComponentPrice.from_dictionary(x) for x in dictionary.get('overage_prices')] + if dictionary.get("overage_prices") is not None: + overage_prices = [ + ComponentPrice.from_dictionary(x) + for x in dictionary.get("overage_prices") + ] else: overage_prices = APIHelper.SKIP - overage_pricing_scheme = dictionary.get("overage_pricing_scheme") if dictionary.get("overage_pricing_scheme") else APIHelper.SKIP - renew_prepaid_allocation = dictionary.get("renew_prepaid_allocation") if "renew_prepaid_allocation" in dictionary.keys() else APIHelper.SKIP - rollover_prepaid_remainder = dictionary.get("rollover_prepaid_remainder") if "rollover_prepaid_remainder" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if "expiration_interval" in dictionary.keys() else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP + overage_pricing_scheme =\ + dictionary.get("overage_pricing_scheme")\ + if dictionary.get("overage_pricing_scheme")\ + else APIHelper.SKIP + renew_prepaid_allocation =\ + dictionary.get("renew_prepaid_allocation")\ + if "renew_prepaid_allocation" in dictionary.keys()\ + else APIHelper.SKIP + rollover_prepaid_remainder =\ + dictionary.get("rollover_prepaid_remainder")\ + if "rollover_prepaid_remainder" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if "expiration_interval" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, mtype, @@ -307,55 +385,295 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' - f'default={(self.default if hasattr(self, "default") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!r}, ' - f'overage_prices={(self.overage_prices if hasattr(self, "overage_prices") else None)!r}, ' - f'overage_pricing_scheme={(self.overage_pricing_scheme if hasattr(self, "overage_pricing_scheme") else None)!r}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!r}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _default=( + self.default + if hasattr(self, "default") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _overage_prices=( + self.overage_prices + if hasattr(self, "overage_prices") + else None + ) + _overage_pricing_scheme=( + self.overage_pricing_scheme + if hasattr(self, "overage_pricing_scheme") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"mtype={_mtype!r}, " + f"default={_default!r}, " + f"name={_name!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"component_id={_component_id!r}, " + f"handle={_handle!r}, " + f"archived_at={_archived_at!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"prices={_prices!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"subscription_id={_subscription_id!r}, " + f"tax_included={_tax_included!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"currency_prices={_currency_prices!r}, " + f"overage_prices={_overage_prices!r}, " + f"overage_pricing_scheme={_overage_pricing_scheme!r}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!r}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' - f'default={(self.default if hasattr(self, "default") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!s}, ' - f'overage_prices={(self.overage_prices if hasattr(self, "overage_prices") else None)!s}, ' - f'overage_pricing_scheme={(self.overage_pricing_scheme if hasattr(self, "overage_pricing_scheme") else None)!s}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!s}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _default=( + self.default + if hasattr(self, "default") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _overage_prices=( + self.overage_prices + if hasattr(self, "overage_prices") + else None + ) + _overage_pricing_scheme=( + self.overage_pricing_scheme + if hasattr(self, "overage_pricing_scheme") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"mtype={_mtype!s}, " + f"default={_default!s}, " + f"name={_name!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"component_id={_component_id!s}, " + f"handle={_handle!s}, " + f"archived_at={_archived_at!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"prices={_prices!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"subscription_id={_subscription_id!s}, " + f"tax_included={_tax_included!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"currency_prices={_currency_prices!s}, " + f"overage_prices={_overage_prices!s}, " + f"overage_pricing_scheme={_overage_pricing_scheme!s}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!s}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_price_point_assignment.py b/advancedbilling/models/component_price_point_assignment.py index c6b3e275..3a7da838 100644 --- a/advancedbilling/models/component_price_point_assignment.py +++ b/advancedbilling/models/component_price_point_assignment.py @@ -1,49 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ComponentPricePointAssignment(object): - """Implementation of the 'Component Price Point Assignment' model. Attributes: component_id (int): The model property of type int. - price_point (str | int | None): The model property of type str | int | - None. - additional_properties (Dict[str, object]): The additional properties - for the model. + price_point (str | int | None): The model property of type str | int | None. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "price_point": 'price_point' + "component_id": "component_id", + "price_point": "price_point", } _optionals = [ - 'component_id', - 'price_point', + "component_id", + "price_point", ] - def __init__(self, - component_id=APIHelper.SKIP, - price_point=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentPricePointAssignment class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + price_point=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentPricePointAssignment instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point is not APIHelper.SKIP: - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -53,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -64,29 +61,72 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - price_point = APIHelper.deserialize_union_type(UnionTypeLookUp.get('ComponentPricePointAssignmentPricePoint'), dictionary.get('price_point'), False) if dictionary.get('price_point') is not None else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + price_point = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("ComponentPricePointAssignmentPricePoint"), + dictionary.get("price_point"), + False)\ + if dictionary.get("price_point") is not None\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, price_point, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_price_point_currency_overage_response.py b/advancedbilling/models/component_price_point_currency_overage_response.py new file mode 100644 index 00000000..4d3b8090 --- /dev/null +++ b/advancedbilling/models/component_price_point_currency_overage_response.py @@ -0,0 +1,93 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.models.currency_overage_prices import ( + CurrencyOveragePrices, +) + + +class ComponentPricePointCurrencyOverageResponse(object): + """Implementation of the 'Component Price Point Currency Overage Response' model. + + Attributes: + price_point (CurrencyOveragePrices): Extends a component price point with + currency overage prices. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "price_point": "price_point", + } + + def __init__( + self, + price_point=None, + additional_properties=None): + """Initialize a ComponentPricePointCurrencyOverageResponse instance.""" + # Initialize members of the class + self.price_point = price_point + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + price_point =\ + CurrencyOveragePrices.from_dictionary( + dictionary.get("price_point"))\ + if dictionary.get("price_point") else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(price_point, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_price_point_error_item.py b/advancedbilling/models/component_price_point_error_item.py index eca48a87..22c24748 100644 --- a/advancedbilling/models/component_price_point_error_item.py +++ b/advancedbilling/models/component_price_point_error_item.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ComponentPricePointErrorItem(object): - """Implementation of the 'Component PricePoint Error Item' model. Attributes: component_id (int): The model property of type int. message (str): The model property of type str. price_point (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "message": 'message', - "price_point": 'price_point' + "component_id": "component_id", + "message": "message", + "price_point": "price_point", } _optionals = [ - 'component_id', - 'message', - 'price_point', + "component_id", + "message", + "price_point", ] - def __init__(self, - component_id=APIHelper.SKIP, - message=APIHelper.SKIP, - price_point=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentPricePointErrorItem class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + message=APIHelper.SKIP, + price_point=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentPricePointErrorItem instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if message is not APIHelper.SKIP: - self.message = message + self.message = message if price_point is not APIHelper.SKIP: - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - message = dictionary.get("message") if dictionary.get("message") else APIHelper.SKIP - price_point = dictionary.get("price_point") if dictionary.get("price_point") else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + message =\ + dictionary.get("message")\ + if dictionary.get("message")\ + else APIHelper.SKIP + price_point =\ + dictionary.get("price_point")\ + if dictionary.get("price_point")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, message, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'message={(self.message if hasattr(self, "message") else None)!r}, ' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _message=( + self.message + if hasattr(self, "message") + else None + ) + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"message={_message!r}, " + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'message={(self.message if hasattr(self, "message") else None)!s}, ' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _message=( + self.message + if hasattr(self, "message") + else None + ) + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"message={_message!s}, " + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_price_point_item.py b/advancedbilling/models/component_price_point_item.py index 416294ce..bc2654a4 100644 --- a/advancedbilling/models/component_price_point_item.py +++ b/advancedbilling/models/component_price_point_item.py @@ -1,85 +1,83 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.price import Price class ComponentPricePointItem(object): - """Implementation of the 'Component Price Point Item' model. Attributes: name (str): The model property of type str. handle (str): The model property of type str. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. prices (List[Price]): The model property of type List[Price]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "handle": 'handle', - "pricing_scheme": 'pricing_scheme', - "interval": 'interval', - "interval_unit": 'interval_unit', - "prices": 'prices' + "name": "name", + "handle": "handle", + "pricing_scheme": "pricing_scheme", + "interval": "interval", + "interval_unit": "interval_unit", + "prices": "prices", } _optionals = [ - 'name', - 'handle', - 'pricing_scheme', - 'interval', - 'interval_unit', - 'prices', + "name", + "handle", + "pricing_scheme", + "interval", + "interval_unit", + "prices", ] _nullables = [ - 'interval_unit', + "interval_unit", ] - def __init__(self, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentPricePointItem class""" - + def __init__( + self, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentPricePointItem instance.""" # Initialize members of the class if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices # Add additional model properties to the instance if additional_properties is None: @@ -89,7 +87,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -100,23 +98,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, handle, @@ -128,7 +146,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -139,7 +157,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -149,21 +166,91 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_price_point_response.py b/advancedbilling/models/component_price_point_response.py index a2360da1..5a276d8e 100644 --- a/advancedbilling/models/component_price_point_response.py +++ b/advancedbilling/models/component_price_point_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.component_price_point import ComponentPricePoint +# ruff: noqa: E501 +from advancedbilling.models.component_price_point import ( + ComponentPricePoint, +) -class ComponentPricePointResponse(object): +class ComponentPricePointResponse(object): """Implementation of the 'Component Price Point Response' model. Attributes: price_point (ComponentPricePoint): The model property of type ComponentPricePoint. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point": 'price_point' + "price_point": "price_point", } - def __init__(self, - price_point=None, - additional_properties=None): - """Constructor for the ComponentPricePointResponse class""" - + def __init__( + self, + price_point=None, + additional_properties=None): + """Initialize a ComponentPricePointResponse instance.""" # Initialize members of the class - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point = ComponentPricePoint.from_dictionary(dictionary.get('price_point')) if dictionary.get('price_point') else None + price_point =\ + ComponentPricePoint.from_dictionary( + dictionary.get("price_point"))\ + if dictionary.get("price_point") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_price_points_response.py b/advancedbilling/models/component_price_points_response.py index 19f7b9ce..e5e297ae 100644 --- a/advancedbilling/models/component_price_points_response.py +++ b/advancedbilling/models/component_price_points_response.py @@ -1,52 +1,53 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_price_point import ComponentPricePoint -from advancedbilling.models.list_public_keys_meta import ListPublicKeysMeta +from advancedbilling.models.component_price_point import ( + ComponentPricePoint, +) +from advancedbilling.models.list_public_keys_meta import ( + ListPublicKeysMeta, +) class ComponentPricePointsResponse(object): - """Implementation of the 'Component Price Points response' model. Attributes: price_points (List[ComponentPricePoint]): The model property of type List[ComponentPricePoint]. - meta (ListPublicKeysMeta): The model property of type - ListPublicKeysMeta. - additional_properties (Dict[str, object]): The additional properties - for the model. + meta (ListPublicKeysMeta): The model property of type ListPublicKeysMeta. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_points": 'price_points', - "meta": 'meta' + "price_points": "price_points", + "meta": "meta", } _optionals = [ - 'price_points', - 'meta', + "price_points", + "meta", ] - def __init__(self, - price_points=APIHelper.SKIP, - meta=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ComponentPricePointsResponse class""" - + def __init__( + self, + price_points=APIHelper.SKIP, + meta=APIHelper.SKIP, + additional_properties=None): + """Initialize a ComponentPricePointsResponse instance.""" # Initialize members of the class if price_points is not APIHelper.SKIP: - self.price_points = price_points + self.price_points = price_points if meta is not APIHelper.SKIP: - self.meta = meta + self.meta = meta # Add additional model properties to the instance if additional_properties is None: @@ -56,7 +57,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -67,32 +68,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary price_points = None - if dictionary.get('price_points') is not None: - price_points = [ComponentPricePoint.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ComponentPricePoint.from_dictionary(x) + for x in dictionary.get("price_points") + ] else: price_points = APIHelper.SKIP - meta = ListPublicKeysMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP + meta =\ + ListPublicKeysMeta.from_dictionary( + dictionary.get("meta"))\ + if "meta" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_points, meta, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!r}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!r}, " + f"meta={_meta!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!s}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!s}, " + f"meta={_meta!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/component_response.py b/advancedbilling/models/component_response.py index 64f093fe..0e3a3bd8 100644 --- a/advancedbilling/models/component_response.py +++ b/advancedbilling/models/component_response.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.component import Component +# ruff: noqa: E501 +from advancedbilling.models.component import ( + Component, +) -class ComponentResponse(object): +class ComponentResponse(object): """Implementation of the 'Component Response' model. Attributes: component (Component): The model property of type Component. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component": 'component' + "component": "component", } - def __init__(self, - component=None, - additional_properties=None): - """Constructor for the ComponentResponse class""" - + def __init__( + self, + component=None, + additional_properties=None): + """Initialize a ComponentResponse instance.""" # Initialize members of the class - self.component = component + self.component = component # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component = Component.from_dictionary(dictionary.get('component')) if dictionary.get('component') else None + component =\ + Component.from_dictionary( + dictionary.get("component"))\ + if dictionary.get("component") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component={self.component!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component=self.component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component={_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component={self.component!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component=self.component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component={_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/compounding_strategy.py b/advancedbilling/models/compounding_strategy.py index 9d9955b0..6f11417e 100644 --- a/advancedbilling/models/compounding_strategy.py +++ b/advancedbilling/models/compounding_strategy.py @@ -1,38 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CompoundingStrategy(object): - """Implementation of the 'Compounding Strategy' enum. - Applicable only to stackable coupons. For `compound`, Percentage-based - discounts will be calculated against the remaining price, after prior - discounts have been calculated. For `full-price`, Percentage-based - discounts will always be calculated against the original item price, - before other discounts are applied. + Applicable only to stackable coupons. For `compound`, Percentage-based discounts + will be calculated against the remaining price, after prior discounts have been + calculated. For `full-price`, Percentage-based discounts will always be + calculated against the original item price, before other discounts are applied. Attributes: COMPOUND: The enum member of type str. FULLPRICE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['compound', 'full-price'] - COMPOUND = 'compound' - FULLPRICE = 'full-price' + _all_values = ["compound", "full-price"] + COMPOUND = "compound" + + FULLPRICE = "full-price" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -42,9 +39,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/consolidated_invoice.py b/advancedbilling/models/consolidated_invoice.py index e39f5494..5f2f3851 100644 --- a/advancedbilling/models/consolidated_invoice.py +++ b/advancedbilling/models/consolidated_invoice.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.invoice import Invoice class ConsolidatedInvoice(object): - """Implementation of the 'Consolidated Invoice' model. Attributes: invoices (List[Invoice]): The model property of type List[Invoice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "invoices": 'invoices' + "invoices": "invoices", } _optionals = [ - 'invoices', + "invoices", ] - def __init__(self, - invoices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ConsolidatedInvoice class""" - + def __init__( + self, + invoices=APIHelper.SKIP, + additional_properties=None): + """Initialize a ConsolidatedInvoice instance.""" # Initialize members of the class if invoices is not APIHelper.SKIP: - self.invoices = invoices + self.invoices = invoices # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,28 +56,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary invoices = None - if dictionary.get('invoices') is not None: - invoices = [Invoice.from_dictionary(x) for x in dictionary.get('invoices')] + if dictionary.get("invoices") is not None: + invoices = [ + Invoice.from_dictionary(x) + for x in dictionary.get("invoices") + ] else: invoices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(invoices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoices={(self.invoices if hasattr(self, "invoices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _invoices=( + self.invoices + if hasattr(self, "invoices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoices={_invoices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoices={(self.invoices if hasattr(self, "invoices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _invoices=( + self.invoices + if hasattr(self, "invoices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoices={_invoices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/contract.py b/advancedbilling/models/contract.py new file mode 100644 index 00000000..8adaae98 --- /dev/null +++ b/advancedbilling/models/contract.py @@ -0,0 +1,182 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.register import ( + Register, +) + + +class Contract(object): + """Implementation of the 'Contract' model. + + Contract linked to the scheduled renewal configuration. + + Attributes: + id (int): The model property of type int. + maxio_id (str): The model property of type str. + number (str): The model property of type str. + register (Register): The model property of type Register. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": "id", + "maxio_id": "maxio_id", + "number": "number", + "register": "register", + } + + _optionals = [ + "id", + "maxio_id", + "number", + "register", + ] + + _nullables = [ + "number", + ] + + def __init__( + self, + id=APIHelper.SKIP, + maxio_id=APIHelper.SKIP, + number=APIHelper.SKIP, + register=APIHelper.SKIP, + additional_properties=None): + """Initialize a Contract instance.""" + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if maxio_id is not APIHelper.SKIP: + self.maxio_id = maxio_id + if number is not APIHelper.SKIP: + self.number = number + if register is not APIHelper.SKIP: + self.register = register + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + maxio_id =\ + dictionary.get("maxio_id")\ + if dictionary.get("maxio_id")\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if "number" in dictionary.keys()\ + else APIHelper.SKIP + register =\ + Register.from_dictionary( + dictionary.get("register"))\ + if "register" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(id, + maxio_id, + number, + register, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _maxio_id=( + self.maxio_id + if hasattr(self, "maxio_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _register=( + self.register + if hasattr(self, "register") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"maxio_id={_maxio_id!r}, " + f"number={_number!r}, " + f"register={_register!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _maxio_id=( + self.maxio_id + if hasattr(self, "maxio_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _register=( + self.register + if hasattr(self, "register") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"maxio_id={_maxio_id!s}, " + f"number={_number!s}, " + f"register={_register!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/count_response.py b/advancedbilling/models/count_response.py index 217dac99..3f839a2c 100644 --- a/advancedbilling/models/count_response.py +++ b/advancedbilling/models/count_response.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CountResponse(object): - """Implementation of the 'Count Response' model. Attributes: count (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "count": 'count' + "count": "count", } _optionals = [ - 'count', + "count", ] - def __init__(self, - count=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CountResponse class""" - + def __init__( + self, + count=APIHelper.SKIP, + additional_properties=None): + """Initialize a CountResponse instance.""" # Initialize members of the class if count is not APIHelper.SKIP: - self.count = count + self.count = count # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - count = dictionary.get("count") if dictionary.get("count") else APIHelper.SKIP + count =\ + dictionary.get("count")\ + if dictionary.get("count")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(count, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'count={(self.count if hasattr(self, "count") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _count=( + self.count + if hasattr(self, "count") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"count={_count!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'count={(self.count if hasattr(self, "count") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _count=( + self.count + if hasattr(self, "count") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"count={_count!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon.py b/advancedbilling/models/coupon.py index 67b83785..b313b573 100644 --- a/advancedbilling/models/coupon.py +++ b/advancedbilling/models/coupon.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.coupon_currency import CouponCurrency -from advancedbilling.models.coupon_restriction import CouponRestriction +from advancedbilling.models.coupon_currency import ( + CouponCurrency, +) +from advancedbilling.models.coupon_restriction import ( + CouponRestriction, +) class Coupon(object): - """Implementation of the 'Coupon' model. Attributes: @@ -25,9 +27,9 @@ class Coupon(object): product_family_id (int): The model property of type int. product_family_name (str): The model property of type str. start_date (datetime): The model property of type datetime. - end_date (datetime): After the given time, this coupon code will be - invalid for new signups. Recurring discounts started before this - date will continue to recur even after this date. + end_date (datetime): After the given time, this coupon code will be invalid + for new signups. Recurring discounts started before this date will + continue to recur even after this date. percentage (str): The model property of type str. recurring (bool): The model property of type bool. recurring_scheme (RecurringScheme): The model property of type @@ -40,214 +42,226 @@ class Coupon(object): (credits will carry forward to next billing). archived_at (datetime): The model property of type datetime. conversion_limit (str): The model property of type str. - stackable (bool): A stackable coupon can be combined with other - coupons on a Subscription. - compounding_strategy (CompoundingStrategy): Applicable only to - stackable coupons. For `compound`, Percentage-based discounts will - be calculated against the remaining price, after prior discounts - have been calculated. For `full-price`, Percentage-based discounts - will always be calculated against the original item price, before - other discounts are applied. + stackable (bool): A stackable coupon can be combined with other coupons on a + Subscription. + compounding_strategy (CompoundingStrategy): Applicable only to stackable + coupons. For `compound`, Percentage-based discounts will be calculated + against the remaining price, after prior discounts have been calculated. + For `full-price`, Percentage-based discounts will always be calculated + against the original item price, before other discounts are applied. use_site_exchange_rate (bool): The model property of type bool. created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. discount_type (DiscountType): The model property of type DiscountType. exclude_mid_period_allocations (bool): The model property of type bool. - apply_on_cancel_at_end_of_period (bool): The model property of type - bool. - apply_on_subscription_expiration (bool): The model property of type - bool. - coupon_restrictions (List[CouponRestriction]): The model property of - type List[CouponRestriction]. - currency_prices (List[CouponCurrency]): Returned in read, find, and - list endpoints if the query parameter is provided. - additional_properties (Dict[str, object]): The additional properties - for the model. + apply_on_cancel_at_end_of_period (bool): The model property of type bool. + apply_on_subscription_expiration (bool): The model property of type bool. + coupon_restrictions (List[CouponRestriction]): The model property of type + List[CouponRestriction]. + currency_prices (List[CouponCurrency]): Returned in read, find, and list + endpoints if the query parameter is provided. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "code": 'code', - "description": 'description', - "amount": 'amount', - "amount_in_cents": 'amount_in_cents', - "product_family_id": 'product_family_id', - "product_family_name": 'product_family_name', - "start_date": 'start_date', - "end_date": 'end_date', - "percentage": 'percentage', - "recurring": 'recurring', - "recurring_scheme": 'recurring_scheme', - "duration_period_count": 'duration_period_count', - "duration_interval": 'duration_interval', - "duration_interval_unit": 'duration_interval_unit', - "duration_interval_span": 'duration_interval_span', - "allow_negative_balance": 'allow_negative_balance', - "archived_at": 'archived_at', - "conversion_limit": 'conversion_limit', - "stackable": 'stackable', - "compounding_strategy": 'compounding_strategy', - "use_site_exchange_rate": 'use_site_exchange_rate', - "created_at": 'created_at', - "updated_at": 'updated_at', - "discount_type": 'discount_type', - "exclude_mid_period_allocations": 'exclude_mid_period_allocations', - "apply_on_cancel_at_end_of_period": 'apply_on_cancel_at_end_of_period', - "apply_on_subscription_expiration": 'apply_on_subscription_expiration', - "coupon_restrictions": 'coupon_restrictions', - "currency_prices": 'currency_prices' + "id": "id", + "name": "name", + "code": "code", + "description": "description", + "amount": "amount", + "amount_in_cents": "amount_in_cents", + "product_family_id": "product_family_id", + "product_family_name": "product_family_name", + "start_date": "start_date", + "end_date": "end_date", + "percentage": "percentage", + "recurring": "recurring", + "recurring_scheme": "recurring_scheme", + "duration_period_count": "duration_period_count", + "duration_interval": "duration_interval", + "duration_interval_unit": "duration_interval_unit", + "duration_interval_span": "duration_interval_span", + "allow_negative_balance": "allow_negative_balance", + "archived_at": "archived_at", + "conversion_limit": "conversion_limit", + "stackable": "stackable", + "compounding_strategy": "compounding_strategy", + "use_site_exchange_rate": "use_site_exchange_rate", + "created_at": "created_at", + "updated_at": "updated_at", + "discount_type": "discount_type", + "exclude_mid_period_allocations": "exclude_mid_period_allocations", + "apply_on_cancel_at_end_of_period": "apply_on_cancel_at_end_of_period", + "apply_on_subscription_expiration": "apply_on_subscription_expiration", + "coupon_restrictions": "coupon_restrictions", + "currency_prices": "currency_prices", } _optionals = [ - 'id', - 'name', - 'code', - 'description', - 'amount', - 'amount_in_cents', - 'product_family_id', - 'product_family_name', - 'start_date', - 'end_date', - 'percentage', - 'recurring', - 'recurring_scheme', - 'duration_period_count', - 'duration_interval', - 'duration_interval_unit', - 'duration_interval_span', - 'allow_negative_balance', - 'archived_at', - 'conversion_limit', - 'stackable', - 'compounding_strategy', - 'use_site_exchange_rate', - 'created_at', - 'updated_at', - 'discount_type', - 'exclude_mid_period_allocations', - 'apply_on_cancel_at_end_of_period', - 'apply_on_subscription_expiration', - 'coupon_restrictions', - 'currency_prices', + "id", + "name", + "code", + "description", + "amount", + "amount_in_cents", + "product_family_id", + "product_family_name", + "start_date", + "end_date", + "percentage", + "recurring", + "recurring_scheme", + "duration_period_count", + "duration_interval", + "duration_interval_unit", + "duration_interval_span", + "allow_negative_balance", + "archived_at", + "conversion_limit", + "stackable", + "compounding_strategy", + "use_site_exchange_rate", + "created_at", + "updated_at", + "discount_type", + "exclude_mid_period_allocations", + "apply_on_cancel_at_end_of_period", + "apply_on_subscription_expiration", + "coupon_restrictions", + "currency_prices", ] _nullables = [ - 'amount', - 'amount_in_cents', - 'product_family_name', - 'end_date', - 'percentage', - 'duration_period_count', - 'duration_interval', - 'duration_interval_unit', - 'duration_interval_span', - 'archived_at', - 'conversion_limit', - 'compounding_strategy', + "amount", + "amount_in_cents", + "product_family_name", + "end_date", + "percentage", + "duration_period_count", + "duration_interval", + "duration_interval_unit", + "duration_interval_span", + "archived_at", + "conversion_limit", + "compounding_strategy", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - code=APIHelper.SKIP, - description=APIHelper.SKIP, - amount=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - product_family_id=APIHelper.SKIP, - product_family_name=APIHelper.SKIP, - start_date=APIHelper.SKIP, - end_date=APIHelper.SKIP, - percentage=APIHelper.SKIP, - recurring=APIHelper.SKIP, - recurring_scheme=APIHelper.SKIP, - duration_period_count=APIHelper.SKIP, - duration_interval=APIHelper.SKIP, - duration_interval_unit=APIHelper.SKIP, - duration_interval_span=APIHelper.SKIP, - allow_negative_balance=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - conversion_limit=APIHelper.SKIP, - stackable=APIHelper.SKIP, - compounding_strategy=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - discount_type=APIHelper.SKIP, - exclude_mid_period_allocations=APIHelper.SKIP, - apply_on_cancel_at_end_of_period=APIHelper.SKIP, - apply_on_subscription_expiration=APIHelper.SKIP, - coupon_restrictions=APIHelper.SKIP, - currency_prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Coupon class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + code=APIHelper.SKIP, + description=APIHelper.SKIP, + amount=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + product_family_id=APIHelper.SKIP, + product_family_name=APIHelper.SKIP, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + percentage=APIHelper.SKIP, + recurring=APIHelper.SKIP, + recurring_scheme=APIHelper.SKIP, + duration_period_count=APIHelper.SKIP, + duration_interval=APIHelper.SKIP, + duration_interval_unit=APIHelper.SKIP, + duration_interval_span=APIHelper.SKIP, + allow_negative_balance=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + conversion_limit=APIHelper.SKIP, + stackable=APIHelper.SKIP, + compounding_strategy=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + discount_type=APIHelper.SKIP, + exclude_mid_period_allocations=APIHelper.SKIP, + apply_on_cancel_at_end_of_period=APIHelper.SKIP, + apply_on_subscription_expiration=APIHelper.SKIP, + coupon_restrictions=APIHelper.SKIP, + currency_prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a Coupon instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if code is not APIHelper.SKIP: - self.code = code + self.code = code if description is not APIHelper.SKIP: - self.description = description + self.description = description if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if product_family_id is not APIHelper.SKIP: - self.product_family_id = product_family_id + self.product_family_id = product_family_id if product_family_name is not APIHelper.SKIP: - self.product_family_name = product_family_name + self.product_family_name = product_family_name if start_date is not APIHelper.SKIP: - self.start_date = APIHelper.apply_datetime_converter(start_date, APIHelper.RFC3339DateTime) if start_date else None + self.start_date =\ + APIHelper.apply_datetime_converter( + start_date, APIHelper.RFC3339DateTime)\ + if start_date else None if end_date is not APIHelper.SKIP: - self.end_date = APIHelper.apply_datetime_converter(end_date, APIHelper.RFC3339DateTime) if end_date else None + self.end_date =\ + APIHelper.apply_datetime_converter( + end_date, APIHelper.RFC3339DateTime)\ + if end_date else None if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring if recurring_scheme is not APIHelper.SKIP: - self.recurring_scheme = recurring_scheme + self.recurring_scheme = recurring_scheme if duration_period_count is not APIHelper.SKIP: - self.duration_period_count = duration_period_count + self.duration_period_count = duration_period_count if duration_interval is not APIHelper.SKIP: - self.duration_interval = duration_interval + self.duration_interval = duration_interval if duration_interval_unit is not APIHelper.SKIP: - self.duration_interval_unit = duration_interval_unit + self.duration_interval_unit = duration_interval_unit if duration_interval_span is not APIHelper.SKIP: - self.duration_interval_span = duration_interval_span + self.duration_interval_span = duration_interval_span if allow_negative_balance is not APIHelper.SKIP: - self.allow_negative_balance = allow_negative_balance + self.allow_negative_balance = allow_negative_balance if archived_at is not APIHelper.SKIP: - self.archived_at = APIHelper.apply_datetime_converter(archived_at, APIHelper.RFC3339DateTime) if archived_at else None + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None if conversion_limit is not APIHelper.SKIP: - self.conversion_limit = conversion_limit + self.conversion_limit = conversion_limit if stackable is not APIHelper.SKIP: - self.stackable = stackable + self.stackable = stackable if compounding_strategy is not APIHelper.SKIP: - self.compounding_strategy = compounding_strategy + self.compounding_strategy = compounding_strategy if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if discount_type is not APIHelper.SKIP: - self.discount_type = discount_type + self.discount_type = discount_type if exclude_mid_period_allocations is not APIHelper.SKIP: - self.exclude_mid_period_allocations = exclude_mid_period_allocations + self.exclude_mid_period_allocations = exclude_mid_period_allocations if apply_on_cancel_at_end_of_period is not APIHelper.SKIP: - self.apply_on_cancel_at_end_of_period = apply_on_cancel_at_end_of_period + self.apply_on_cancel_at_end_of_period = apply_on_cancel_at_end_of_period if apply_on_subscription_expiration is not APIHelper.SKIP: - self.apply_on_subscription_expiration = apply_on_subscription_expiration + self.apply_on_subscription_expiration = apply_on_subscription_expiration if coupon_restrictions is not APIHelper.SKIP: - self.coupon_restrictions = coupon_restrictions + self.coupon_restrictions = coupon_restrictions if currency_prices is not APIHelper.SKIP: - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -257,7 +271,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -268,58 +282,150 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - amount = dictionary.get("amount") if "amount" in dictionary.keys() else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if "amount_in_cents" in dictionary.keys() else APIHelper.SKIP - product_family_id = dictionary.get("product_family_id") if dictionary.get("product_family_id") else APIHelper.SKIP - product_family_name = dictionary.get("product_family_name") if "product_family_name" in dictionary.keys() else APIHelper.SKIP - start_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("start_date")).datetime if dictionary.get("start_date") else APIHelper.SKIP - if 'end_date' in dictionary.keys(): - end_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_date")).datetime if dictionary.get("end_date") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if "amount" in dictionary.keys()\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if "amount_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + product_family_id =\ + dictionary.get("product_family_id")\ + if dictionary.get("product_family_id")\ + else APIHelper.SKIP + product_family_name =\ + dictionary.get("product_family_name")\ + if "product_family_name" in dictionary.keys()\ + else APIHelper.SKIP + start_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("start_date")).datetime\ + if dictionary.get("start_date") else APIHelper.SKIP + if "end_date" in dictionary.keys(): + end_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("end_date")).datetime\ + if dictionary.get("end_date") else None + else: end_date = APIHelper.SKIP - percentage = dictionary.get("percentage") if "percentage" in dictionary.keys() else APIHelper.SKIP - recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP - recurring_scheme = dictionary.get("recurring_scheme") if dictionary.get("recurring_scheme") else APIHelper.SKIP - duration_period_count = dictionary.get("duration_period_count") if "duration_period_count" in dictionary.keys() else APIHelper.SKIP - duration_interval = dictionary.get("duration_interval") if "duration_interval" in dictionary.keys() else APIHelper.SKIP - duration_interval_unit = dictionary.get("duration_interval_unit") if "duration_interval_unit" in dictionary.keys() else APIHelper.SKIP - duration_interval_span = dictionary.get("duration_interval_span") if "duration_interval_span" in dictionary.keys() else APIHelper.SKIP - allow_negative_balance = dictionary.get("allow_negative_balance") if "allow_negative_balance" in dictionary.keys() else APIHelper.SKIP - if 'archived_at' in dictionary.keys(): - archived_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("archived_at")).datetime if dictionary.get("archived_at") else None + percentage =\ + dictionary.get("percentage")\ + if "percentage" in dictionary.keys()\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if "recurring" in dictionary.keys()\ + else APIHelper.SKIP + recurring_scheme =\ + dictionary.get("recurring_scheme")\ + if dictionary.get("recurring_scheme")\ + else APIHelper.SKIP + duration_period_count =\ + dictionary.get("duration_period_count")\ + if "duration_period_count" in dictionary.keys()\ + else APIHelper.SKIP + duration_interval =\ + dictionary.get("duration_interval")\ + if "duration_interval" in dictionary.keys()\ + else APIHelper.SKIP + duration_interval_unit =\ + dictionary.get("duration_interval_unit")\ + if "duration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + duration_interval_span =\ + dictionary.get("duration_interval_span")\ + if "duration_interval_span" in dictionary.keys()\ + else APIHelper.SKIP + allow_negative_balance =\ + dictionary.get("allow_negative_balance")\ + if "allow_negative_balance" in dictionary.keys()\ + else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + else: archived_at = APIHelper.SKIP - conversion_limit = dictionary.get("conversion_limit") if "conversion_limit" in dictionary.keys() else APIHelper.SKIP - stackable = dictionary.get("stackable") if "stackable" in dictionary.keys() else APIHelper.SKIP - compounding_strategy = dictionary.get("compounding_strategy") if "compounding_strategy" in dictionary.keys() else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - discount_type = dictionary.get("discount_type") if dictionary.get("discount_type") else APIHelper.SKIP - exclude_mid_period_allocations = dictionary.get("exclude_mid_period_allocations") if "exclude_mid_period_allocations" in dictionary.keys() else APIHelper.SKIP - apply_on_cancel_at_end_of_period = dictionary.get("apply_on_cancel_at_end_of_period") if "apply_on_cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP - apply_on_subscription_expiration = dictionary.get("apply_on_subscription_expiration") if "apply_on_subscription_expiration" in dictionary.keys() else APIHelper.SKIP + conversion_limit =\ + dictionary.get("conversion_limit")\ + if "conversion_limit" in dictionary.keys()\ + else APIHelper.SKIP + stackable =\ + dictionary.get("stackable")\ + if "stackable" in dictionary.keys()\ + else APIHelper.SKIP + compounding_strategy =\ + dictionary.get("compounding_strategy")\ + if "compounding_strategy" in dictionary.keys()\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + discount_type =\ + dictionary.get("discount_type")\ + if dictionary.get("discount_type")\ + else APIHelper.SKIP + exclude_mid_period_allocations =\ + dictionary.get("exclude_mid_period_allocations")\ + if "exclude_mid_period_allocations" in dictionary.keys()\ + else APIHelper.SKIP + apply_on_cancel_at_end_of_period =\ + dictionary.get("apply_on_cancel_at_end_of_period")\ + if "apply_on_cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP + apply_on_subscription_expiration =\ + dictionary.get("apply_on_subscription_expiration")\ + if "apply_on_subscription_expiration" in dictionary.keys()\ + else APIHelper.SKIP coupon_restrictions = None - if dictionary.get('coupon_restrictions') is not None: - coupon_restrictions = [CouponRestriction.from_dictionary(x) for x in dictionary.get('coupon_restrictions')] + if dictionary.get("coupon_restrictions") is not None: + coupon_restrictions = [ + CouponRestriction.from_dictionary(x) + for x in dictionary.get("coupon_restrictions") + ] else: coupon_restrictions = APIHelper.SKIP currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [CouponCurrency.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + CouponCurrency.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] else: currency_prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -355,71 +461,391 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!r}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!r}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'recurring_scheme={(self.recurring_scheme if hasattr(self, "recurring_scheme") else None)!r}, ' - f'duration_period_count={(self.duration_period_count if hasattr(self, "duration_period_count") else None)!r}, ' - f'duration_interval={(self.duration_interval if hasattr(self, "duration_interval") else None)!r}, ' - f'duration_interval_unit={(self.duration_interval_unit if hasattr(self, "duration_interval_unit") else None)!r}, ' - f'duration_interval_span={(self.duration_interval_span if hasattr(self, "duration_interval_span") else None)!r}, ' - f'allow_negative_balance={(self.allow_negative_balance if hasattr(self, "allow_negative_balance") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'conversion_limit={(self.conversion_limit if hasattr(self, "conversion_limit") else None)!r}, ' - f'stackable={(self.stackable if hasattr(self, "stackable") else None)!r}, ' - f'compounding_strategy={(self.compounding_strategy if hasattr(self, "compounding_strategy") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'discount_type={(self.discount_type if hasattr(self, "discount_type") else None)!r}, ' - f'exclude_mid_period_allocations={(self.exclude_mid_period_allocations if hasattr(self, "exclude_mid_period_allocations") else None)!r}, ' - f'apply_on_cancel_at_end_of_period={(self.apply_on_cancel_at_end_of_period if hasattr(self, "apply_on_cancel_at_end_of_period") else None)!r}, ' - f'apply_on_subscription_expiration={(self.apply_on_subscription_expiration if hasattr(self, "apply_on_subscription_expiration") else None)!r}, ' - f'coupon_restrictions={(self.coupon_restrictions if hasattr(self, "coupon_restrictions") else None)!r}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _recurring_scheme=( + self.recurring_scheme + if hasattr(self, "recurring_scheme") + else None + ) + _duration_period_count=( + self.duration_period_count + if hasattr(self, "duration_period_count") + else None + ) + _duration_interval=( + self.duration_interval + if hasattr(self, "duration_interval") + else None + ) + _duration_interval_unit=( + self.duration_interval_unit + if hasattr(self, "duration_interval_unit") + else None + ) + _duration_interval_span=( + self.duration_interval_span + if hasattr(self, "duration_interval_span") + else None + ) + _allow_negative_balance=( + self.allow_negative_balance + if hasattr(self, "allow_negative_balance") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _conversion_limit=( + self.conversion_limit + if hasattr(self, "conversion_limit") + else None + ) + _stackable=( + self.stackable + if hasattr(self, "stackable") + else None + ) + _compounding_strategy=( + self.compounding_strategy + if hasattr(self, "compounding_strategy") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _discount_type=( + self.discount_type + if hasattr(self, "discount_type") + else None + ) + _exclude_mid_period_allocations=( + self.exclude_mid_period_allocations + if hasattr(self, "exclude_mid_period_allocations") + else None + ) + _apply_on_cancel_at_end_of_period=( + self.apply_on_cancel_at_end_of_period + if hasattr(self, "apply_on_cancel_at_end_of_period") + else None + ) + _apply_on_subscription_expiration=( + self.apply_on_subscription_expiration + if hasattr(self, "apply_on_subscription_expiration") + else None + ) + _coupon_restrictions=( + self.coupon_restrictions + if hasattr(self, "coupon_restrictions") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"code={_code!r}, " + f"description={_description!r}, " + f"amount={_amount!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"product_family_id={_product_family_id!r}, " + f"product_family_name={_product_family_name!r}, " + f"start_date={_start_date!r}, " + f"end_date={_end_date!r}, " + f"percentage={_percentage!r}, " + f"recurring={_recurring!r}, " + f"recurring_scheme={_recurring_scheme!r}, " + f"duration_period_count={_duration_period_count!r}, " + f"duration_interval={_duration_interval!r}, " + f"duration_interval_unit={_duration_interval_unit!r}, " + f"duration_interval_span={_duration_interval_span!r}, " + f"allow_negative_balance={_allow_negative_balance!r}, " + f"archived_at={_archived_at!r}, " + f"conversion_limit={_conversion_limit!r}, " + f"stackable={_stackable!r}, " + f"compounding_strategy={_compounding_strategy!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"discount_type={_discount_type!r}, " + f"exclude_mid_period_allocations={_exclude_mid_period_allocations!r}, " + f"apply_on_cancel_at_end_of_period={_apply_on_cancel_at_end_of_period!r}, " + f"apply_on_subscription_expiration={_apply_on_subscription_expiration!r}, " + f"coupon_restrictions={_coupon_restrictions!r}, " + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!s}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!s}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'recurring_scheme={(self.recurring_scheme if hasattr(self, "recurring_scheme") else None)!s}, ' - f'duration_period_count={(self.duration_period_count if hasattr(self, "duration_period_count") else None)!s}, ' - f'duration_interval={(self.duration_interval if hasattr(self, "duration_interval") else None)!s}, ' - f'duration_interval_unit={(self.duration_interval_unit if hasattr(self, "duration_interval_unit") else None)!s}, ' - f'duration_interval_span={(self.duration_interval_span if hasattr(self, "duration_interval_span") else None)!s}, ' - f'allow_negative_balance={(self.allow_negative_balance if hasattr(self, "allow_negative_balance") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'conversion_limit={(self.conversion_limit if hasattr(self, "conversion_limit") else None)!s}, ' - f'stackable={(self.stackable if hasattr(self, "stackable") else None)!s}, ' - f'compounding_strategy={(self.compounding_strategy if hasattr(self, "compounding_strategy") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'discount_type={(self.discount_type if hasattr(self, "discount_type") else None)!s}, ' - f'exclude_mid_period_allocations={(self.exclude_mid_period_allocations if hasattr(self, "exclude_mid_period_allocations") else None)!s}, ' - f'apply_on_cancel_at_end_of_period={(self.apply_on_cancel_at_end_of_period if hasattr(self, "apply_on_cancel_at_end_of_period") else None)!s}, ' - f'apply_on_subscription_expiration={(self.apply_on_subscription_expiration if hasattr(self, "apply_on_subscription_expiration") else None)!s}, ' - f'coupon_restrictions={(self.coupon_restrictions if hasattr(self, "coupon_restrictions") else None)!s}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _recurring_scheme=( + self.recurring_scheme + if hasattr(self, "recurring_scheme") + else None + ) + _duration_period_count=( + self.duration_period_count + if hasattr(self, "duration_period_count") + else None + ) + _duration_interval=( + self.duration_interval + if hasattr(self, "duration_interval") + else None + ) + _duration_interval_unit=( + self.duration_interval_unit + if hasattr(self, "duration_interval_unit") + else None + ) + _duration_interval_span=( + self.duration_interval_span + if hasattr(self, "duration_interval_span") + else None + ) + _allow_negative_balance=( + self.allow_negative_balance + if hasattr(self, "allow_negative_balance") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _conversion_limit=( + self.conversion_limit + if hasattr(self, "conversion_limit") + else None + ) + _stackable=( + self.stackable + if hasattr(self, "stackable") + else None + ) + _compounding_strategy=( + self.compounding_strategy + if hasattr(self, "compounding_strategy") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _discount_type=( + self.discount_type + if hasattr(self, "discount_type") + else None + ) + _exclude_mid_period_allocations=( + self.exclude_mid_period_allocations + if hasattr(self, "exclude_mid_period_allocations") + else None + ) + _apply_on_cancel_at_end_of_period=( + self.apply_on_cancel_at_end_of_period + if hasattr(self, "apply_on_cancel_at_end_of_period") + else None + ) + _apply_on_subscription_expiration=( + self.apply_on_subscription_expiration + if hasattr(self, "apply_on_subscription_expiration") + else None + ) + _coupon_restrictions=( + self.coupon_restrictions + if hasattr(self, "coupon_restrictions") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"code={_code!s}, " + f"description={_description!s}, " + f"amount={_amount!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"product_family_id={_product_family_id!s}, " + f"product_family_name={_product_family_name!s}, " + f"start_date={_start_date!s}, " + f"end_date={_end_date!s}, " + f"percentage={_percentage!s}, " + f"recurring={_recurring!s}, " + f"recurring_scheme={_recurring_scheme!s}, " + f"duration_period_count={_duration_period_count!s}, " + f"duration_interval={_duration_interval!s}, " + f"duration_interval_unit={_duration_interval_unit!s}, " + f"duration_interval_span={_duration_interval_span!s}, " + f"allow_negative_balance={_allow_negative_balance!s}, " + f"archived_at={_archived_at!s}, " + f"conversion_limit={_conversion_limit!s}, " + f"stackable={_stackable!s}, " + f"compounding_strategy={_compounding_strategy!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"discount_type={_discount_type!s}, " + f"exclude_mid_period_allocations={_exclude_mid_period_allocations!s}, " + f"apply_on_cancel_at_end_of_period={_apply_on_cancel_at_end_of_period!s}, " + f"apply_on_subscription_expiration={_apply_on_subscription_expiration!s}, " + f"coupon_restrictions={_coupon_restrictions!s}, " + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_currency.py b/advancedbilling/models/coupon_currency.py index d956b423..c2bb59a3 100644 --- a/advancedbilling/models/coupon_currency.py +++ b/advancedbilling/models/coupon_currency.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CouponCurrency(object): - """Implementation of the 'Coupon Currency' model. Attributes: @@ -18,48 +16,48 @@ class CouponCurrency(object): currency (str): The model property of type str. price (float): The model property of type float. coupon_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "currency": 'currency', - "price": 'price', - "coupon_id": 'coupon_id' + "id": "id", + "currency": "currency", + "price": "price", + "coupon_id": "coupon_id", } _optionals = [ - 'id', - 'currency', - 'price', - 'coupon_id', + "id", + "currency", + "price", + "coupon_id", ] _nullables = [ - 'id', - 'price', + "id", + "price", ] - def __init__(self, - id=APIHelper.SKIP, - currency=APIHelper.SKIP, - price=APIHelper.SKIP, - coupon_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponCurrency class""" - + def __init__( + self, + id=APIHelper.SKIP, + currency=APIHelper.SKIP, + price=APIHelper.SKIP, + coupon_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponCurrency instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if price is not APIHelper.SKIP: - self.price = price + self.price = price if coupon_id is not APIHelper.SKIP: - self.coupon_id = coupon_id + self.coupon_id = coupon_id # Add additional model properties to the instance if additional_properties is None: @@ -69,7 +67,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -80,17 +78,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if "id" in dictionary.keys() else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - price = dictionary.get("price") if "price" in dictionary.keys() else APIHelper.SKIP - coupon_id = dictionary.get("coupon_id") if dictionary.get("coupon_id") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if "id" in dictionary.keys()\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + price =\ + dictionary.get("price")\ + if "price" in dictionary.keys()\ + else APIHelper.SKIP + coupon_id =\ + dictionary.get("coupon_id")\ + if dictionary.get("coupon_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, currency, @@ -99,17 +111,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'price={(self.price if hasattr(self, "price") else None)!r}, ' - f'coupon_id={(self.coupon_id if hasattr(self, "coupon_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _coupon_id=( + self.coupon_id + if hasattr(self, "coupon_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"currency={_currency!r}, " + f"price={_price!r}, " + f"coupon_id={_coupon_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'price={(self.price if hasattr(self, "price") else None)!s}, ' - f'coupon_id={(self.coupon_id if hasattr(self, "coupon_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _coupon_id=( + self.coupon_id + if hasattr(self, "coupon_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"currency={_currency!s}, " + f"price={_price!s}, " + f"coupon_id={_coupon_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_currency_request.py b/advancedbilling/models/coupon_currency_request.py index 4c98aeb9..1dc03572 100644 --- a/advancedbilling/models/coupon_currency_request.py +++ b/advancedbilling/models/coupon_currency_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_coupon_currency import UpdateCouponCurrency +# ruff: noqa: E501 +from advancedbilling.models.update_coupon_currency import ( + UpdateCouponCurrency, +) -class CouponCurrencyRequest(object): +class CouponCurrencyRequest(object): """Implementation of the 'Coupon Currency Request' model. Attributes: - currency_prices (List[UpdateCouponCurrency]): The model property of - type List[UpdateCouponCurrency]. - additional_properties (Dict[str, object]): The additional properties - for the model. + currency_prices (List[UpdateCouponCurrency]): The model property of type + List[UpdateCouponCurrency]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency_prices": 'currency_prices' + "currency_prices": "currency_prices", } - def __init__(self, - currency_prices=None, - additional_properties=None): - """Constructor for the CouponCurrencyRequest class""" - + def __init__( + self, + currency_prices=None, + additional_properties=None): + """Initialize a CouponCurrencyRequest instance.""" # Initialize members of the class - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [UpdateCouponCurrency.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + UpdateCouponCurrency.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency_prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_currency_response.py b/advancedbilling/models/coupon_currency_response.py index cb8d354e..72f9cb5b 100644 --- a/advancedbilling/models/coupon_currency_response.py +++ b/advancedbilling/models/coupon_currency_response.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.coupon_currency import CouponCurrency +from advancedbilling.models.coupon_currency import ( + CouponCurrency, +) class CouponCurrencyResponse(object): - """Implementation of the 'Coupon Currency Response' model. Attributes: currency_prices (List[CouponCurrency]): The model property of type List[CouponCurrency]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency_prices": 'currency_prices' + "currency_prices": "currency_prices", } _optionals = [ - 'currency_prices', + "currency_prices", ] - def __init__(self, - currency_prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponCurrencyResponse class""" - + def __init__( + self, + currency_prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponCurrencyResponse instance.""" # Initialize members of the class if currency_prices is not APIHelper.SKIP: - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,28 +59,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [CouponCurrency.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + CouponCurrency.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] else: currency_prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency_prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_payload.py b/advancedbilling/models/coupon_payload.py index 6d7c03c4..15782e62 100644 --- a/advancedbilling/models/coupon_payload.py +++ b/advancedbilling/models/coupon_payload.py @@ -1,143 +1,137 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class CouponPayload(object): - """Implementation of the 'Coupon Payload' model. Attributes: - name (str): Required when creating a new coupon. This name is not - displayed to customers and is limited to 255 characters. - code (str): Required when creating a new coupon. The code is limited - to 255 characters. May contain uppercase alphanumeric characters - and these special characters (which allow for email addresses to - be used): “%”, “@”, “+”, “-”, “_”, and “.” - description (str): Required when creating a new coupon. A description - of the coupon that can be displayed to customers in transactions - and on statements. The description is limited to 255 characters. - percentage (str | float | None): Required when creating a new - percentage coupon. Can't be used together with amount_in_cents. - Percentage discount - amount_in_cents (int): Required when creating a new flat amount - coupon. Can't be used together with percentage. Flat USD discount + name (str): Required when creating a new coupon. This name is not displayed + to customers and is limited to 255 characters. + code (str): Required when creating a new coupon. The code is limited to 255 + characters. May contain uppercase alphanumeric characters and these + special characters (which allow for email addresses to be used): “%”, + “@”, “+”, “-”, “_”, and “.” + description (str): Required when creating a new coupon. A description of the + coupon that can be displayed to customers in transactions and on + statements. The description is limited to 255 characters. + percentage (str | float | None): Required when creating a new percentage + coupon. Can't be used together with amount_in_cents. Percentage discount + amount_in_cents (int): Required when creating a new flat amount coupon. Can't + be used together with percentage. Flat USD discount allow_negative_balance (bool): If set to true, discount is not limited - (credits will carry forward to next billing). Can't be used - together with restrictions. + (credits will carry forward to next billing). Can't be used together with + restrictions. recurring (bool): The model property of type bool. - end_date (date): After the end of the given day, this coupon code will - be invalid for new signups. Recurring discounts started before - this date will continue to recur even after this date. + end_date (date): After the end of the given day, this coupon code will be + invalid for new signups. Recurring discounts started before this date + will continue to recur even after this date. product_family_id (str): The model property of type str. - stackable (bool): A stackable coupon can be combined with other - coupons on a Subscription. - compounding_strategy (CompoundingStrategy): Applicable only to - stackable coupons. For `compound`, Percentage-based discounts will - be calculated against the remaining price, after prior discounts - have been calculated. For `full-price`, Percentage-based discounts - will always be calculated against the original item price, before - other discounts are applied. + stackable (bool): A stackable coupon can be combined with other coupons on a + Subscription. + compounding_strategy (CompoundingStrategy): Applicable only to stackable + coupons. For `compound`, Percentage-based discounts will be calculated + against the remaining price, after prior discounts have been calculated. + For `full-price`, Percentage-based discounts will always be calculated + against the original item price, before other discounts are applied. exclude_mid_period_allocations (bool): The model property of type bool. - apply_on_cancel_at_end_of_period (bool): The model property of type - bool. - apply_on_subscription_expiration (bool): The model property of type - bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + apply_on_cancel_at_end_of_period (bool): The model property of type bool. + apply_on_subscription_expiration (bool): The model property of type bool. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "code": 'code', - "description": 'description', - "percentage": 'percentage', - "amount_in_cents": 'amount_in_cents', - "allow_negative_balance": 'allow_negative_balance', - "recurring": 'recurring', - "end_date": 'end_date', - "product_family_id": 'product_family_id', - "stackable": 'stackable', - "compounding_strategy": 'compounding_strategy', - "exclude_mid_period_allocations": 'exclude_mid_period_allocations', - "apply_on_cancel_at_end_of_period": 'apply_on_cancel_at_end_of_period', - "apply_on_subscription_expiration": 'apply_on_subscription_expiration' + "name": "name", + "code": "code", + "description": "description", + "percentage": "percentage", + "amount_in_cents": "amount_in_cents", + "allow_negative_balance": "allow_negative_balance", + "recurring": "recurring", + "end_date": "end_date", + "product_family_id": "product_family_id", + "stackable": "stackable", + "compounding_strategy": "compounding_strategy", + "exclude_mid_period_allocations": "exclude_mid_period_allocations", + "apply_on_cancel_at_end_of_period": "apply_on_cancel_at_end_of_period", + "apply_on_subscription_expiration": "apply_on_subscription_expiration", } _optionals = [ - 'name', - 'code', - 'description', - 'percentage', - 'amount_in_cents', - 'allow_negative_balance', - 'recurring', - 'end_date', - 'product_family_id', - 'stackable', - 'compounding_strategy', - 'exclude_mid_period_allocations', - 'apply_on_cancel_at_end_of_period', - 'apply_on_subscription_expiration', + "name", + "code", + "description", + "percentage", + "amount_in_cents", + "allow_negative_balance", + "recurring", + "end_date", + "product_family_id", + "stackable", + "compounding_strategy", + "exclude_mid_period_allocations", + "apply_on_cancel_at_end_of_period", + "apply_on_subscription_expiration", ] - def __init__(self, - name=APIHelper.SKIP, - code=APIHelper.SKIP, - description=APIHelper.SKIP, - percentage=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - allow_negative_balance=APIHelper.SKIP, - recurring=APIHelper.SKIP, - end_date=APIHelper.SKIP, - product_family_id=APIHelper.SKIP, - stackable=APIHelper.SKIP, - compounding_strategy=APIHelper.SKIP, - exclude_mid_period_allocations=APIHelper.SKIP, - apply_on_cancel_at_end_of_period=APIHelper.SKIP, - apply_on_subscription_expiration=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponPayload class""" - + def __init__( + self, + name=APIHelper.SKIP, + code=APIHelper.SKIP, + description=APIHelper.SKIP, + percentage=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + allow_negative_balance=APIHelper.SKIP, + recurring=APIHelper.SKIP, + end_date=APIHelper.SKIP, + product_family_id=APIHelper.SKIP, + stackable=APIHelper.SKIP, + compounding_strategy=APIHelper.SKIP, + exclude_mid_period_allocations=APIHelper.SKIP, + apply_on_cancel_at_end_of_period=APIHelper.SKIP, + apply_on_subscription_expiration=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponPayload instance.""" # Initialize members of the class if name is not APIHelper.SKIP: - self.name = name + self.name = name if code is not APIHelper.SKIP: - self.code = code + self.code = code if description is not APIHelper.SKIP: - self.description = description + self.description = description if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if allow_negative_balance is not APIHelper.SKIP: - self.allow_negative_balance = allow_negative_balance + self.allow_negative_balance = allow_negative_balance if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring if end_date is not APIHelper.SKIP: - self.end_date = end_date + self.end_date = end_date if product_family_id is not APIHelper.SKIP: - self.product_family_id = product_family_id + self.product_family_id = product_family_id if stackable is not APIHelper.SKIP: - self.stackable = stackable + self.stackable = stackable if compounding_strategy is not APIHelper.SKIP: - self.compounding_strategy = compounding_strategy + self.compounding_strategy = compounding_strategy if exclude_mid_period_allocations is not APIHelper.SKIP: - self.exclude_mid_period_allocations = exclude_mid_period_allocations + self.exclude_mid_period_allocations = exclude_mid_period_allocations if apply_on_cancel_at_end_of_period is not APIHelper.SKIP: - self.apply_on_cancel_at_end_of_period = apply_on_cancel_at_end_of_period + self.apply_on_cancel_at_end_of_period = apply_on_cancel_at_end_of_period if apply_on_subscription_expiration is not APIHelper.SKIP: - self.apply_on_subscription_expiration = apply_on_subscription_expiration + self.apply_on_subscription_expiration = apply_on_subscription_expiration # Add additional model properties to the instance if additional_properties is None: @@ -147,7 +141,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -158,28 +152,76 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - percentage = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CouponPayloadPercentage'), dictionary.get('percentage'), False) if dictionary.get('percentage') is not None else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - allow_negative_balance = dictionary.get("allow_negative_balance") if "allow_negative_balance" in dictionary.keys() else APIHelper.SKIP - recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP - end_date = dateutil.parser.parse(dictionary.get('end_date')).date() if dictionary.get('end_date') else APIHelper.SKIP - product_family_id = dictionary.get("product_family_id") if dictionary.get("product_family_id") else APIHelper.SKIP - stackable = dictionary.get("stackable") if "stackable" in dictionary.keys() else APIHelper.SKIP - compounding_strategy = dictionary.get("compounding_strategy") if dictionary.get("compounding_strategy") else APIHelper.SKIP - exclude_mid_period_allocations = dictionary.get("exclude_mid_period_allocations") if "exclude_mid_period_allocations" in dictionary.keys() else APIHelper.SKIP - apply_on_cancel_at_end_of_period = dictionary.get("apply_on_cancel_at_end_of_period") if "apply_on_cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP - apply_on_subscription_expiration = dictionary.get("apply_on_subscription_expiration") if "apply_on_subscription_expiration" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + percentage = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CouponPayloadPercentage"), + dictionary.get("percentage"), + False)\ + if dictionary.get("percentage") is not None\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + allow_negative_balance =\ + dictionary.get("allow_negative_balance")\ + if "allow_negative_balance" in dictionary.keys()\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if "recurring" in dictionary.keys()\ + else APIHelper.SKIP + end_date = dateutil.parser.parse( + dictionary.get("end_date")).date()\ + if dictionary.get("end_date") else APIHelper.SKIP + product_family_id =\ + dictionary.get("product_family_id")\ + if dictionary.get("product_family_id")\ + else APIHelper.SKIP + stackable =\ + dictionary.get("stackable")\ + if "stackable" in dictionary.keys()\ + else APIHelper.SKIP + compounding_strategy =\ + dictionary.get("compounding_strategy")\ + if dictionary.get("compounding_strategy")\ + else APIHelper.SKIP + exclude_mid_period_allocations =\ + dictionary.get("exclude_mid_period_allocations")\ + if "exclude_mid_period_allocations" in dictionary.keys()\ + else APIHelper.SKIP + apply_on_cancel_at_end_of_period =\ + dictionary.get("apply_on_cancel_at_end_of_period")\ + if "apply_on_cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP + apply_on_subscription_expiration =\ + dictionary.get("apply_on_subscription_expiration")\ + if "apply_on_subscription_expiration" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, code, @@ -198,37 +240,187 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'allow_negative_balance={(self.allow_negative_balance if hasattr(self, "allow_negative_balance") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!r}, ' - f'stackable={(self.stackable if hasattr(self, "stackable") else None)!r}, ' - f'compounding_strategy={(self.compounding_strategy if hasattr(self, "compounding_strategy") else None)!r}, ' - f'exclude_mid_period_allocations={(self.exclude_mid_period_allocations if hasattr(self, "exclude_mid_period_allocations") else None)!r}, ' - f'apply_on_cancel_at_end_of_period={(self.apply_on_cancel_at_end_of_period if hasattr(self, "apply_on_cancel_at_end_of_period") else None)!r}, ' - f'apply_on_subscription_expiration={(self.apply_on_subscription_expiration if hasattr(self, "apply_on_subscription_expiration") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _allow_negative_balance=( + self.allow_negative_balance + if hasattr(self, "allow_negative_balance") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _stackable=( + self.stackable + if hasattr(self, "stackable") + else None + ) + _compounding_strategy=( + self.compounding_strategy + if hasattr(self, "compounding_strategy") + else None + ) + _exclude_mid_period_allocations=( + self.exclude_mid_period_allocations + if hasattr(self, "exclude_mid_period_allocations") + else None + ) + _apply_on_cancel_at_end_of_period=( + self.apply_on_cancel_at_end_of_period + if hasattr(self, "apply_on_cancel_at_end_of_period") + else None + ) + _apply_on_subscription_expiration=( + self.apply_on_subscription_expiration + if hasattr(self, "apply_on_subscription_expiration") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"code={_code!r}, " + f"description={_description!r}, " + f"percentage={_percentage!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"allow_negative_balance={_allow_negative_balance!r}, " + f"recurring={_recurring!r}, " + f"end_date={_end_date!r}, " + f"product_family_id={_product_family_id!r}, " + f"stackable={_stackable!r}, " + f"compounding_strategy={_compounding_strategy!r}, " + f"exclude_mid_period_allocations={_exclude_mid_period_allocations!r}, " + f"apply_on_cancel_at_end_of_period={_apply_on_cancel_at_end_of_period!r}, " + f"apply_on_subscription_expiration={_apply_on_subscription_expiration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'allow_negative_balance={(self.allow_negative_balance if hasattr(self, "allow_negative_balance") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!s}, ' - f'stackable={(self.stackable if hasattr(self, "stackable") else None)!s}, ' - f'compounding_strategy={(self.compounding_strategy if hasattr(self, "compounding_strategy") else None)!s}, ' - f'exclude_mid_period_allocations={(self.exclude_mid_period_allocations if hasattr(self, "exclude_mid_period_allocations") else None)!s}, ' - f'apply_on_cancel_at_end_of_period={(self.apply_on_cancel_at_end_of_period if hasattr(self, "apply_on_cancel_at_end_of_period") else None)!s}, ' - f'apply_on_subscription_expiration={(self.apply_on_subscription_expiration if hasattr(self, "apply_on_subscription_expiration") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _allow_negative_balance=( + self.allow_negative_balance + if hasattr(self, "allow_negative_balance") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _stackable=( + self.stackable + if hasattr(self, "stackable") + else None + ) + _compounding_strategy=( + self.compounding_strategy + if hasattr(self, "compounding_strategy") + else None + ) + _exclude_mid_period_allocations=( + self.exclude_mid_period_allocations + if hasattr(self, "exclude_mid_period_allocations") + else None + ) + _apply_on_cancel_at_end_of_period=( + self.apply_on_cancel_at_end_of_period + if hasattr(self, "apply_on_cancel_at_end_of_period") + else None + ) + _apply_on_subscription_expiration=( + self.apply_on_subscription_expiration + if hasattr(self, "apply_on_subscription_expiration") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"code={_code!s}, " + f"description={_description!s}, " + f"percentage={_percentage!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"allow_negative_balance={_allow_negative_balance!s}, " + f"recurring={_recurring!s}, " + f"end_date={_end_date!s}, " + f"product_family_id={_product_family_id!s}, " + f"stackable={_stackable!s}, " + f"compounding_strategy={_compounding_strategy!s}, " + f"exclude_mid_period_allocations={_exclude_mid_period_allocations!s}, " + f"apply_on_cancel_at_end_of_period={_apply_on_cancel_at_end_of_period!s}, " + f"apply_on_subscription_expiration={_apply_on_subscription_expiration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_request.py b/advancedbilling/models/coupon_request.py index ecbc7739..086bd7c3 100644 --- a/advancedbilling/models/coupon_request.py +++ b/advancedbilling/models/coupon_request.py @@ -1,61 +1,59 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.coupon_payload import CouponPayload +from advancedbilling.models.coupon_payload import ( + CouponPayload, +) class CouponRequest(object): - """Implementation of the 'Coupon Request' model. Attributes: coupon (CouponPayload): The model property of type CouponPayload. - restricted_products (Dict[str, bool]): An object where the keys are - product IDs or handles (prefixed with 'handle:'), and the values - are booleans indicating if the coupon should be applicable to the - product + restricted_products (Dict[str, bool]): An object where the keys are product + IDs or handles (prefixed with 'handle:'), and the values are booleans + indicating if the coupon should be applicable to the product restricted_components (Dict[str, bool]): An object where the keys are - component IDs or handles (prefixed with 'handle:'), and the values - are booleans indicating if the coupon should be applicable to the - component - additional_properties (Dict[str, object]): The additional properties - for the model. + component IDs or handles (prefixed with 'handle:'), and the values are + booleans indicating if the coupon should be applicable to the component + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "coupon": 'coupon', - "restricted_products": 'restricted_products', - "restricted_components": 'restricted_components' + "coupon": "coupon", + "restricted_products": "restricted_products", + "restricted_components": "restricted_components", } _optionals = [ - 'coupon', - 'restricted_products', - 'restricted_components', + "coupon", + "restricted_products", + "restricted_components", ] - def __init__(self, - coupon=APIHelper.SKIP, - restricted_products=APIHelper.SKIP, - restricted_components=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponRequest class""" - + def __init__( + self, + coupon=APIHelper.SKIP, + restricted_products=APIHelper.SKIP, + restricted_components=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponRequest instance.""" # Initialize members of the class if coupon is not APIHelper.SKIP: - self.coupon = coupon + self.coupon = coupon if restricted_products is not APIHelper.SKIP: - self.restricted_products = restricted_products + self.restricted_products = restricted_products if restricted_components is not APIHelper.SKIP: - self.restricted_components = restricted_components + self.restricted_components = restricted_components # Add additional model properties to the instance if additional_properties is None: @@ -65,7 +63,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -76,16 +74,28 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - coupon = CouponPayload.from_dictionary(dictionary.get('coupon')) if 'coupon' in dictionary.keys() else APIHelper.SKIP - restricted_products = dictionary.get("restricted_products") if "restricted_products" in dictionary.keys() else APIHelper.SKIP - restricted_components = dictionary.get("restricted_components") if "restricted_components" in dictionary.keys() else APIHelper.SKIP + coupon =\ + CouponPayload.from_dictionary( + dictionary.get("coupon"))\ + if "coupon" in dictionary.keys()\ + else APIHelper.SKIP + restricted_products =\ + dictionary.get("restricted_products")\ + if "restricted_products" in dictionary.keys()\ + else APIHelper.SKIP + restricted_components =\ + dictionary.get("restricted_components")\ + if "restricted_components" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(coupon, restricted_products, @@ -93,15 +103,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'coupon={(self.coupon if hasattr(self, "coupon") else None)!r}, ' - f'restricted_products={(self.restricted_products if hasattr(self, "restricted_products") else None)!r}, ' - f'restricted_components={(self.restricted_components if hasattr(self, "restricted_components") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _coupon=( + self.coupon + if hasattr(self, "coupon") + else None + ) + _restricted_products=( + self.restricted_products + if hasattr(self, "restricted_products") + else None + ) + _restricted_components=( + self.restricted_components + if hasattr(self, "restricted_components") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"coupon={_coupon!r}, " + f"restricted_products={_restricted_products!r}, " + f"restricted_components={_restricted_components!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'coupon={(self.coupon if hasattr(self, "coupon") else None)!s}, ' - f'restricted_products={(self.restricted_products if hasattr(self, "restricted_products") else None)!s}, ' - f'restricted_components={(self.restricted_components if hasattr(self, "restricted_components") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _coupon=( + self.coupon + if hasattr(self, "coupon") + else None + ) + _restricted_products=( + self.restricted_products + if hasattr(self, "restricted_products") + else None + ) + _restricted_components=( + self.restricted_components + if hasattr(self, "restricted_components") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"coupon={_coupon!s}, " + f"restricted_products={_restricted_products!s}, " + f"restricted_components={_restricted_components!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_response.py b/advancedbilling/models/coupon_response.py index 13fa4a31..a13fc086 100644 --- a/advancedbilling/models/coupon_response.py +++ b/advancedbilling/models/coupon_response.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.coupon import Coupon class CouponResponse(object): - """Implementation of the 'Coupon Response' model. Attributes: coupon (Coupon): The model property of type Coupon. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "coupon": 'coupon' + "coupon": "coupon", } _optionals = [ - 'coupon', + "coupon", ] - def __init__(self, - coupon=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponResponse class""" - + def __init__( + self, + coupon=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponResponse instance.""" # Initialize members of the class if coupon is not APIHelper.SKIP: - self.coupon = coupon + self.coupon = coupon # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +56,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - coupon = Coupon.from_dictionary(dictionary.get('coupon')) if 'coupon' in dictionary.keys() else APIHelper.SKIP + coupon =\ + Coupon.from_dictionary( + dictionary.get("coupon"))\ + if "coupon" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(coupon, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'coupon={(self.coupon if hasattr(self, "coupon") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _coupon=( + self.coupon + if hasattr(self, "coupon") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"coupon={_coupon!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'coupon={(self.coupon if hasattr(self, "coupon") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _coupon=( + self.coupon + if hasattr(self, "coupon") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"coupon={_coupon!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_restriction.py b/advancedbilling/models/coupon_restriction.py index 7251f3af..e300bb47 100644 --- a/advancedbilling/models/coupon_restriction.py +++ b/advancedbilling/models/coupon_restriction.py @@ -1,71 +1,68 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CouponRestriction(object): - """Implementation of the 'Coupon Restriction' model. Attributes: id (int): The model property of type int. - item_type (RestrictionType): The model property of type - RestrictionType. + item_type (RestrictionType): The model property of type RestrictionType. item_id (int): The model property of type int. name (str): The model property of type str. handle (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "item_type": 'item_type', - "item_id": 'item_id', - "name": 'name', - "handle": 'handle' + "id": "id", + "item_type": "item_type", + "item_id": "item_id", + "name": "name", + "handle": "handle", } _optionals = [ - 'id', - 'item_type', - 'item_id', - 'name', - 'handle', + "id", + "item_type", + "item_id", + "name", + "handle", ] _nullables = [ - 'handle', + "handle", ] - def __init__(self, - id=APIHelper.SKIP, - item_type=APIHelper.SKIP, - item_id=APIHelper.SKIP, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponRestriction class""" - + def __init__( + self, + id=APIHelper.SKIP, + item_type=APIHelper.SKIP, + item_id=APIHelper.SKIP, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponRestriction instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if item_type is not APIHelper.SKIP: - self.item_type = item_type + self.item_type = item_type if item_id is not APIHelper.SKIP: - self.item_id = item_id + self.item_id = item_id if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle # Add additional model properties to the instance if additional_properties is None: @@ -75,7 +72,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -86,18 +83,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - item_type = dictionary.get("item_type") if dictionary.get("item_type") else APIHelper.SKIP - item_id = dictionary.get("item_id") if dictionary.get("item_id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if "handle" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + item_type =\ + dictionary.get("item_type")\ + if dictionary.get("item_type")\ + else APIHelper.SKIP + item_id =\ + dictionary.get("item_id")\ + if dictionary.get("item_id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if "handle" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, item_type, @@ -107,19 +121,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'item_type={(self.item_type if hasattr(self, "item_type") else None)!r}, ' - f'item_id={(self.item_id if hasattr(self, "item_id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _item_type=( + self.item_type + if hasattr(self, "item_type") + else None + ) + _item_id=( + self.item_id + if hasattr(self, "item_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"item_type={_item_type!r}, " + f"item_id={_item_id!r}, " + f"name={_name!r}, " + f"handle={_handle!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'item_type={(self.item_type if hasattr(self, "item_type") else None)!s}, ' - f'item_id={(self.item_id if hasattr(self, "item_id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _item_type=( + self.item_type + if hasattr(self, "item_type") + else None + ) + _item_id=( + self.item_id + if hasattr(self, "item_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"item_type={_item_type!s}, " + f"item_id={_item_id!s}, " + f"name={_name!s}, " + f"handle={_handle!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_subcodes.py b/advancedbilling/models/coupon_subcodes.py index c57489b9..3c4b0db2 100644 --- a/advancedbilling/models/coupon_subcodes.py +++ b/advancedbilling/models/coupon_subcodes.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CouponSubcodes(object): - """Implementation of the 'Coupon Subcodes' model. Attributes: codes (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "codes": 'codes' + "codes": "codes", } _optionals = [ - 'codes', + "codes", ] - def __init__(self, - codes=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponSubcodes class""" - + def __init__( + self, + codes=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponSubcodes instance.""" # Initialize members of the class if codes is not APIHelper.SKIP: - self.codes = codes + self.codes = codes # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - codes = dictionary.get("codes") if dictionary.get("codes") else APIHelper.SKIP + codes =\ + dictionary.get("codes")\ + if dictionary.get("codes")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(codes, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'codes={(self.codes if hasattr(self, "codes") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _codes=( + self.codes + if hasattr(self, "codes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"codes={_codes!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'codes={(self.codes if hasattr(self, "codes") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _codes=( + self.codes + if hasattr(self, "codes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"codes={_codes!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_subcodes_response.py b/advancedbilling/models/coupon_subcodes_response.py index eea6332f..02f60e50 100644 --- a/advancedbilling/models/coupon_subcodes_response.py +++ b/advancedbilling/models/coupon_subcodes_response.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CouponSubcodesResponse(object): - """Implementation of the 'Coupon Subcodes Response' model. Attributes: created_codes (List[str]): The model property of type List[str]. duplicate_codes (List[str]): The model property of type List[str]. invalid_codes (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "created_codes": 'created_codes', - "duplicate_codes": 'duplicate_codes', - "invalid_codes": 'invalid_codes' + "created_codes": "created_codes", + "duplicate_codes": "duplicate_codes", + "invalid_codes": "invalid_codes", } _optionals = [ - 'created_codes', - 'duplicate_codes', - 'invalid_codes', + "created_codes", + "duplicate_codes", + "invalid_codes", ] - def __init__(self, - created_codes=APIHelper.SKIP, - duplicate_codes=APIHelper.SKIP, - invalid_codes=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponSubcodesResponse class""" - + def __init__( + self, + created_codes=APIHelper.SKIP, + duplicate_codes=APIHelper.SKIP, + invalid_codes=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponSubcodesResponse instance.""" # Initialize members of the class if created_codes is not APIHelper.SKIP: - self.created_codes = created_codes + self.created_codes = created_codes if duplicate_codes is not APIHelper.SKIP: - self.duplicate_codes = duplicate_codes + self.duplicate_codes = duplicate_codes if invalid_codes is not APIHelper.SKIP: - self.invalid_codes = invalid_codes + self.invalid_codes = invalid_codes # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - created_codes = dictionary.get("created_codes") if dictionary.get("created_codes") else APIHelper.SKIP - duplicate_codes = dictionary.get("duplicate_codes") if dictionary.get("duplicate_codes") else APIHelper.SKIP - invalid_codes = dictionary.get("invalid_codes") if dictionary.get("invalid_codes") else APIHelper.SKIP + created_codes =\ + dictionary.get("created_codes")\ + if dictionary.get("created_codes")\ + else APIHelper.SKIP + duplicate_codes =\ + dictionary.get("duplicate_codes")\ + if dictionary.get("duplicate_codes")\ + else APIHelper.SKIP + invalid_codes =\ + dictionary.get("invalid_codes")\ + if dictionary.get("invalid_codes")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(created_codes, duplicate_codes, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'created_codes={(self.created_codes if hasattr(self, "created_codes") else None)!r}, ' - f'duplicate_codes={(self.duplicate_codes if hasattr(self, "duplicate_codes") else None)!r}, ' - f'invalid_codes={(self.invalid_codes if hasattr(self, "invalid_codes") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _created_codes=( + self.created_codes + if hasattr(self, "created_codes") + else None + ) + _duplicate_codes=( + self.duplicate_codes + if hasattr(self, "duplicate_codes") + else None + ) + _invalid_codes=( + self.invalid_codes + if hasattr(self, "invalid_codes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"created_codes={_created_codes!r}, " + f"duplicate_codes={_duplicate_codes!r}, " + f"invalid_codes={_invalid_codes!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'created_codes={(self.created_codes if hasattr(self, "created_codes") else None)!s}, ' - f'duplicate_codes={(self.duplicate_codes if hasattr(self, "duplicate_codes") else None)!s}, ' - f'invalid_codes={(self.invalid_codes if hasattr(self, "invalid_codes") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _created_codes=( + self.created_codes + if hasattr(self, "created_codes") + else None + ) + _duplicate_codes=( + self.duplicate_codes + if hasattr(self, "duplicate_codes") + else None + ) + _invalid_codes=( + self.invalid_codes + if hasattr(self, "invalid_codes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"created_codes={_created_codes!s}, " + f"duplicate_codes={_duplicate_codes!s}, " + f"invalid_codes={_invalid_codes!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/coupon_usage.py b/advancedbilling/models/coupon_usage.py index f59103fc..9275883b 100644 --- a/advancedbilling/models/coupon_usage.py +++ b/advancedbilling/models/coupon_usage.py @@ -1,88 +1,85 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CouponUsage(object): - """Implementation of the 'Coupon Usage' model. Attributes: id (int): The Chargify id of the product name (str): Name of the product signups (int): Number of times the coupon has been applied - savings (int): Dollar amount of customer savings as a result of the + savings (int): Dollar amount of customer savings as a result of the coupon. + savings_in_cents (int): Dollar amount of customer savings as a result of the coupon. - savings_in_cents (int): Dollar amount of customer savings as a result - of the coupon. - revenue (int): Total revenue of the all subscriptions that have + revenue (int): Total revenue of the all subscriptions that have received a + discount from this coupon. + revenue_in_cents (int): Total revenue of the all subscriptions that have received a discount from this coupon. - revenue_in_cents (int): Total revenue of the all subscriptions that - have received a discount from this coupon. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "signups": 'signups', - "savings": 'savings', - "savings_in_cents": 'savings_in_cents', - "revenue": 'revenue', - "revenue_in_cents": 'revenue_in_cents' + "id": "id", + "name": "name", + "signups": "signups", + "savings": "savings", + "savings_in_cents": "savings_in_cents", + "revenue": "revenue", + "revenue_in_cents": "revenue_in_cents", } _optionals = [ - 'id', - 'name', - 'signups', - 'savings', - 'savings_in_cents', - 'revenue', - 'revenue_in_cents', + "id", + "name", + "signups", + "savings", + "savings_in_cents", + "revenue", + "revenue_in_cents", ] _nullables = [ - 'savings', - 'savings_in_cents', - 'revenue', + "savings", + "savings_in_cents", + "revenue", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - signups=APIHelper.SKIP, - savings=APIHelper.SKIP, - savings_in_cents=APIHelper.SKIP, - revenue=APIHelper.SKIP, - revenue_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CouponUsage class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + signups=APIHelper.SKIP, + savings=APIHelper.SKIP, + savings_in_cents=APIHelper.SKIP, + revenue=APIHelper.SKIP, + revenue_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a CouponUsage instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if signups is not APIHelper.SKIP: - self.signups = signups + self.signups = signups if savings is not APIHelper.SKIP: - self.savings = savings + self.savings = savings if savings_in_cents is not APIHelper.SKIP: - self.savings_in_cents = savings_in_cents + self.savings_in_cents = savings_in_cents if revenue is not APIHelper.SKIP: - self.revenue = revenue + self.revenue = revenue if revenue_in_cents is not APIHelper.SKIP: - self.revenue_in_cents = revenue_in_cents + self.revenue_in_cents = revenue_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -92,7 +89,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -103,20 +100,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - signups = dictionary.get("signups") if dictionary.get("signups") else APIHelper.SKIP - savings = dictionary.get("savings") if "savings" in dictionary.keys() else APIHelper.SKIP - savings_in_cents = dictionary.get("savings_in_cents") if "savings_in_cents" in dictionary.keys() else APIHelper.SKIP - revenue = dictionary.get("revenue") if "revenue" in dictionary.keys() else APIHelper.SKIP - revenue_in_cents = dictionary.get("revenue_in_cents") if dictionary.get("revenue_in_cents") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + signups =\ + dictionary.get("signups")\ + if dictionary.get("signups")\ + else APIHelper.SKIP + savings =\ + dictionary.get("savings")\ + if "savings" in dictionary.keys()\ + else APIHelper.SKIP + savings_in_cents =\ + dictionary.get("savings_in_cents")\ + if "savings_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + revenue =\ + dictionary.get("revenue")\ + if "revenue" in dictionary.keys()\ + else APIHelper.SKIP + revenue_in_cents =\ + dictionary.get("revenue_in_cents")\ + if dictionary.get("revenue_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -128,23 +148,103 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'signups={(self.signups if hasattr(self, "signups") else None)!r}, ' - f'savings={(self.savings if hasattr(self, "savings") else None)!r}, ' - f'savings_in_cents={(self.savings_in_cents if hasattr(self, "savings_in_cents") else None)!r}, ' - f'revenue={(self.revenue if hasattr(self, "revenue") else None)!r}, ' - f'revenue_in_cents={(self.revenue_in_cents if hasattr(self, "revenue_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _signups=( + self.signups + if hasattr(self, "signups") + else None + ) + _savings=( + self.savings + if hasattr(self, "savings") + else None + ) + _savings_in_cents=( + self.savings_in_cents + if hasattr(self, "savings_in_cents") + else None + ) + _revenue=( + self.revenue + if hasattr(self, "revenue") + else None + ) + _revenue_in_cents=( + self.revenue_in_cents + if hasattr(self, "revenue_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"signups={_signups!r}, " + f"savings={_savings!r}, " + f"savings_in_cents={_savings_in_cents!r}, " + f"revenue={_revenue!r}, " + f"revenue_in_cents={_revenue_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'signups={(self.signups if hasattr(self, "signups") else None)!s}, ' - f'savings={(self.savings if hasattr(self, "savings") else None)!s}, ' - f'savings_in_cents={(self.savings_in_cents if hasattr(self, "savings_in_cents") else None)!s}, ' - f'revenue={(self.revenue if hasattr(self, "revenue") else None)!s}, ' - f'revenue_in_cents={(self.revenue_in_cents if hasattr(self, "revenue_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _signups=( + self.signups + if hasattr(self, "signups") + else None + ) + _savings=( + self.savings + if hasattr(self, "savings") + else None + ) + _savings_in_cents=( + self.savings_in_cents + if hasattr(self, "savings_in_cents") + else None + ) + _revenue=( + self.revenue + if hasattr(self, "revenue") + else None + ) + _revenue_in_cents=( + self.revenue_in_cents + if hasattr(self, "revenue_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"signups={_signups!s}, " + f"savings={_savings!s}, " + f"savings_in_cents={_savings_in_cents!s}, " + f"revenue={_revenue!s}, " + f"revenue_in_cents={_revenue_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_allocation.py b/advancedbilling/models/create_allocation.py index dc9f7bd3..5ba8420b 100644 --- a/advancedbilling/models/create_allocation.py +++ b/advancedbilling/models/create_allocation.py @@ -1,132 +1,166 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.billing_schedule import BillingSchedule +from advancedbilling.models.billing_schedule import ( + BillingSchedule, +) +from advancedbilling.models.component_custom_price import ( + ComponentCustomPrice, +) class CreateAllocation(object): - """Implementation of the 'Create Allocation' model. Attributes: - quantity (float): The allocated quantity to which to set the - line-items allocated quantity. By default, this is an integer. If - decimal allocations are enabled for the component, it will be a - decimal number. For On/Off components, use 1for on and 0 for off. - component_id (int): (required for the multiple allocations endpoint) - The id associated with the component for which the allocation is - being made - memo (str): A memo to record along with the allocation - proration_downgrade_scheme (str): The scheme used if the proration is - a downgrade. Defaults to the site setting if one is not provided. + quantity (float): The allocated quantity to which to set the line-items + allocated quantity. By default, this is an integer. If decimal + allocations are enabled for the component, it will be a decimal number. + For On/Off components, use 1for on and 0 for off. + decimal_quantity (str): Decimal representation of the allocated quantity. + Only valid when decimal allocations are enabled for the component. + previous_quantity (float): The quantity that was in effect before this + allocation. Responses always include this value; it may be supplied on + preview requests to ensure the expected change is evaluated. + decimal_previous_quantity (str): Decimal representation of + `previous_quantity`. Only valid when decimal allocations are enabled for + the component. + component_id (int): (required for the multiple allocations endpoint) The id + associated with the component for which the allocation is being made. + memo (str): A memo to record along with the allocation. + proration_downgrade_scheme (str): The scheme used if the proration is a + downgrade. Defaults to the site setting if one is not provided. proration_upgrade_scheme (str): The scheme used if the proration is an upgrade. Defaults to the site setting if one is not provided. - accrue_charge (bool): If the change in cost is an upgrade, this - determines if the charge should accrue to the next renewal or if - capture should be attempted immediately. Defaults to the site - setting if one is not provided. - downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - initiate_dunning (bool): If set to true, if the immediate component - payment fails, initiate dunning for the subscription. Otherwise, - leave the charges on the subscription to pay for at renewal. - Defaults to false. - price_point_id (str | int | None): Price point that the allocation - should be charged at. Accepts either the price point's id - (integer) or handle (string). When not specified, the default - price point will be used. - billing_schedule (BillingSchedule): This attribute is particularly - useful when you need to align billing events for different - components on distinct schedules within a subscription. This only - works for site with Multifrequency enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + downgrade_credit (DowngradeCreditCreditType): The type of credit to be + created when upgrading/downgrading. Defaults to the component and then + site setting if one is not provided. Values are: `full` - A full price + credit is added for the amount owed. `prorated` - A prorated credit is + added for the amount owed. `none` - No charge is added. + upgrade_charge (UpgradeChargeCreditType): The type of credit to be created + when upgrading/downgrading. Defaults to the component and then site + setting if one is not provided. Values are: `full` - A charge is added + for the full price of the component. `prorated` - A charge is added for + the prorated price of the component change. `none` - No charge is added. + accrue_charge (bool): "If the change in cost is an upgrade, this determines + if the charge should accrue to the next renewal or if capture should be + attempted immediately. `true` - Attempt to charge the customer at the + next renewal. `false` - Attempt to charge the customer right away. + If it fails, the charge will be accrued until the next renewal. Defaults + to the site setting if unspecified in the request. + initiate_dunning (bool): If set to true, if the immediate component payment + fails, initiate dunning for the subscription. Otherwise, leave the + charges on the subscription to pay for at renewal. Defaults to false. + price_point_id (str | int | None): Price point that the allocation should be + charged at. Accepts either the price point's id (integer) or handle + (string). When not specified, the default price point will be used. + billing_schedule (BillingSchedule): This attribute is particularly useful + when you need to align billing events for different components on + distinct schedules within a subscription. This only works for site with + Multifrequency enabled. + custom_price (ComponentCustomPrice): Create or update custom pricing unique + to the subscription. Used in place of `price_point_id`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "quantity": 'quantity', - "component_id": 'component_id', - "memo": 'memo', - "proration_downgrade_scheme": 'proration_downgrade_scheme', - "proration_upgrade_scheme": 'proration_upgrade_scheme', - "accrue_charge": 'accrue_charge', - "downgrade_credit": 'downgrade_credit', - "upgrade_charge": 'upgrade_charge', - "initiate_dunning": 'initiate_dunning', - "price_point_id": 'price_point_id', - "billing_schedule": 'billing_schedule' + "quantity": "quantity", + "decimal_quantity": "decimal_quantity", + "previous_quantity": "previous_quantity", + "decimal_previous_quantity": "decimal_previous_quantity", + "component_id": "component_id", + "memo": "memo", + "proration_downgrade_scheme": "proration_downgrade_scheme", + "proration_upgrade_scheme": "proration_upgrade_scheme", + "downgrade_credit": "downgrade_credit", + "upgrade_charge": "upgrade_charge", + "accrue_charge": "accrue_charge", + "initiate_dunning": "initiate_dunning", + "price_point_id": "price_point_id", + "billing_schedule": "billing_schedule", + "custom_price": "custom_price", } _optionals = [ - 'component_id', - 'memo', - 'proration_downgrade_scheme', - 'proration_upgrade_scheme', - 'accrue_charge', - 'downgrade_credit', - 'upgrade_charge', - 'initiate_dunning', - 'price_point_id', - 'billing_schedule', + "decimal_quantity", + "previous_quantity", + "decimal_previous_quantity", + "component_id", + "memo", + "proration_downgrade_scheme", + "proration_upgrade_scheme", + "downgrade_credit", + "upgrade_charge", + "accrue_charge", + "initiate_dunning", + "price_point_id", + "billing_schedule", + "custom_price", ] _nullables = [ - 'downgrade_credit', - 'upgrade_charge', - 'price_point_id', + "downgrade_credit", + "upgrade_charge", + "price_point_id", ] - def __init__(self, - quantity=None, - component_id=APIHelper.SKIP, - memo=APIHelper.SKIP, - proration_downgrade_scheme=APIHelper.SKIP, - proration_upgrade_scheme=APIHelper.SKIP, - accrue_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - initiate_dunning=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - billing_schedule=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateAllocation class""" - + def __init__( + self, + quantity=None, + decimal_quantity=APIHelper.SKIP, + previous_quantity=APIHelper.SKIP, + decimal_previous_quantity=APIHelper.SKIP, + component_id=APIHelper.SKIP, + memo=APIHelper.SKIP, + proration_downgrade_scheme=APIHelper.SKIP, + proration_upgrade_scheme=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + accrue_charge=APIHelper.SKIP, + initiate_dunning=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + billing_schedule=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateAllocation instance.""" # Initialize members of the class - self.quantity = quantity + self.quantity = quantity + if decimal_quantity is not APIHelper.SKIP: + self.decimal_quantity = decimal_quantity + if previous_quantity is not APIHelper.SKIP: + self.previous_quantity = previous_quantity + if decimal_previous_quantity is not APIHelper.SKIP: + self.decimal_previous_quantity = decimal_previous_quantity if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if proration_downgrade_scheme is not APIHelper.SKIP: - self.proration_downgrade_scheme = proration_downgrade_scheme + self.proration_downgrade_scheme = proration_downgrade_scheme if proration_upgrade_scheme is not APIHelper.SKIP: - self.proration_upgrade_scheme = proration_upgrade_scheme - if accrue_charge is not APIHelper.SKIP: - self.accrue_charge = accrue_charge + self.proration_upgrade_scheme = proration_upgrade_scheme if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge + if accrue_charge is not APIHelper.SKIP: + self.accrue_charge = accrue_charge if initiate_dunning is not APIHelper.SKIP: - self.initiate_dunning = initiate_dunning + self.initiate_dunning = initiate_dunning if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if billing_schedule is not APIHelper.SKIP: - self.billing_schedule = billing_schedule + self.billing_schedule = billing_schedule + if custom_price is not APIHelper.SKIP: + self.custom_price = custom_price # Add additional model properties to the instance if additional_properties is None: @@ -136,7 +170,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -147,68 +181,290 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - quantity = dictionary.get("quantity") if dictionary.get("quantity") else None - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else APIHelper.SKIP - proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else APIHelper.SKIP - accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - initiate_dunning = dictionary.get("initiate_dunning") if "initiate_dunning" in dictionary.keys() else APIHelper.SKIP - if 'price_point_id' in dictionary.keys(): - price_point_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateAllocationPricePointId'), dictionary.get('price_point_id'), False) if dictionary.get('price_point_id') is not None else None + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else None + decimal_quantity =\ + dictionary.get("decimal_quantity")\ + if dictionary.get("decimal_quantity")\ + else APIHelper.SKIP + previous_quantity =\ + dictionary.get("previous_quantity")\ + if dictionary.get("previous_quantity")\ + else APIHelper.SKIP + decimal_previous_quantity =\ + dictionary.get("decimal_previous_quantity")\ + if dictionary.get("decimal_previous_quantity")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + proration_downgrade_scheme =\ + dictionary.get("proration_downgrade_scheme")\ + if dictionary.get("proration_downgrade_scheme")\ + else APIHelper.SKIP + proration_upgrade_scheme =\ + dictionary.get("proration_upgrade_scheme")\ + if dictionary.get("proration_upgrade_scheme")\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + accrue_charge =\ + dictionary.get("accrue_charge")\ + if "accrue_charge" in dictionary.keys()\ + else APIHelper.SKIP + initiate_dunning =\ + dictionary.get("initiate_dunning")\ + if "initiate_dunning" in dictionary.keys()\ + else APIHelper.SKIP + if "price_point_id" in dictionary.keys(): + price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateAllocationPricePointId"), + dictionary.get("price_point_id"), + False)\ + if dictionary.get("price_point_id") is not None\ + else None else: price_point_id = APIHelper.SKIP - billing_schedule = BillingSchedule.from_dictionary(dictionary.get('billing_schedule')) if 'billing_schedule' in dictionary.keys() else APIHelper.SKIP + billing_schedule =\ + BillingSchedule.from_dictionary( + dictionary.get("billing_schedule"))\ + if "billing_schedule" in dictionary.keys()\ + else APIHelper.SKIP + custom_price =\ + ComponentCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(quantity, + decimal_quantity, + previous_quantity, + decimal_previous_quantity, component_id, memo, proration_downgrade_scheme, proration_upgrade_scheme, - accrue_charge, downgrade_credit, upgrade_charge, + accrue_charge, initiate_dunning, price_point_id, billing_schedule, + custom_price, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'quantity={self.quantity!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!r}, ' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!r}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'initiate_dunning={(self.initiate_dunning if hasattr(self, "initiate_dunning") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'billing_schedule={(self.billing_schedule if hasattr(self, "billing_schedule") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _quantity=self.quantity + _decimal_quantity=( + self.decimal_quantity + if hasattr(self, "decimal_quantity") + else None + ) + _previous_quantity=( + self.previous_quantity + if hasattr(self, "previous_quantity") + else None + ) + _decimal_previous_quantity=( + self.decimal_previous_quantity + if hasattr(self, "decimal_previous_quantity") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _initiate_dunning=( + self.initiate_dunning + if hasattr(self, "initiate_dunning") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule=( + self.billing_schedule + if hasattr(self, "billing_schedule") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"quantity={_quantity!r}, " + f"decimal_quantity={_decimal_quantity!r}, " + f"previous_quantity={_previous_quantity!r}, " + f"decimal_previous_quantity={_decimal_previous_quantity!r}, " + f"component_id={_component_id!r}, " + f"memo={_memo!r}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!r}, " + f"proration_upgrade_scheme={_proration_upgrade_scheme!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"accrue_charge={_accrue_charge!r}, " + f"initiate_dunning={_initiate_dunning!r}, " + f"price_point_id={_price_point_id!r}, " + f"billing_schedule={_billing_schedule!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'quantity={self.quantity!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'proration_downgrade_scheme={(self.proration_downgrade_scheme if hasattr(self, "proration_downgrade_scheme") else None)!s}, ' - f'proration_upgrade_scheme={(self.proration_upgrade_scheme if hasattr(self, "proration_upgrade_scheme") else None)!s}, ' - f'accrue_charge={(self.accrue_charge if hasattr(self, "accrue_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'initiate_dunning={(self.initiate_dunning if hasattr(self, "initiate_dunning") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'billing_schedule={(self.billing_schedule if hasattr(self, "billing_schedule") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _quantity=self.quantity + _decimal_quantity=( + self.decimal_quantity + if hasattr(self, "decimal_quantity") + else None + ) + _previous_quantity=( + self.previous_quantity + if hasattr(self, "previous_quantity") + else None + ) + _decimal_previous_quantity=( + self.decimal_previous_quantity + if hasattr(self, "decimal_previous_quantity") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _proration_downgrade_scheme=( + self.proration_downgrade_scheme + if hasattr(self, "proration_downgrade_scheme") + else None + ) + _proration_upgrade_scheme=( + self.proration_upgrade_scheme + if hasattr(self, "proration_upgrade_scheme") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _accrue_charge=( + self.accrue_charge + if hasattr(self, "accrue_charge") + else None + ) + _initiate_dunning=( + self.initiate_dunning + if hasattr(self, "initiate_dunning") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule=( + self.billing_schedule + if hasattr(self, "billing_schedule") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"quantity={_quantity!s}, " + f"decimal_quantity={_decimal_quantity!s}, " + f"previous_quantity={_previous_quantity!s}, " + f"decimal_previous_quantity={_decimal_previous_quantity!s}, " + f"component_id={_component_id!s}, " + f"memo={_memo!s}, " + f"proration_downgrade_scheme={_proration_downgrade_scheme!s}, " + f"proration_upgrade_scheme={_proration_upgrade_scheme!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"accrue_charge={_accrue_charge!s}, " + f"initiate_dunning={_initiate_dunning!s}, " + f"price_point_id={_price_point_id!s}, " + f"billing_schedule={_billing_schedule!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_allocation_request.py b/advancedbilling/models/create_allocation_request.py index 64cadef4..25099d15 100644 --- a/advancedbilling/models/create_allocation_request.py +++ b/advancedbilling/models/create_allocation_request.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_allocation import CreateAllocation +# ruff: noqa: E501 +from advancedbilling.models.create_allocation import ( + CreateAllocation, +) -class CreateAllocationRequest(object): +class CreateAllocationRequest(object): """Implementation of the 'Create Allocation Request' model. Attributes: - allocation (CreateAllocation): The model property of type - CreateAllocation. - additional_properties (Dict[str, object]): The additional properties - for the model. + allocation (CreateAllocation): The model property of type CreateAllocation. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "allocation": 'allocation' + "allocation": "allocation", } - def __init__(self, - allocation=None, - additional_properties=None): - """Constructor for the CreateAllocationRequest class""" - + def __init__( + self, + allocation=None, + additional_properties=None): + """Initialize a CreateAllocationRequest instance.""" # Initialize members of the class - self.allocation = allocation + self.allocation = allocation # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - allocation = CreateAllocation.from_dictionary(dictionary.get('allocation')) if dictionary.get('allocation') else None + allocation =\ + CreateAllocation.from_dictionary( + dictionary.get("allocation"))\ + if dictionary.get("allocation") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(allocation, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'allocation={self.allocation!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _allocation=self.allocation + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation={_allocation!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'allocation={self.allocation!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _allocation=self.allocation + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation={_allocation!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_component_price_point.py b/advancedbilling/models/create_component_price_point.py index 115c2b0a..92a7d9f1 100644 --- a/advancedbilling/models/create_component_price_point.py +++ b/advancedbilling/models/create_component_price_point.py @@ -1,95 +1,95 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.price import Price -from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.pricing_scheme import ( + PricingScheme, +) class CreateComponentPricePoint(object): - """Implementation of the 'Create Component Price Point' model. Attributes: name (str): The model property of type str. handle (str): The model property of type str. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. prices (List[Price]): The model property of type List[Price]. - use_site_exchange_rate (bool): Whether to use the site level exchange - rate or define your own prices for each currency if you have - multiple currencies defined on the site. Setting not supported - when creating price points in bulk. - tax_included (bool): Whether or not the price point includes tax. - Setting not supported when creating price points in bulk. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this price point - would renew every 30 days. This property is only available for - sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this price point, either month or day. This property is only - available for sites with Multifrequency enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + use_site_exchange_rate (bool): Whether to use the site level exchange rate or + define your own prices for each currency if you have multiple currencies + defined on the site. Setting not supported when creating price points in + bulk. + tax_included (bool): Whether or not the price point includes tax. Setting not + supported when creating price points in bulk. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this price point would renew every 30 + days. This property is only available for sites with Multifrequency + enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this price point, either month or day. This property is only available + for sites with Multifrequency enabled. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "pricing_scheme": 'pricing_scheme', - "prices": 'prices', - "handle": 'handle', - "use_site_exchange_rate": 'use_site_exchange_rate', - "tax_included": 'tax_included', - "interval": 'interval', - "interval_unit": 'interval_unit' + "name": "name", + "pricing_scheme": "pricing_scheme", + "prices": "prices", + "handle": "handle", + "use_site_exchange_rate": "use_site_exchange_rate", + "tax_included": "tax_included", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'handle', - 'use_site_exchange_rate', - 'tax_included', - 'interval', - 'interval_unit', + "handle", + "use_site_exchange_rate", + "tax_included", + "interval", + "interval_unit", ] _nullables = [ - 'interval_unit', + "interval_unit", ] - def __init__(self, - name=None, - pricing_scheme=None, - prices=None, - handle=APIHelper.SKIP, - use_site_exchange_rate=True, - tax_included=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateComponentPricePoint class""" - + def __init__( + self, + name=None, + pricing_scheme=None, + prices=None, + handle=APIHelper.SKIP, + use_site_exchange_rate=True, + tax_included=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateComponentPricePoint instance.""" # Initialize members of the class - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle - self.pricing_scheme = pricing_scheme - self.prices = prices - self.use_site_exchange_rate = use_site_exchange_rate + self.handle = handle + self.pricing_scheme = pricing_scheme + self.prices = prices + self.use_site_exchange_rate = use_site_exchange_rate if tax_included is not APIHelper.SKIP: - self.tax_included = tax_included + self.tax_included = tax_included if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -99,7 +99,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -110,23 +110,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if dictionary.get("use_site_exchange_rate") else True - tax_included = dictionary.get("tax_included") if "tax_included" in dictionary.keys() else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if dictionary.get("use_site_exchange_rate")\ + else True + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, pricing_scheme, @@ -140,7 +166,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -151,49 +177,132 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.pricing_scheme, - type_callable=lambda value: PricingScheme.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.prices, - type_callable=lambda value: Price.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.pricing_scheme, + type_callable=lambda value: + PricingScheme.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.prices, + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('name'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('pricing_scheme'), - type_callable=lambda value: PricingScheme.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('prices'), - type_callable=lambda value: Price.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("pricing_scheme"), + type_callable=lambda value: + PricingScheme.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("prices"), + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={self.prices!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"tax_included={_tax_included!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={self.prices!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"tax_included={_tax_included!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_component_price_point_request.py b/advancedbilling/models/create_component_price_point_request.py index 700f3b65..7a31dae1 100644 --- a/advancedbilling/models/create_component_price_point_request.py +++ b/advancedbilling/models/create_component_price_point_request.py @@ -1,39 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateComponentPricePointRequest(object): - """Implementation of the 'Create Component Price Point Request' model. Attributes: price_point (CreateComponentPricePoint | CreatePrepaidUsageComponentPricePoint): The model property of type CreateComponentPricePoint | CreatePrepaidUsageComponentPricePoint. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point": 'price_point' + "price_point": "price_point", } - def __init__(self, - price_point=None, - additional_properties=None): - """Constructor for the CreateComponentPricePointRequest class""" - + def __init__( + self, + price_point=None, + additional_properties=None): + """Initialize a CreateComponentPricePointRequest instance.""" # Initialize members of the class - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -43,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -54,22 +52,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateComponentPricePointRequestPricePoint'), dictionary.get('price_point'), False) if dictionary.get('price_point') is not None else None + price_point = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateComponentPricePointRequestPricePoint"), + dictionary.get("price_point"), + False)\ + if dictionary.get("price_point") is not None\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -80,22 +88,38 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('CreateComponentPricePointRequestPricePoint').validate(dictionary.price_point).is_valid + return (UnionTypeLookUp.get("CreateComponentPricePointRequestPricePoint") + .validate(dictionary.price_point).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('CreateComponentPricePointRequestPricePoint').validate(dictionary.get('price_point')).is_valid + return (UnionTypeLookUp.get("CreateComponentPricePointRequestPricePoint") + .validate(dictionary.get("price_point")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_component_price_points_request.py b/advancedbilling/models/create_component_price_points_request.py index fb10a69d..fb38e887 100644 --- a/advancedbilling/models/create_component_price_points_request.py +++ b/advancedbilling/models/create_component_price_points_request.py @@ -1,40 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateComponentPricePointsRequest(object): - """Implementation of the 'Create Component Price Points Request' model. Attributes: price_points (List[CreateComponentPricePoint | - CreatePrepaidUsageComponentPricePoint]): The model property of - type List[CreateComponentPricePoint | - CreatePrepaidUsageComponentPricePoint]. - additional_properties (Dict[str, object]): The additional properties - for the model. + CreatePrepaidUsageComponentPricePoint]): The model property of type + List[CreateComponentPricePoint | CreatePrepaidUsageComponentPricePoint]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_points": 'price_points' + "price_points": "price_points", } - def __init__(self, - price_points=None, - additional_properties=None): - """Constructor for the CreateComponentPricePointsRequest class""" - + def __init__( + self, + price_points=None, + additional_properties=None): + """Initialize a CreateComponentPricePointsRequest instance.""" # Initialize members of the class - self.price_points = price_points + self.price_points = price_points # Add additional model properties to the instance if additional_properties is None: @@ -44,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -55,22 +52,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_points = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateComponentPricePointsRequestPricePoints'), dictionary.get('price_points'), False) if dictionary.get('price_points') is not None else None + price_points = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateComponentPricePointsRequestPricePoints"), + dictionary.get("price_points"), + False)\ + if dictionary.get("price_points") is not None\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_points, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -81,22 +88,38 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('CreateComponentPricePointsRequestPricePoints').validate(dictionary.price_points).is_valid + return (UnionTypeLookUp.get("CreateComponentPricePointsRequestPricePoints") + .validate(dictionary.price_points).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('CreateComponentPricePointsRequestPricePoints').validate(dictionary.get('price_points')).is_valid + return (UnionTypeLookUp.get("CreateComponentPricePointsRequestPricePoints") + .validate(dictionary.get("price_points")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_credit_note_event.py b/advancedbilling/models/create_credit_note_event.py index 679f2dfc..ca35afc8 100644 --- a/advancedbilling/models/create_credit_note_event.py +++ b/advancedbilling/models/create_credit_note_event.py @@ -1,58 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.credit_note import ( + CreditNote, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class CreateCreditNoteEvent(object): - """Implementation of the 'Create Credit Note Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (CreditNote): Example schema for an `create_credit_note` - event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (CreditNote): Example schema for an `create_credit_note` event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='create_credit_note', - event_data=None, - additional_properties=None): - """Constructor for the CreateCreditNoteEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="create_credit_note", + event_data=None, + additional_properties=None): + """Initialize a CreateCreditNoteEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +76,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'create_credit_note' - event_data = CreditNote.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "create_credit_note" + event_data =\ + CreditNote.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +114,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +125,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: CreditNote.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + CreditNote.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: CreditNote.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + CreditNote.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_currency_price.py b/advancedbilling/models/create_currency_price.py index 35c63015..687cc96e 100644 --- a/advancedbilling/models/create_currency_price.py +++ b/advancedbilling/models/create_currency_price.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateCurrencyPrice(object): - """Implementation of the 'Create Currency Price' model. Attributes: currency (str): ISO code for a currency defined on the site level price (float): Price for the price level in this currency price_id (int): ID of the price that this corresponds with - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency": 'currency', - "price": 'price', - "price_id": 'price_id' + "currency": "currency", + "price": "price", + "price_id": "price_id", } _optionals = [ - 'currency', - 'price', - 'price_id', + "currency", + "price", + "price_id", ] - def __init__(self, - currency=APIHelper.SKIP, - price=APIHelper.SKIP, - price_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateCurrencyPrice class""" - + def __init__( + self, + currency=APIHelper.SKIP, + price=APIHelper.SKIP, + price_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateCurrencyPrice instance.""" # Initialize members of the class if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if price is not APIHelper.SKIP: - self.price = price + self.price = price if price_id is not APIHelper.SKIP: - self.price_id = price_id + self.price_id = price_id # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - price = dictionary.get("price") if dictionary.get("price") else APIHelper.SKIP - price_id = dictionary.get("price_id") if dictionary.get("price_id") else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + price =\ + dictionary.get("price")\ + if dictionary.get("price")\ + else APIHelper.SKIP + price_id =\ + dictionary.get("price_id")\ + if dictionary.get("price_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency, price, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'price={(self.price if hasattr(self, "price") else None)!r}, ' - f'price_id={(self.price_id if hasattr(self, "price_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _price_id=( + self.price_id + if hasattr(self, "price_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency={_currency!r}, " + f"price={_price!r}, " + f"price_id={_price_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'price={(self.price if hasattr(self, "price") else None)!s}, ' - f'price_id={(self.price_id if hasattr(self, "price_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _price_id=( + self.price_id + if hasattr(self, "price_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency={_currency!s}, " + f"price={_price!s}, " + f"price_id={_price_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_currency_prices_request.py b/advancedbilling/models/create_currency_prices_request.py index 3c07d450..6f432a73 100644 --- a/advancedbilling/models/create_currency_prices_request.py +++ b/advancedbilling/models/create_currency_prices_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_currency_price import CreateCurrencyPrice +# ruff: noqa: E501 +from advancedbilling.models.create_currency_price import ( + CreateCurrencyPrice, +) -class CreateCurrencyPricesRequest(object): +class CreateCurrencyPricesRequest(object): """Implementation of the 'Create Currency Prices Request' model. Attributes: - currency_prices (List[CreateCurrencyPrice]): The model property of - type List[CreateCurrencyPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + currency_prices (List[CreateCurrencyPrice]): The model property of type + List[CreateCurrencyPrice]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency_prices": 'currency_prices' + "currency_prices": "currency_prices", } - def __init__(self, - currency_prices=None, - additional_properties=None): - """Constructor for the CreateCurrencyPricesRequest class""" - + def __init__( + self, + currency_prices=None, + additional_properties=None): + """Initialize a CreateCurrencyPricesRequest instance.""" # Initialize members of the class - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [CreateCurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + CreateCurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency_prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_customer.py b/advancedbilling/models/create_customer.py index f4ac65ae..b1ba4709 100644 --- a/advancedbilling/models/create_customer.py +++ b/advancedbilling/models/create_customer.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateCustomer(object): - """Implementation of the 'Create Customer' model. Attributes: @@ -31,120 +29,120 @@ class CreateCustomer(object): vat_number (str): The model property of type str. tax_exempt (bool): The model property of type bool. tax_exempt_reason (str): The model property of type str. - parent_id (int): The parent ID in Chargify if applicable. Parent is - another Customer object. + parent_id (int): The parent ID in Chargify if applicable. Parent is another + Customer object. salesforce_id (str): The Salesforce ID of the customer - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "email": 'email', - "cc_emails": 'cc_emails', - "organization": 'organization', - "reference": 'reference', - "address": 'address', - "address_2": 'address_2', - "city": 'city', - "state": 'state', - "zip": 'zip', - "country": 'country', - "phone": 'phone', - "locale": 'locale', - "vat_number": 'vat_number', - "tax_exempt": 'tax_exempt', - "tax_exempt_reason": 'tax_exempt_reason', - "parent_id": 'parent_id', - "salesforce_id": 'salesforce_id' + "first_name": "first_name", + "last_name": "last_name", + "email": "email", + "cc_emails": "cc_emails", + "organization": "organization", + "reference": "reference", + "address": "address", + "address_2": "address_2", + "city": "city", + "state": "state", + "zip": "zip", + "country": "country", + "phone": "phone", + "locale": "locale", + "vat_number": "vat_number", + "tax_exempt": "tax_exempt", + "tax_exempt_reason": "tax_exempt_reason", + "parent_id": "parent_id", + "salesforce_id": "salesforce_id", } _optionals = [ - 'cc_emails', - 'organization', - 'reference', - 'address', - 'address_2', - 'city', - 'state', - 'zip', - 'country', - 'phone', - 'locale', - 'vat_number', - 'tax_exempt', - 'tax_exempt_reason', - 'parent_id', - 'salesforce_id', + "cc_emails", + "organization", + "reference", + "address", + "address_2", + "city", + "state", + "zip", + "country", + "phone", + "locale", + "vat_number", + "tax_exempt", + "tax_exempt_reason", + "parent_id", + "salesforce_id", ] _nullables = [ - 'parent_id', - 'salesforce_id', + "parent_id", + "salesforce_id", ] - def __init__(self, - first_name=None, - last_name=None, - email=None, - cc_emails=APIHelper.SKIP, - organization=APIHelper.SKIP, - reference=APIHelper.SKIP, - address=APIHelper.SKIP, - address_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - phone=APIHelper.SKIP, - locale=APIHelper.SKIP, - vat_number=APIHelper.SKIP, - tax_exempt=APIHelper.SKIP, - tax_exempt_reason=APIHelper.SKIP, - parent_id=APIHelper.SKIP, - salesforce_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateCustomer class""" - + def __init__( + self, + first_name=None, + last_name=None, + email=None, + cc_emails=APIHelper.SKIP, + organization=APIHelper.SKIP, + reference=APIHelper.SKIP, + address=APIHelper.SKIP, + address_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + phone=APIHelper.SKIP, + locale=APIHelper.SKIP, + vat_number=APIHelper.SKIP, + tax_exempt=APIHelper.SKIP, + tax_exempt_reason=APIHelper.SKIP, + parent_id=APIHelper.SKIP, + salesforce_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateCustomer instance.""" # Initialize members of the class - self.first_name = first_name - self.last_name = last_name - self.email = email + self.first_name = first_name + self.last_name = last_name + self.email = email if cc_emails is not APIHelper.SKIP: - self.cc_emails = cc_emails + self.cc_emails = cc_emails if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if address is not APIHelper.SKIP: - self.address = address + self.address = address if address_2 is not APIHelper.SKIP: - self.address_2 = address_2 + self.address_2 = address_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone if locale is not APIHelper.SKIP: - self.locale = locale + self.locale = locale if vat_number is not APIHelper.SKIP: - self.vat_number = vat_number + self.vat_number = vat_number if tax_exempt is not APIHelper.SKIP: - self.tax_exempt = tax_exempt + self.tax_exempt = tax_exempt if tax_exempt_reason is not APIHelper.SKIP: - self.tax_exempt_reason = tax_exempt_reason + self.tax_exempt_reason = tax_exempt_reason if parent_id is not APIHelper.SKIP: - self.parent_id = parent_id + self.parent_id = parent_id if salesforce_id is not APIHelper.SKIP: - self.salesforce_id = salesforce_id + self.salesforce_id = salesforce_id # Add additional model properties to the instance if additional_properties is None: @@ -154,7 +152,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -165,32 +163,91 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else None - last_name = dictionary.get("last_name") if dictionary.get("last_name") else None - email = dictionary.get("email") if dictionary.get("email") else None - cc_emails = dictionary.get("cc_emails") if dictionary.get("cc_emails") else APIHelper.SKIP - organization = dictionary.get("organization") if dictionary.get("organization") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP - address = dictionary.get("address") if dictionary.get("address") else APIHelper.SKIP - address_2 = dictionary.get("address_2") if dictionary.get("address_2") else APIHelper.SKIP - city = dictionary.get("city") if dictionary.get("city") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - zip = dictionary.get("zip") if dictionary.get("zip") else APIHelper.SKIP - country = dictionary.get("country") if dictionary.get("country") else APIHelper.SKIP - phone = dictionary.get("phone") if dictionary.get("phone") else APIHelper.SKIP - locale = dictionary.get("locale") if dictionary.get("locale") else APIHelper.SKIP - vat_number = dictionary.get("vat_number") if dictionary.get("vat_number") else APIHelper.SKIP - tax_exempt = dictionary.get("tax_exempt") if "tax_exempt" in dictionary.keys() else APIHelper.SKIP - tax_exempt_reason = dictionary.get("tax_exempt_reason") if dictionary.get("tax_exempt_reason") else APIHelper.SKIP - parent_id = dictionary.get("parent_id") if "parent_id" in dictionary.keys() else APIHelper.SKIP - salesforce_id = dictionary.get("salesforce_id") if "salesforce_id" in dictionary.keys() else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else None + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else None + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else None + cc_emails =\ + dictionary.get("cc_emails")\ + if dictionary.get("cc_emails")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if dictionary.get("organization")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + address =\ + dictionary.get("address")\ + if dictionary.get("address")\ + else APIHelper.SKIP + address_2 =\ + dictionary.get("address_2")\ + if dictionary.get("address_2")\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if dictionary.get("city")\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if dictionary.get("zip")\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if dictionary.get("country")\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if dictionary.get("phone")\ + else APIHelper.SKIP + locale =\ + dictionary.get("locale")\ + if dictionary.get("locale")\ + else APIHelper.SKIP + vat_number =\ + dictionary.get("vat_number")\ + if dictionary.get("vat_number")\ + else APIHelper.SKIP + tax_exempt =\ + dictionary.get("tax_exempt")\ + if "tax_exempt" in dictionary.keys()\ + else APIHelper.SKIP + tax_exempt_reason =\ + dictionary.get("tax_exempt_reason")\ + if dictionary.get("tax_exempt_reason")\ + else APIHelper.SKIP + parent_id =\ + dictionary.get("parent_id")\ + if "parent_id" in dictionary.keys()\ + else APIHelper.SKIP + salesforce_id =\ + dictionary.get("salesforce_id")\ + if "salesforce_id" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -214,47 +271,223 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={self.first_name!r}, ' - f'last_name={self.last_name!r}, ' - f'email={self.email!r}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!r}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!r}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!r}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!r}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=self.first_name + _last_name=self.last_name + _email=self.email + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"email={_email!r}, " + f"cc_emails={_cc_emails!r}, " + f"organization={_organization!r}, " + f"reference={_reference!r}, " + f"address={_address!r}, " + f"address_2={_address_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"phone={_phone!r}, " + f"locale={_locale!r}, " + f"vat_number={_vat_number!r}, " + f"tax_exempt={_tax_exempt!r}, " + f"tax_exempt_reason={_tax_exempt_reason!r}, " + f"parent_id={_parent_id!r}, " + f"salesforce_id={_salesforce_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={self.first_name!s}, ' - f'last_name={self.last_name!s}, ' - f'email={self.email!s}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!s}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!s}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!s}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!s}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=self.first_name + _last_name=self.last_name + _email=self.email + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"email={_email!s}, " + f"cc_emails={_cc_emails!s}, " + f"organization={_organization!s}, " + f"reference={_reference!s}, " + f"address={_address!s}, " + f"address_2={_address_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"phone={_phone!s}, " + f"locale={_locale!s}, " + f"vat_number={_vat_number!s}, " + f"tax_exempt={_tax_exempt!s}, " + f"tax_exempt_reason={_tax_exempt_reason!s}, " + f"parent_id={_parent_id!s}, " + f"salesforce_id={_salesforce_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_customer_request.py b/advancedbilling/models/create_customer_request.py index 4fa8d5c4..c7ffa27c 100644 --- a/advancedbilling/models/create_customer_request.py +++ b/advancedbilling/models/create_customer_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_customer import CreateCustomer +# ruff: noqa: E501 +from advancedbilling.models.create_customer import ( + CreateCustomer, +) -class CreateCustomerRequest(object): +class CreateCustomerRequest(object): """Implementation of the 'Create Customer Request' model. Attributes: customer (CreateCustomer): The model property of type CreateCustomer. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "customer": 'customer' + "customer": "customer", } - def __init__(self, - customer=None, - additional_properties=None): - """Constructor for the CreateCustomerRequest class""" - + def __init__( + self, + customer=None, + additional_properties=None): + """Initialize a CreateCustomerRequest instance.""" # Initialize members of the class - self.customer = customer + self.customer = customer # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - customer = CreateCustomer.from_dictionary(dictionary.get('customer')) if dictionary.get('customer') else None + customer =\ + CreateCustomer.from_dictionary( + dictionary.get("customer"))\ + if dictionary.get("customer") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(customer, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'customer={self.customer!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'customer={self.customer!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_debit_note_event.py b/advancedbilling/models/create_debit_note_event.py index 4272c551..f28f2d41 100644 --- a/advancedbilling/models/create_debit_note_event.py +++ b/advancedbilling/models/create_debit_note_event.py @@ -1,57 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.debit_note import DebitNote +from advancedbilling.models.debit_note import ( + DebitNote, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class CreateDebitNoteEvent(object): - """Implementation of the 'Create Debit Note Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. + event_type (InvoiceEventType): The model property of type InvoiceEventType. event_data (DebitNote): Example schema for an `create_debit_note` event - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='create_debit_note', - event_data=None, - additional_properties=None): - """Constructor for the CreateDebitNoteEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="create_debit_note", + event_data=None, + additional_properties=None): + """Initialize a CreateDebitNoteEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -61,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -72,18 +76,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'create_debit_note' - event_data = DebitNote.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "create_debit_note" + event_data =\ + DebitNote.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -94,7 +114,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -105,51 +125,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: DebitNote.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + DebitNote.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: DebitNote.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + DebitNote.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_ebb_component.py b/advancedbilling/models/create_ebb_component.py index a5a73b01..57a649d3 100644 --- a/advancedbilling/models/create_ebb_component.py +++ b/advancedbilling/models/create_ebb_component.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.ebb_component import EBBComponent +# ruff: noqa: E501 +from advancedbilling.models.ebb_component import ( + EBBComponent, +) -class CreateEBBComponent(object): +class CreateEBBComponent(object): """Implementation of the 'Create EBB Component' model. Attributes: - event_based_component (EBBComponent): The model property of type - EBBComponent. - additional_properties (Dict[str, object]): The additional properties - for the model. + event_based_component (EBBComponent): The model property of type EBBComponent. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "event_based_component": 'event_based_component' + "event_based_component": "event_based_component", } - def __init__(self, - event_based_component=None, - additional_properties=None): - """Constructor for the CreateEBBComponent class""" - + def __init__( + self, + event_based_component=None, + additional_properties=None): + """Initialize a CreateEBBComponent instance.""" # Initialize members of the class - self.event_based_component = event_based_component + self.event_based_component = event_based_component # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - event_based_component = EBBComponent.from_dictionary(dictionary.get('event_based_component')) if dictionary.get('event_based_component') else None + event_based_component =\ + EBBComponent.from_dictionary( + dictionary.get("event_based_component"))\ + if dictionary.get("event_based_component") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(event_based_component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'event_based_component={self.event_based_component!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _event_based_component=self.event_based_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event_based_component={_event_based_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'event_based_component={self.event_based_component!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _event_based_component=self.event_based_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event_based_component={_event_based_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice.py b/advancedbilling/models/create_invoice.py index acc61660..22c98585 100644 --- a/advancedbilling/models/create_invoice.py +++ b/advancedbilling/models/create_invoice.py @@ -1,21 +1,25 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_invoice_address import CreateInvoiceAddress -from advancedbilling.models.create_invoice_coupon import CreateInvoiceCoupon -from advancedbilling.models.create_invoice_item import CreateInvoiceItem +from advancedbilling.models.create_invoice_address import ( + CreateInvoiceAddress, +) +from advancedbilling.models.create_invoice_coupon import ( + CreateInvoiceCoupon, +) +from advancedbilling.models.create_invoice_item import ( + CreateInvoiceItem, +) class CreateInvoice(object): - """Implementation of the 'Create Invoice' model. Attributes: @@ -24,86 +28,83 @@ class CreateInvoice(object): issue_date (date): The model property of type date. net_terms (int): By default, invoices will be created with a due date matching the date of invoice creation. If a different due date is - desired, the net_terms parameter can be sent indicating the number - of days in advance the due date should be. + desired, the net_terms parameter can be sent indicating the number of + days in advance the due date should be. payment_instructions (str): The model property of type str. memo (str): A custom memo can be sent to override the site's default. - seller_address (CreateInvoiceAddress): Overrides the defaults for the - site - billing_address (CreateInvoiceAddress): Overrides the default for the - customer + seller_address (CreateInvoiceAddress): Overrides the defaults for the site + billing_address (CreateInvoiceAddress): Overrides the default for the customer shipping_address (CreateInvoiceAddress): Overrides the default for the customer coupons (List[CreateInvoiceCoupon]): The model property of type List[CreateInvoiceCoupon]. - status (CreateInvoiceStatus): The model property of type - CreateInvoiceStatus. - additional_properties (Dict[str, object]): The additional properties - for the model. + status (CreateInvoiceStatus): The model property of type CreateInvoiceStatus. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "line_items": 'line_items', - "issue_date": 'issue_date', - "net_terms": 'net_terms', - "payment_instructions": 'payment_instructions', - "memo": 'memo', - "seller_address": 'seller_address', - "billing_address": 'billing_address', - "shipping_address": 'shipping_address', - "coupons": 'coupons', - "status": 'status' + "line_items": "line_items", + "issue_date": "issue_date", + "net_terms": "net_terms", + "payment_instructions": "payment_instructions", + "memo": "memo", + "seller_address": "seller_address", + "billing_address": "billing_address", + "shipping_address": "shipping_address", + "coupons": "coupons", + "status": "status", } _optionals = [ - 'line_items', - 'issue_date', - 'net_terms', - 'payment_instructions', - 'memo', - 'seller_address', - 'billing_address', - 'shipping_address', - 'coupons', - 'status', + "line_items", + "issue_date", + "net_terms", + "payment_instructions", + "memo", + "seller_address", + "billing_address", + "shipping_address", + "coupons", + "status", ] - def __init__(self, - line_items=APIHelper.SKIP, - issue_date=APIHelper.SKIP, - net_terms=APIHelper.SKIP, - payment_instructions=APIHelper.SKIP, - memo=APIHelper.SKIP, - seller_address=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - shipping_address=APIHelper.SKIP, - coupons=APIHelper.SKIP, - status='open', - additional_properties=None): - """Constructor for the CreateInvoice class""" - + def __init__( + self, + line_items=APIHelper.SKIP, + issue_date=APIHelper.SKIP, + net_terms=APIHelper.SKIP, + payment_instructions=APIHelper.SKIP, + memo=APIHelper.SKIP, + seller_address=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + coupons=APIHelper.SKIP, + status="open", + additional_properties=None): + """Initialize a CreateInvoice instance.""" # Initialize members of the class if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if issue_date is not APIHelper.SKIP: - self.issue_date = issue_date + self.issue_date = issue_date if net_terms is not APIHelper.SKIP: - self.net_terms = net_terms + self.net_terms = net_terms if payment_instructions is not APIHelper.SKIP: - self.payment_instructions = payment_instructions + self.payment_instructions = payment_instructions if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if seller_address is not APIHelper.SKIP: - self.seller_address = seller_address + self.seller_address = seller_address if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if shipping_address is not APIHelper.SKIP: - self.shipping_address = shipping_address + self.shipping_address = shipping_address if coupons is not APIHelper.SKIP: - self.coupons = coupons - self.status = status + self.coupons = coupons + self.status = status # Add additional model properties to the instance if additional_properties is None: @@ -113,7 +114,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -124,31 +125,65 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary line_items = None - if dictionary.get('line_items') is not None: - line_items = [CreateInvoiceItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + CreateInvoiceItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP - issue_date = dateutil.parser.parse(dictionary.get('issue_date')).date() if dictionary.get('issue_date') else APIHelper.SKIP - net_terms = dictionary.get("net_terms") if dictionary.get("net_terms") else APIHelper.SKIP - payment_instructions = dictionary.get("payment_instructions") if dictionary.get("payment_instructions") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - seller_address = CreateInvoiceAddress.from_dictionary(dictionary.get('seller_address')) if 'seller_address' in dictionary.keys() else APIHelper.SKIP - billing_address = CreateInvoiceAddress.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP - shipping_address = CreateInvoiceAddress.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP + issue_date = dateutil.parser.parse( + dictionary.get("issue_date")).date()\ + if dictionary.get("issue_date") else APIHelper.SKIP + net_terms =\ + dictionary.get("net_terms")\ + if dictionary.get("net_terms")\ + else APIHelper.SKIP + payment_instructions =\ + dictionary.get("payment_instructions")\ + if dictionary.get("payment_instructions")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + seller_address =\ + CreateInvoiceAddress.from_dictionary( + dictionary.get("seller_address"))\ + if "seller_address" in dictionary.keys()\ + else APIHelper.SKIP + billing_address =\ + CreateInvoiceAddress.from_dictionary( + dictionary.get("billing_address"))\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + shipping_address =\ + CreateInvoiceAddress.from_dictionary( + dictionary.get("shipping_address"))\ + if "shipping_address" in dictionary.keys()\ + else APIHelper.SKIP coupons = None - if dictionary.get('coupons') is not None: - coupons = [CreateInvoiceCoupon.from_dictionary(x) for x in dictionary.get('coupons')] + if dictionary.get("coupons") is not None: + coupons = [ + CreateInvoiceCoupon.from_dictionary(x) + for x in dictionary.get("coupons") + ] else: coupons = APIHelper.SKIP - status = dictionary.get("status") if dictionary.get("status") else 'open' + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else "open" + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(line_items, issue_date, @@ -163,29 +198,139 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!r}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!r}, ' - f'payment_instructions={(self.payment_instructions if hasattr(self, "payment_instructions") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'seller_address={(self.seller_address if hasattr(self, "seller_address") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' - f'coupons={(self.coupons if hasattr(self, "coupons") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _seller_address=( + self.seller_address + if hasattr(self, "seller_address") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"line_items={_line_items!r}, " + f"issue_date={_issue_date!r}, " + f"net_terms={_net_terms!r}, " + f"payment_instructions={_payment_instructions!r}, " + f"memo={_memo!r}, " + f"seller_address={_seller_address!r}, " + f"billing_address={_billing_address!r}, " + f"shipping_address={_shipping_address!r}, " + f"coupons={_coupons!r}, " + f"status={_status!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!s}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!s}, ' - f'payment_instructions={(self.payment_instructions if hasattr(self, "payment_instructions") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'seller_address={(self.seller_address if hasattr(self, "seller_address") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' - f'coupons={(self.coupons if hasattr(self, "coupons") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _seller_address=( + self.seller_address + if hasattr(self, "seller_address") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"line_items={_line_items!s}, " + f"issue_date={_issue_date!s}, " + f"net_terms={_net_terms!s}, " + f"payment_instructions={_payment_instructions!s}, " + f"memo={_memo!s}, " + f"seller_address={_seller_address!s}, " + f"billing_address={_billing_address!s}, " + f"shipping_address={_shipping_address!s}, " + f"coupons={_coupons!s}, " + f"status={_status!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_address.py b/advancedbilling/models/create_invoice_address.py index 89f4e68d..c3a4fa5b 100644 --- a/advancedbilling/models/create_invoice_address.py +++ b/advancedbilling/models/create_invoice_address.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateInvoiceAddress(object): - """Implementation of the 'Create Invoice Address' model. Overrides the default address. @@ -25,68 +23,68 @@ class CreateInvoiceAddress(object): state (str): The model property of type str. zip (str): The model property of type str. country (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "phone": 'phone', - "address": 'address', - "address_2": 'address_2', - "city": 'city', - "state": 'state', - "zip": 'zip', - "country": 'country' + "first_name": "first_name", + "last_name": "last_name", + "phone": "phone", + "address": "address", + "address_2": "address_2", + "city": "city", + "state": "state", + "zip": "zip", + "country": "country", } _optionals = [ - 'first_name', - 'last_name', - 'phone', - 'address', - 'address_2', - 'city', - 'state', - 'zip', - 'country', + "first_name", + "last_name", + "phone", + "address", + "address_2", + "city", + "state", + "zip", + "country", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - phone=APIHelper.SKIP, - address=APIHelper.SKIP, - address_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateInvoiceAddress class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + phone=APIHelper.SKIP, + address=APIHelper.SKIP, + address_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateInvoiceAddress instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone if address is not APIHelper.SKIP: - self.address = address + self.address = address if address_2 is not APIHelper.SKIP: - self.address_2 = address_2 + self.address_2 = address_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country # Add additional model properties to the instance if additional_properties is None: @@ -96,7 +94,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -107,22 +105,51 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - phone = dictionary.get("phone") if dictionary.get("phone") else APIHelper.SKIP - address = dictionary.get("address") if dictionary.get("address") else APIHelper.SKIP - address_2 = dictionary.get("address_2") if dictionary.get("address_2") else APIHelper.SKIP - city = dictionary.get("city") if dictionary.get("city") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - zip = dictionary.get("zip") if dictionary.get("zip") else APIHelper.SKIP - country = dictionary.get("country") if dictionary.get("country") else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if dictionary.get("phone")\ + else APIHelper.SKIP + address =\ + dictionary.get("address")\ + if dictionary.get("address")\ + else APIHelper.SKIP + address_2 =\ + dictionary.get("address_2")\ + if dictionary.get("address_2")\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if dictionary.get("city")\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if dictionary.get("zip")\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if dictionary.get("country")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -136,27 +163,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"phone={_phone!r}, " + f"address={_address!r}, " + f"address_2={_address_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"phone={_phone!s}, " + f"address={_address!s}, " + f"address_2={_address_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_coupon.py b/advancedbilling/models/create_invoice_coupon.py index 123aeeb2..ca96ff2d 100644 --- a/advancedbilling/models/create_invoice_coupon.py +++ b/advancedbilling/models/create_invoice_coupon.py @@ -1,86 +1,82 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateInvoiceCoupon(object): - """Implementation of the 'Create Invoice Coupon' model. Attributes: code (str): The model property of type str. subcode (str): The model property of type str. - percentage (str | float | None): The model property of type str | - float | None. - amount (str | float | None): The model property of type str | float | + percentage (str | float | None): The model property of type str | float | None. + amount (str | float | None): The model property of type str | float | None. description (str): The model property of type str. - product_family_id (str | int | None): The model property of type str | - int | None. - compounding_strategy (CompoundingStrategy): Applicable only to - stackable coupons. For `compound`, Percentage-based discounts will - be calculated against the remaining price, after prior discounts - have been calculated. For `full-price`, Percentage-based discounts - will always be calculated against the original item price, before - other discounts are applied. - additional_properties (Dict[str, object]): The additional properties - for the model. + product_family_id (str | int | None): The model property of type str | int | + None. + compounding_strategy (CompoundingStrategy): Applicable only to stackable + coupons. For `compound`, Percentage-based discounts will be calculated + against the remaining price, after prior discounts have been calculated. + For `full-price`, Percentage-based discounts will always be calculated + against the original item price, before other discounts are applied. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "code": 'code', - "subcode": 'subcode', - "percentage": 'percentage', - "amount": 'amount', - "description": 'description', - "product_family_id": 'product_family_id', - "compounding_strategy": 'compounding_strategy' + "code": "code", + "subcode": "subcode", + "percentage": "percentage", + "amount": "amount", + "description": "description", + "product_family_id": "product_family_id", + "compounding_strategy": "compounding_strategy", } _optionals = [ - 'code', - 'subcode', - 'percentage', - 'amount', - 'description', - 'product_family_id', - 'compounding_strategy', + "code", + "subcode", + "percentage", + "amount", + "description", + "product_family_id", + "compounding_strategy", ] - def __init__(self, - code=APIHelper.SKIP, - subcode=APIHelper.SKIP, - percentage=APIHelper.SKIP, - amount=APIHelper.SKIP, - description=APIHelper.SKIP, - product_family_id=APIHelper.SKIP, - compounding_strategy=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateInvoiceCoupon class""" - + def __init__( + self, + code=APIHelper.SKIP, + subcode=APIHelper.SKIP, + percentage=APIHelper.SKIP, + amount=APIHelper.SKIP, + description=APIHelper.SKIP, + product_family_id=APIHelper.SKIP, + compounding_strategy=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateInvoiceCoupon instance.""" # Initialize members of the class if code is not APIHelper.SKIP: - self.code = code + self.code = code if subcode is not APIHelper.SKIP: - self.subcode = subcode + self.subcode = subcode if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount if description is not APIHelper.SKIP: - self.description = description + self.description = description if product_family_id is not APIHelper.SKIP: - self.product_family_id = product_family_id + self.product_family_id = product_family_id if compounding_strategy is not APIHelper.SKIP: - self.compounding_strategy = compounding_strategy + self.compounding_strategy = compounding_strategy # Add additional model properties to the instance if additional_properties is None: @@ -90,7 +86,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -101,21 +97,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - subcode = dictionary.get("subcode") if dictionary.get("subcode") else APIHelper.SKIP - percentage = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceCouponPercentage'), dictionary.get('percentage'), False) if dictionary.get('percentage') is not None else APIHelper.SKIP - amount = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceCouponAmount'), dictionary.get('amount'), False) if dictionary.get('amount') is not None else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - product_family_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceCouponProductFamilyId'), dictionary.get('product_family_id'), False) if dictionary.get('product_family_id') is not None else APIHelper.SKIP - compounding_strategy = dictionary.get("compounding_strategy") if dictionary.get("compounding_strategy") else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + subcode =\ + dictionary.get("subcode")\ + if dictionary.get("subcode")\ + else APIHelper.SKIP + percentage = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceCouponPercentage"), + dictionary.get("percentage"), + False)\ + if dictionary.get("percentage") is not None\ + else APIHelper.SKIP + amount = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceCouponAmount"), + dictionary.get("amount"), + False)\ + if dictionary.get("amount") is not None\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + product_family_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceCouponProductFamilyId"), + dictionary.get("product_family_id"), + False)\ + if dictionary.get("product_family_id") is not None\ + else APIHelper.SKIP + compounding_strategy =\ + dictionary.get("compounding_strategy")\ + if dictionary.get("compounding_strategy")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(code, subcode, @@ -127,23 +155,103 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'subcode={(self.subcode if hasattr(self, "subcode") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!r}, ' - f'compounding_strategy={(self.compounding_strategy if hasattr(self, "compounding_strategy") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _code=( + self.code + if hasattr(self, "code") + else None + ) + _subcode=( + self.subcode + if hasattr(self, "subcode") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _compounding_strategy=( + self.compounding_strategy + if hasattr(self, "compounding_strategy") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!r}, " + f"subcode={_subcode!r}, " + f"percentage={_percentage!r}, " + f"amount={_amount!r}, " + f"description={_description!r}, " + f"product_family_id={_product_family_id!r}, " + f"compounding_strategy={_compounding_strategy!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'subcode={(self.subcode if hasattr(self, "subcode") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!s}, ' - f'compounding_strategy={(self.compounding_strategy if hasattr(self, "compounding_strategy") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _code=( + self.code + if hasattr(self, "code") + else None + ) + _subcode=( + self.subcode + if hasattr(self, "subcode") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _compounding_strategy=( + self.compounding_strategy + if hasattr(self, "compounding_strategy") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!s}, " + f"subcode={_subcode!s}, " + f"percentage={_percentage!s}, " + f"amount={_amount!s}, " + f"description={_description!s}, " + f"product_family_id={_product_family_id!s}, " + f"compounding_strategy={_compounding_strategy!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_item.py b/advancedbilling/models/create_invoice_item.py index 4eae59c4..c69e4643 100644 --- a/advancedbilling/models/create_invoice_item.py +++ b/advancedbilling/models/create_invoice_item.py @@ -1,121 +1,117 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateInvoiceItem(object): - """Implementation of the 'Create Invoice Item' model. Attributes: title (str): The model property of type str. - quantity (float | str | None): The quantity can contain up to 8 - decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a - value with more than 8 decimal places, we will round it down to - the 8th decimal place. - unit_price (float | str | None): The unit_price can contain up to 8 - decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a - value with more than 8 decimal places, we will round it down to - the 8th decimal place. - taxable (bool): Set to true to automatically calculate taxes. Site - must be configured to use and calculate taxes. If using AvaTax, a - tax_code parameter must also be sent. - tax_code (str): A string representing the tax code related to the - product type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. + quantity (float | str | None): The quantity can contain up to 8 decimal + places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with + more than 8 decimal places, we will round it down to the 8th decimal + place. + unit_price (float | str | None): The unit_price can contain up to 8 decimal + places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with + more than 8 decimal places, we will round it down to the 8th decimal + place. + taxable (bool): Set to true to automatically calculate taxes. Site must be + configured to use and calculate taxes. If using AvaTax, a tax_code + parameter must also be sent. + tax_code (str): A string representing the tax code related to the product + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. period_range_start (str): YYYY-MM-DD period_range_end (str): YYYY-MM-DD product_id (str | int | None): Product handle or product id. component_id (str | int | None): Component handle or component id. - price_point_id (str | int | None): Price point handle or id. For - component. - product_price_point_id (str | int | None): The model property of type - str | int | None. + price_point_id (str | int | None): Price point handle or id. For component. + product_price_point_id (str | int | None): The model property of type str | + int | None. description (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "title": 'title', - "quantity": 'quantity', - "unit_price": 'unit_price', - "taxable": 'taxable', - "tax_code": 'tax_code', - "period_range_start": 'period_range_start', - "period_range_end": 'period_range_end', - "product_id": 'product_id', - "component_id": 'component_id', - "price_point_id": 'price_point_id', - "product_price_point_id": 'product_price_point_id', - "description": 'description' + "title": "title", + "quantity": "quantity", + "unit_price": "unit_price", + "taxable": "taxable", + "tax_code": "tax_code", + "period_range_start": "period_range_start", + "period_range_end": "period_range_end", + "product_id": "product_id", + "component_id": "component_id", + "price_point_id": "price_point_id", + "product_price_point_id": "product_price_point_id", + "description": "description", } _optionals = [ - 'title', - 'quantity', - 'unit_price', - 'taxable', - 'tax_code', - 'period_range_start', - 'period_range_end', - 'product_id', - 'component_id', - 'price_point_id', - 'product_price_point_id', - 'description', + "title", + "quantity", + "unit_price", + "taxable", + "tax_code", + "period_range_start", + "period_range_end", + "product_id", + "component_id", + "price_point_id", + "product_price_point_id", + "description", ] - def __init__(self, - title=APIHelper.SKIP, - quantity=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - taxable=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - period_range_start=APIHelper.SKIP, - period_range_end=APIHelper.SKIP, - product_id=APIHelper.SKIP, - component_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - description=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateInvoiceItem class""" - + def __init__( + self, + title=APIHelper.SKIP, + quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + taxable=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + period_range_start=APIHelper.SKIP, + period_range_end=APIHelper.SKIP, + product_id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + description=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateInvoiceItem instance.""" # Initialize members of the class if title is not APIHelper.SKIP: - self.title = title + self.title = title if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if taxable is not APIHelper.SKIP: - self.taxable = taxable + self.taxable = taxable if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if period_range_start is not APIHelper.SKIP: - self.period_range_start = period_range_start + self.period_range_start = period_range_start if period_range_end is not APIHelper.SKIP: - self.period_range_end = period_range_end + self.period_range_end = period_range_end if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if description is not APIHelper.SKIP: - self.description = description + self.description = description # Add additional model properties to the instance if additional_properties is None: @@ -125,7 +121,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -136,26 +132,79 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceItemQuantity'), dictionary.get('quantity'), False) if dictionary.get('quantity') is not None else APIHelper.SKIP - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceItemUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP - period_range_start = dictionary.get("period_range_start") if dictionary.get("period_range_start") else APIHelper.SKIP - period_range_end = dictionary.get("period_range_end") if dictionary.get("period_range_end") else APIHelper.SKIP - product_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceItemProductId'), dictionary.get('product_id'), False) if dictionary.get('product_id') is not None else APIHelper.SKIP - component_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceItemComponentId'), dictionary.get('component_id'), False) if dictionary.get('component_id') is not None else APIHelper.SKIP - price_point_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceItemPricePointId'), dictionary.get('price_point_id'), False) if dictionary.get('price_point_id') is not None else APIHelper.SKIP - product_price_point_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoiceItemProductPricePointId'), dictionary.get('product_price_point_id'), False) if dictionary.get('product_price_point_id') is not None else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceItemQuantity"), + dictionary.get("quantity"), + False)\ + if dictionary.get("quantity") is not None\ + else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceItemUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + period_range_start =\ + dictionary.get("period_range_start")\ + if dictionary.get("period_range_start")\ + else APIHelper.SKIP + period_range_end =\ + dictionary.get("period_range_end")\ + if dictionary.get("period_range_end")\ + else APIHelper.SKIP + product_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceItemProductId"), + dictionary.get("product_id"), + False)\ + if dictionary.get("product_id") is not None\ + else APIHelper.SKIP + component_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceItemComponentId"), + dictionary.get("component_id"), + False)\ + if dictionary.get("component_id") is not None\ + else APIHelper.SKIP + price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceItemPricePointId"), + dictionary.get("price_point_id"), + False)\ + if dictionary.get("price_point_id") is not None\ + else APIHelper.SKIP + product_price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoiceItemProductPricePointId"), + dictionary.get("product_price_point_id"), + False)\ + if dictionary.get("product_price_point_id") is not None\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(title, quantity, @@ -172,33 +221,163 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!r}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _title=( + self.title + if hasattr(self, "title") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"title={_title!r}, " + f"quantity={_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"taxable={_taxable!r}, " + f"tax_code={_tax_code!r}, " + f"period_range_start={_period_range_start!r}, " + f"period_range_end={_period_range_end!r}, " + f"product_id={_product_id!r}, " + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"description={_description!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!s}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _title=( + self.title + if hasattr(self, "title") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"title={_title!s}, " + f"quantity={_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"taxable={_taxable!s}, " + f"tax_code={_tax_code!s}, " + f"period_range_start={_period_range_start!s}, " + f"period_range_end={_period_range_end!s}, " + f"product_id={_product_id!s}, " + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"description={_description!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_payment.py b/advancedbilling/models/create_invoice_payment.py index a670d08e..8a321a4f 100644 --- a/advancedbilling/models/create_invoice_payment.py +++ b/advancedbilling/models/create_invoice_payment.py @@ -1,81 +1,78 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class CreateInvoicePayment(object): - """Implementation of the 'Create Invoice Payment' model. Attributes: - amount (str | float | None): A string of the dollar amount to be - refunded (eg. "10.50" => $10.50) - memo (str): A description to be attached to the payment. Applicable - only to `external` payments. - method (InvoicePaymentMethodType): The type of payment method used. - Defaults to other. - details (str): Additional information related to the payment method - (eg. Check #). Applicable only to `external` payments. - payment_profile_id (int): The ID of the payment profile to be used for - the payment. - received_on (date): Date reflecting when the payment was received from - a customer. Must be in the past. Applicable only to `external` - payments. - additional_properties (Dict[str, object]): The additional properties - for the model. + amount (str | float | None): A string of the dollar amount to be refunded + (eg. "10.50" => $10.50) + memo (str): A description to be attached to the payment. Applicable only to + `external` payments. + method (InvoicePaymentMethodType): The type of payment method used. Defaults + to other. + details (str): Additional information related to the payment method (eg. + Check #). Applicable only to `external` payments. + payment_profile_id (int): The ID of the payment profile to be used for the + payment. + received_on (date): Date reflecting when the payment was received from a + customer. Must be in the past. Applicable only to `external` payments. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "memo": 'memo', - "method": 'method', - "details": 'details', - "payment_profile_id": 'payment_profile_id', - "received_on": 'received_on' + "amount": "amount", + "memo": "memo", + "method": "method", + "details": "details", + "payment_profile_id": "payment_profile_id", + "received_on": "received_on", } _optionals = [ - 'amount', - 'memo', - 'method', - 'details', - 'payment_profile_id', - 'received_on', + "amount", + "memo", + "method", + "details", + "payment_profile_id", + "received_on", ] - def __init__(self, - amount=APIHelper.SKIP, - memo=APIHelper.SKIP, - method=APIHelper.SKIP, - details=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - received_on=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateInvoicePayment class""" - + def __init__( + self, + amount=APIHelper.SKIP, + memo=APIHelper.SKIP, + method=APIHelper.SKIP, + details=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + received_on=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateInvoicePayment instance.""" # Initialize members of the class if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if method is not APIHelper.SKIP: - self.method = method + self.method = method if details is not APIHelper.SKIP: - self.details = details + self.details = details if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if received_on is not APIHelper.SKIP: - self.received_on = received_on + self.received_on = received_on # Add additional model properties to the instance if additional_properties is None: @@ -85,7 +82,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -96,20 +93,44 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateInvoicePaymentAmount'), dictionary.get('amount'), False) if dictionary.get('amount') is not None else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - method = dictionary.get("method") if dictionary.get("method") else APIHelper.SKIP - details = dictionary.get("details") if dictionary.get("details") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - received_on = dateutil.parser.parse(dictionary.get('received_on')).date() if dictionary.get('received_on') else APIHelper.SKIP + amount = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateInvoicePaymentAmount"), + dictionary.get("amount"), + False)\ + if dictionary.get("amount") is not None\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + method =\ + dictionary.get("method")\ + if dictionary.get("method")\ + else APIHelper.SKIP + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + received_on = dateutil.parser.parse( + dictionary.get("received_on")).date()\ + if dictionary.get("received_on") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, memo, @@ -120,21 +141,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'method={(self.method if hasattr(self, "method") else None)!r}, ' - f'details={(self.details if hasattr(self, "details") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'received_on={(self.received_on if hasattr(self, "received_on") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _method=( + self.method + if hasattr(self, "method") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _received_on=( + self.received_on + if hasattr(self, "received_on") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"memo={_memo!r}, " + f"method={_method!r}, " + f"details={_details!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"received_on={_received_on!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'method={(self.method if hasattr(self, "method") else None)!s}, ' - f'details={(self.details if hasattr(self, "details") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'received_on={(self.received_on if hasattr(self, "received_on") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _method=( + self.method + if hasattr(self, "method") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _received_on=( + self.received_on + if hasattr(self, "received_on") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"memo={_memo!s}, " + f"method={_method!s}, " + f"details={_details!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"received_on={_received_on!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_payment_application.py b/advancedbilling/models/create_invoice_payment_application.py index 1e767786..1a3ae53b 100644 --- a/advancedbilling/models/create_invoice_payment_application.py +++ b/advancedbilling/models/create_invoice_payment_application.py @@ -1,43 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateInvoicePaymentApplication(object): - """Implementation of the 'Create Invoice Payment Application' model. Attributes: - invoice_uid (str): Unique identifier for the invoice. It has the - prefix "inv_" followed by alphanumeric characters. - amount (str): Dollar amount of the invoice payment (eg. "10.50" => - $10.50). - additional_properties (Dict[str, object]): The additional properties - for the model. + invoice_uid (str): Unique identifier for the invoice. It has the prefix + "inv_" followed by alphanumeric characters. + amount (str): Dollar amount of the invoice payment (eg. "10.50" => $10.50). + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "invoice_uid": 'invoice_uid', - "amount": 'amount' + "invoice_uid": "invoice_uid", + "amount": "amount", } - def __init__(self, - invoice_uid=None, - amount=None, - additional_properties=None): - """Constructor for the CreateInvoicePaymentApplication class""" - + def __init__( + self, + invoice_uid=None, + amount=None, + additional_properties=None): + """Initialize a CreateInvoicePaymentApplication instance.""" # Initialize members of the class - self.invoice_uid = invoice_uid - self.amount = amount + self.invoice_uid = invoice_uid + self.amount = amount # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,15 +55,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - invoice_uid = dictionary.get("invoice_uid") if dictionary.get("invoice_uid") else None - amount = dictionary.get("amount") if dictionary.get("amount") else None + invoice_uid =\ + dictionary.get("invoice_uid")\ + if dictionary.get("invoice_uid")\ + else None + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(invoice_uid, amount, @@ -74,7 +79,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -85,29 +90,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.invoice_uid, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.amount, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.invoice_uid, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.amount, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('invoice_uid'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('amount'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("invoice_uid"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoice_uid={self.invoice_uid!r}, ' - f'amount={self.amount!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _invoice_uid=self.invoice_uid + _amount=self.amount + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice_uid={_invoice_uid!r}, " + f"amount={_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoice_uid={self.invoice_uid!s}, ' - f'amount={self.amount!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _invoice_uid=self.invoice_uid + _amount=self.amount + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice_uid={_invoice_uid!s}, " + f"amount={_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_payment_request.py b/advancedbilling/models/create_invoice_payment_request.py index 74bb1574..d0c8c852 100644 --- a/advancedbilling/models/create_invoice_payment_request.py +++ b/advancedbilling/models/create_invoice_payment_request.py @@ -1,49 +1,49 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_invoice_payment import CreateInvoicePayment +from advancedbilling.models.create_invoice_payment import ( + CreateInvoicePayment, +) class CreateInvoicePaymentRequest(object): - """Implementation of the 'Create Invoice Payment Request' model. Attributes: payment (CreateInvoicePayment): The model property of type CreateInvoicePayment. - mtype (InvoicePaymentType): The type of payment to be applied to an - Invoice. Defaults to external. - additional_properties (Dict[str, object]): The additional properties - for the model. + mtype (InvoicePaymentType): The type of payment to be applied to an Invoice. + Defaults to external. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment": 'payment', - "mtype": 'type' + "payment": "payment", + "mtype": "type", } _optionals = [ - 'mtype', + "mtype", ] - def __init__(self, - payment=None, - mtype=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateInvoicePaymentRequest class""" - + def __init__( + self, + payment=None, + mtype=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateInvoicePaymentRequest instance.""" # Initialize members of the class - self.payment = payment + self.payment = payment if mtype is not APIHelper.SKIP: - self.mtype = mtype + self.mtype = mtype # Add additional model properties to the instance if additional_properties is None: @@ -53,7 +53,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -64,28 +64,58 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment = CreateInvoicePayment.from_dictionary(dictionary.get('payment')) if dictionary.get('payment') else None - mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP + payment =\ + CreateInvoicePayment.from_dictionary( + dictionary.get("payment"))\ + if dictionary.get("payment") else None + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment, mtype, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!r}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment=self.payment + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!r}, " + f"mtype={_mtype!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!s}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment=self.payment + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!s}, " + f"mtype={_mtype!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_request.py b/advancedbilling/models/create_invoice_request.py index 9ad0cb52..f375f5e7 100644 --- a/advancedbilling/models/create_invoice_request.py +++ b/advancedbilling/models/create_invoice_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_invoice import CreateInvoice +# ruff: noqa: E501 +from advancedbilling.models.create_invoice import ( + CreateInvoice, +) -class CreateInvoiceRequest(object): +class CreateInvoiceRequest(object): """Implementation of the 'Create Invoice Request' model. Attributes: invoice (CreateInvoice): The model property of type CreateInvoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "invoice": 'invoice' + "invoice": "invoice", } - def __init__(self, - invoice=None, - additional_properties=None): - """Constructor for the CreateInvoiceRequest class""" - + def __init__( + self, + invoice=None, + additional_properties=None): + """Initialize a CreateInvoiceRequest instance.""" # Initialize members of the class - self.invoice = invoice + self.invoice = invoice # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - invoice = CreateInvoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None + invoice =\ + CreateInvoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(invoice, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoice={self.invoice!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _invoice=self.invoice + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice={_invoice!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoice={self.invoice!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _invoice=self.invoice + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice={_invoice!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_invoice_status.py b/advancedbilling/models/create_invoice_status.py index fb1cb82d..1b7191b1 100644 --- a/advancedbilling/models/create_invoice_status.py +++ b/advancedbilling/models/create_invoice_status.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CreateInvoiceStatus(object): - """Implementation of the 'Create Invoice Status' enum. Attributes: DRAFT: The enum member of type str. OPEN: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - DRAFT = 'draft' - OPEN = 'open' + DRAFT = "draft" + + OPEN = "open" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/create_metadata.py b/advancedbilling/models/create_metadata.py index a0051a1a..c9a1962f 100644 --- a/advancedbilling/models/create_metadata.py +++ b/advancedbilling/models/create_metadata.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateMetadata(object): - """Implementation of the 'Create Metadata' model. Attributes: name (str): The model property of type str. value (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "value": 'value' + "name": "name", + "value": "value", } _optionals = [ - 'name', - 'value', + "name", + "value", ] - def __init__(self, - name=APIHelper.SKIP, - value=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateMetadata class""" - + def __init__( + self, + name=APIHelper.SKIP, + value=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateMetadata instance.""" # Initialize members of the class if name is not APIHelper.SKIP: - self.name = name + self.name = name if value is not APIHelper.SKIP: - self.value = value + self.value = value # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - value = dictionary.get("value") if dictionary.get("value") else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + value =\ + dictionary.get("value")\ + if dictionary.get("value")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, value, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'value={(self.value if hasattr(self, "value") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"value={_value!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'value={(self.value if hasattr(self, "value") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"value={_value!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_metadata_request.py b/advancedbilling/models/create_metadata_request.py index 3f44f813..e25a8616 100644 --- a/advancedbilling/models/create_metadata_request.py +++ b/advancedbilling/models/create_metadata_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_metadata import CreateMetadata +# ruff: noqa: E501 +from advancedbilling.models.create_metadata import ( + CreateMetadata, +) -class CreateMetadataRequest(object): +class CreateMetadataRequest(object): """Implementation of the 'Create Metadata Request' model. Attributes: metadata (List[CreateMetadata]): The model property of type List[CreateMetadata]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "metadata": 'metadata' + "metadata": "metadata", } - def __init__(self, - metadata=None, - additional_properties=None): - """Constructor for the CreateMetadataRequest class""" - + def __init__( + self, + metadata=None, + additional_properties=None): + """Initialize a CreateMetadataRequest instance.""" # Initialize members of the class - self.metadata = metadata + self.metadata = metadata # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary metadata = None - if dictionary.get('metadata') is not None: - metadata = [CreateMetadata.from_dictionary(x) for x in dictionary.get('metadata')] + if dictionary.get("metadata") is not None: + metadata = [ + CreateMetadata.from_dictionary(x) + for x in dictionary.get("metadata") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(metadata, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'metadata={self.metadata!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _metadata=self.metadata + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metadata={_metadata!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'metadata={self.metadata!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _metadata=self.metadata + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metadata={_metadata!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_metafield.py b/advancedbilling/models/create_metafield.py index d12e7829..925d9684 100644 --- a/advancedbilling/models/create_metafield.py +++ b/advancedbilling/models/create_metafield.py @@ -1,66 +1,66 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.metafield_scope import MetafieldScope +from advancedbilling.models.metafield_scope import ( + MetafieldScope, +) class CreateMetafield(object): - """Implementation of the 'Create Metafield' model. Attributes: name (str): The model property of type str. - scope (MetafieldScope): Warning: When updating a metafield's scope - attribute, all scope attributes must be passed. Partially complete - scope attributes will override the existing settings. + scope (MetafieldScope): Warning: When updating a metafield's scope attribute, + all scope attributes must be passed. Partially complete scope attributes + will override the existing settings. input_type (MetafieldInput): Indicates the type of metafield. A text - metafield allows any string value. Dropdown and radio metafields - have a set of values that can be selected. Defaults to 'text'. - enum (List[str]): Only applicable when input_type is radio or - dropdown. Empty strings will not be submitted. - additional_properties (Dict[str, object]): The additional properties - for the model. + metafield allows any string value. Dropdown and radio metafields have a + set of values that can be selected. Defaults to 'text'. + enum (List[str]): Only applicable when input_type is radio or dropdown. Empty + strings will not be submitted. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "scope": 'scope', - "input_type": 'input_type', - "enum": 'enum' + "name": "name", + "scope": "scope", + "input_type": "input_type", + "enum": "enum", } _optionals = [ - 'name', - 'scope', - 'input_type', - 'enum', + "name", + "scope", + "input_type", + "enum", ] - def __init__(self, - name=APIHelper.SKIP, - scope=APIHelper.SKIP, - input_type=APIHelper.SKIP, - enum=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateMetafield class""" - + def __init__( + self, + name=APIHelper.SKIP, + scope=APIHelper.SKIP, + input_type=APIHelper.SKIP, + enum=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateMetafield instance.""" # Initialize members of the class if name is not APIHelper.SKIP: - self.name = name + self.name = name if scope is not APIHelper.SKIP: - self.scope = scope + self.scope = scope if input_type is not APIHelper.SKIP: - self.input_type = input_type + self.input_type = input_type if enum is not APIHelper.SKIP: - self.enum = enum + self.enum = enum # Add additional model properties to the instance if additional_properties is None: @@ -70,7 +70,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -81,17 +81,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - scope = MetafieldScope.from_dictionary(dictionary.get('scope')) if 'scope' in dictionary.keys() else APIHelper.SKIP - input_type = dictionary.get("input_type") if dictionary.get("input_type") else APIHelper.SKIP - enum = dictionary.get("enum") if dictionary.get("enum") else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + scope =\ + MetafieldScope.from_dictionary( + dictionary.get("scope"))\ + if "scope" in dictionary.keys()\ + else APIHelper.SKIP + input_type =\ + dictionary.get("input_type")\ + if dictionary.get("input_type")\ + else APIHelper.SKIP + enum =\ + dictionary.get("enum")\ + if dictionary.get("enum")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, scope, @@ -101,7 +116,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -112,7 +127,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -122,17 +136,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'scope={(self.scope if hasattr(self, "scope") else None)!r}, ' - f'input_type={(self.input_type if hasattr(self, "input_type") else None)!r}, ' - f'enum={(self.enum if hasattr(self, "enum") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _scope=( + self.scope + if hasattr(self, "scope") + else None + ) + _input_type=( + self.input_type + if hasattr(self, "input_type") + else None + ) + _enum=( + self.enum + if hasattr(self, "enum") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"scope={_scope!r}, " + f"input_type={_input_type!r}, " + f"enum={_enum!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'scope={(self.scope if hasattr(self, "scope") else None)!s}, ' - f'input_type={(self.input_type if hasattr(self, "input_type") else None)!s}, ' - f'enum={(self.enum if hasattr(self, "enum") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _scope=( + self.scope + if hasattr(self, "scope") + else None + ) + _input_type=( + self.input_type + if hasattr(self, "input_type") + else None + ) + _enum=( + self.enum + if hasattr(self, "enum") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"scope={_scope!s}, " + f"input_type={_input_type!s}, " + f"enum={_enum!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_metafields_request.py b/advancedbilling/models/create_metafields_request.py index dc05e305..065346cd 100644 --- a/advancedbilling/models/create_metafields_request.py +++ b/advancedbilling/models/create_metafields_request.py @@ -1,38 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateMetafieldsRequest(object): - """Implementation of the 'Create Metafields Request' model. Attributes: - metafields (CreateMetafield | List[CreateMetafield]): The model - property of type CreateMetafield | List[CreateMetafield]. - additional_properties (Dict[str, object]): The additional properties - for the model. + metafields (CreateMetafield | List[CreateMetafield]): The model property of + type CreateMetafield | List[CreateMetafield]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "metafields": 'metafields' + "metafields": "metafields", } - def __init__(self, - metafields=None, - additional_properties=None): - """Constructor for the CreateMetafieldsRequest class""" - + def __init__( + self, + metafields=None, + additional_properties=None): + """Initialize a CreateMetafieldsRequest instance.""" # Initialize members of the class - self.metafields = metafields + self.metafields = metafields # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +40,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,22 +51,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - metafields = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateMetafieldsRequestMetafields'), dictionary.get('metafields'), False) if dictionary.get('metafields') is not None else None + metafields = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateMetafieldsRequestMetafields"), + dictionary.get("metafields"), + False)\ + if dictionary.get("metafields") is not None\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(metafields, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -79,22 +87,38 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('CreateMetafieldsRequestMetafields').validate(dictionary.metafields).is_valid + return (UnionTypeLookUp.get("CreateMetafieldsRequestMetafields") + .validate(dictionary.metafields).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('CreateMetafieldsRequestMetafields').validate(dictionary.get('metafields')).is_valid + return (UnionTypeLookUp.get("CreateMetafieldsRequestMetafields") + .validate(dictionary.get("metafields")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'metafields={self.metafields!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _metafields=self.metafields + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metafields={_metafields!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'metafields={self.metafields!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _metafields=self.metafields + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metafields={_metafields!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_metered_component.py b/advancedbilling/models/create_metered_component.py index fd98db43..54234f85 100644 --- a/advancedbilling/models/create_metered_component.py +++ b/advancedbilling/models/create_metered_component.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.metered_component import MeteredComponent +# ruff: noqa: E501 +from advancedbilling.models.metered_component import ( + MeteredComponent, +) -class CreateMeteredComponent(object): +class CreateMeteredComponent(object): """Implementation of the 'Create Metered Component' model. Attributes: metered_component (MeteredComponent): The model property of type MeteredComponent. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "metered_component": 'metered_component' + "metered_component": "metered_component", } - def __init__(self, - metered_component=None, - additional_properties=None): - """Constructor for the CreateMeteredComponent class""" - + def __init__( + self, + metered_component=None, + additional_properties=None): + """Initialize a CreateMeteredComponent instance.""" # Initialize members of the class - self.metered_component = metered_component + self.metered_component = metered_component # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - metered_component = MeteredComponent.from_dictionary(dictionary.get('metered_component')) if dictionary.get('metered_component') else None + metered_component =\ + MeteredComponent.from_dictionary( + dictionary.get("metered_component"))\ + if dictionary.get("metered_component") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(metered_component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'metered_component={self.metered_component!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _metered_component=self.metered_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metered_component={_metered_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'metered_component={self.metered_component!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _metered_component=self.metered_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metered_component={_metered_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_multi_invoice_payment.py b/advancedbilling/models/create_multi_invoice_payment.py index 4b217db9..6a936195 100644 --- a/advancedbilling/models/create_multi_invoice_payment.py +++ b/advancedbilling/models/create_multi_invoice_payment.py @@ -1,74 +1,74 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_invoice_payment_application import CreateInvoicePaymentApplication +from advancedbilling.models.create_invoice_payment_application import ( + CreateInvoicePaymentApplication, +) class CreateMultiInvoicePayment(object): - """Implementation of the 'Create Multi Invoice Payment' model. Attributes: memo (str): A description to be attached to the payment. - details (str): Additional information related to the payment method - (eg. Check #). - method (InvoicePaymentMethodType): The type of payment method used. - Defaults to other. - amount (str | float): Dollar amount of the sum of the invoices payment - (eg. "10.50" => $10.50). - received_on (str): Date reflecting when the payment was received from - a customer. Must be in the past. - applications (List[CreateInvoicePaymentApplication]): The model - property of type List[CreateInvoicePaymentApplication]. - additional_properties (Dict[str, object]): The additional properties - for the model. + details (str): Additional information related to the payment method (eg. + Check #). + method (InvoicePaymentMethodType): The type of payment method used. Defaults + to other. + amount (str | float): Dollar amount of the sum of the invoices payment (eg. + "10.50" => $10.50). + received_on (str): Date reflecting when the payment was received from a + customer. Must be in the past. + applications (List[CreateInvoicePaymentApplication]): The model property of + type List[CreateInvoicePaymentApplication]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "applications": 'applications', - "memo": 'memo', - "details": 'details', - "method": 'method', - "received_on": 'received_on' + "amount": "amount", + "applications": "applications", + "memo": "memo", + "details": "details", + "method": "method", + "received_on": "received_on", } _optionals = [ - 'memo', - 'details', - 'method', - 'received_on', + "memo", + "details", + "method", + "received_on", ] - def __init__(self, - amount=None, - applications=None, - memo=APIHelper.SKIP, - details=APIHelper.SKIP, - method=APIHelper.SKIP, - received_on=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateMultiInvoicePayment class""" - + def __init__( + self, + amount=None, + applications=None, + memo=APIHelper.SKIP, + details=APIHelper.SKIP, + method=APIHelper.SKIP, + received_on=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateMultiInvoicePayment instance.""" # Initialize members of the class if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if details is not APIHelper.SKIP: - self.details = details + self.details = details if method is not APIHelper.SKIP: - self.method = method - self.amount = amount + self.method = method + self.amount = amount if received_on is not APIHelper.SKIP: - self.received_on = received_on - self.applications = applications + self.received_on = received_on + self.applications = applications # Add additional model properties to the instance if additional_properties is None: @@ -78,7 +78,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -89,22 +89,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateMultiInvoicePaymentAmount'), dictionary.get('amount'), False) if dictionary.get('amount') is not None else None + amount = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateMultiInvoicePaymentAmount"), + dictionary.get("amount"), + False)\ + if dictionary.get("amount") is not None\ + else None applications = None - if dictionary.get('applications') is not None: - applications = [CreateInvoicePaymentApplication.from_dictionary(x) for x in dictionary.get('applications')] - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - details = dictionary.get("details") if dictionary.get("details") else APIHelper.SKIP - method = dictionary.get("method") if dictionary.get("method") else APIHelper.SKIP - received_on = dictionary.get("received_on") if dictionary.get("received_on") else APIHelper.SKIP + if dictionary.get("applications") is not None: + applications = [ + CreateInvoicePaymentApplication.from_dictionary(x) + for x in dictionary.get("applications") + ] + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else APIHelper.SKIP + method =\ + dictionary.get("method")\ + if dictionary.get("method")\ + else APIHelper.SKIP + received_on =\ + dictionary.get("received_on")\ + if dictionary.get("received_on")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, applications, @@ -116,7 +141,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -127,40 +152,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('CreateMultiInvoicePaymentAmount').validate(dictionary.amount).is_valid \ - and APIHelper.is_valid_type(value=dictionary.applications, - type_callable=lambda value: CreateInvoicePaymentApplication.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return (UnionTypeLookUp.get("CreateMultiInvoicePaymentAmount") + .validate(dictionary.amount).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.applications, + type_callable=lambda value: + CreateInvoicePaymentApplication.validate(value), + is_model_dict=True, + is_inner_model_dict=True) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('CreateMultiInvoicePaymentAmount').validate(dictionary.get('amount')).is_valid \ - and APIHelper.is_valid_type(value=dictionary.get('applications'), - type_callable=lambda value: CreateInvoicePaymentApplication.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return (UnionTypeLookUp.get("CreateMultiInvoicePaymentAmount") + .validate(dictionary.get("amount")).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.get("applications"), + type_callable=lambda value: + CreateInvoicePaymentApplication.validate(value), + is_model_dict=True, + is_inner_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'details={(self.details if hasattr(self, "details") else None)!r}, ' - f'method={(self.method if hasattr(self, "method") else None)!r}, ' - f'amount={self.amount!r}, ' - f'received_on={(self.received_on if hasattr(self, "received_on") else None)!r}, ' - f'applications={self.applications!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _method=( + self.method + if hasattr(self, "method") + else None + ) + _amount=self.amount + _received_on=( + self.received_on + if hasattr(self, "received_on") + else None + ) + _applications=self.applications + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"memo={_memo!r}, " + f"details={_details!r}, " + f"method={_method!r}, " + f"amount={_amount!r}, " + f"received_on={_received_on!r}, " + f"applications={_applications!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'details={(self.details if hasattr(self, "details") else None)!s}, ' - f'method={(self.method if hasattr(self, "method") else None)!s}, ' - f'amount={self.amount!s}, ' - f'received_on={(self.received_on if hasattr(self, "received_on") else None)!s}, ' - f'applications={self.applications!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _method=( + self.method + if hasattr(self, "method") + else None + ) + _amount=self.amount + _received_on=( + self.received_on + if hasattr(self, "received_on") + else None + ) + _applications=self.applications + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"memo={_memo!s}, " + f"details={_details!s}, " + f"method={_method!s}, " + f"amount={_amount!s}, " + f"received_on={_received_on!s}, " + f"applications={_applications!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_multi_invoice_payment_request.py b/advancedbilling/models/create_multi_invoice_payment_request.py index b82adb29..b4c4bdbe 100644 --- a/advancedbilling/models/create_multi_invoice_payment_request.py +++ b/advancedbilling/models/create_multi_invoice_payment_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_multi_invoice_payment import CreateMultiInvoicePayment +# ruff: noqa: E501 +from advancedbilling.models.create_multi_invoice_payment import ( + CreateMultiInvoicePayment, +) -class CreateMultiInvoicePaymentRequest(object): +class CreateMultiInvoicePaymentRequest(object): """Implementation of the 'Create Multi Invoice Payment Request' model. Attributes: payment (CreateMultiInvoicePayment): The model property of type CreateMultiInvoicePayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment": 'payment' + "payment": "payment", } - def __init__(self, - payment=None, - additional_properties=None): - """Constructor for the CreateMultiInvoicePaymentRequest class""" - + def __init__( + self, + payment=None, + additional_properties=None): + """Initialize a CreateMultiInvoicePaymentRequest instance.""" # Initialize members of the class - self.payment = payment + self.payment = payment # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment = CreateMultiInvoicePayment.from_dictionary(dictionary.get('payment')) if dictionary.get('payment') else None + payment =\ + CreateMultiInvoicePayment.from_dictionary( + dictionary.get("payment"))\ + if dictionary.get("payment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment=self.payment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment=self.payment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_offer.py b/advancedbilling/models/create_offer.py index 1dc38710..24fae8f8 100644 --- a/advancedbilling/models/create_offer.py +++ b/advancedbilling/models/create_offer.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_offer_component import CreateOfferComponent +from advancedbilling.models.create_offer_component import ( + CreateOfferComponent, +) class CreateOffer(object): - """Implementation of the 'Create Offer' model. Attributes: @@ -23,52 +23,52 @@ class CreateOffer(object): components (List[CreateOfferComponent]): The model property of type List[CreateOfferComponent]. coupons (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "handle": 'handle', - "product_id": 'product_id', - "description": 'description', - "product_price_point_id": 'product_price_point_id', - "components": 'components', - "coupons": 'coupons' + "name": "name", + "handle": "handle", + "product_id": "product_id", + "description": "description", + "product_price_point_id": "product_price_point_id", + "components": "components", + "coupons": "coupons", } _optionals = [ - 'description', - 'product_price_point_id', - 'components', - 'coupons', + "description", + "product_price_point_id", + "components", + "coupons", ] - def __init__(self, - name=None, - handle=None, - product_id=None, - description=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - components=APIHelper.SKIP, - coupons=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateOffer class""" - + def __init__( + self, + name=None, + handle=None, + product_id=None, + description=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + components=APIHelper.SKIP, + coupons=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateOffer instance.""" # Initialize members of the class - self.name = name - self.handle = handle + self.name = name + self.handle = handle if description is not APIHelper.SKIP: - self.description = description - self.product_id = product_id + self.description = description + self.product_id = product_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if components is not APIHelper.SKIP: - self.components = components + self.components = components if coupons is not APIHelper.SKIP: - self.coupons = coupons + self.coupons = coupons # Add additional model properties to the instance if additional_properties is None: @@ -78,7 +78,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -89,24 +89,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - handle = dictionary.get("handle") if dictionary.get("handle") else None - product_id = dictionary.get("product_id") if dictionary.get("product_id") else None - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else None + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP components = None - if dictionary.get('components') is not None: - components = [CreateOfferComponent.from_dictionary(x) for x in dictionary.get('components')] + if dictionary.get("components") is not None: + components = [ + CreateOfferComponent.from_dictionary(x) + for x in dictionary.get("components") + ] else: components = APIHelper.SKIP - coupons = dictionary.get("coupons") if dictionary.get("coupons") else APIHelper.SKIP + coupons =\ + dictionary.get("coupons")\ + if dictionary.get("coupons")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, handle, @@ -118,23 +141,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'handle={self.handle!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'product_id={self.product_id!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'components={(self.components if hasattr(self, "components") else None)!r}, ' - f'coupons={(self.coupons if hasattr(self, "coupons") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _handle=self.handle + _description=( + self.description + if hasattr(self, "description") + else None + ) + _product_id=self.product_id + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"description={_description!r}, " + f"product_id={_product_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"components={_components!r}, " + f"coupons={_coupons!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'handle={self.handle!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'product_id={self.product_id!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'components={(self.components if hasattr(self, "components") else None)!s}, ' - f'coupons={(self.coupons if hasattr(self, "coupons") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _handle=self.handle + _description=( + self.description + if hasattr(self, "description") + else None + ) + _product_id=self.product_id + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"description={_description!s}, " + f"product_id={_product_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"components={_components!s}, " + f"coupons={_coupons!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_offer_component.py b/advancedbilling/models/create_offer_component.py index fe57c57b..cf26b228 100644 --- a/advancedbilling/models/create_offer_component.py +++ b/advancedbilling/models/create_offer_component.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateOfferComponent(object): - """Implementation of the 'Create Offer Component' model. Attributes: component_id (int): The model property of type int. price_point_id (int): The model property of type int. starting_quantity (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "price_point_id": 'price_point_id', - "starting_quantity": 'starting_quantity' + "component_id": "component_id", + "price_point_id": "price_point_id", + "starting_quantity": "starting_quantity", } _optionals = [ - 'component_id', - 'price_point_id', - 'starting_quantity', + "component_id", + "price_point_id", + "starting_quantity", ] - def __init__(self, - component_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - starting_quantity=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateOfferComponent class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + starting_quantity=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateOfferComponent instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if starting_quantity is not APIHelper.SKIP: - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - starting_quantity = dictionary.get("starting_quantity") if dictionary.get("starting_quantity") else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + starting_quantity =\ + dictionary.get("starting_quantity")\ + if dictionary.get("starting_quantity")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, price_point_id, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"starting_quantity={_starting_quantity!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"starting_quantity={_starting_quantity!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_offer_request.py b/advancedbilling/models/create_offer_request.py index a87d1b6c..1fdfad26 100644 --- a/advancedbilling/models/create_offer_request.py +++ b/advancedbilling/models/create_offer_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_offer import CreateOffer +# ruff: noqa: E501 +from advancedbilling.models.create_offer import ( + CreateOffer, +) -class CreateOfferRequest(object): +class CreateOfferRequest(object): """Implementation of the 'Create Offer Request' model. Attributes: offer (CreateOffer): The model property of type CreateOffer. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "offer": 'offer' + "offer": "offer", } - def __init__(self, - offer=None, - additional_properties=None): - """Constructor for the CreateOfferRequest class""" - + def __init__( + self, + offer=None, + additional_properties=None): + """Initialize a CreateOfferRequest instance.""" # Initialize members of the class - self.offer = offer + self.offer = offer # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - offer = CreateOffer.from_dictionary(dictionary.get('offer')) if dictionary.get('offer') else None + offer =\ + CreateOffer.from_dictionary( + dictionary.get("offer"))\ + if dictionary.get("offer") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(offer, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'offer={self.offer!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _offer=self.offer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"offer={_offer!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'offer={self.offer!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _offer=self.offer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"offer={_offer!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_on_off_component.py b/advancedbilling/models/create_on_off_component.py index cf7a4809..3164f054 100644 --- a/advancedbilling/models/create_on_off_component.py +++ b/advancedbilling/models/create_on_off_component.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.on_off_component import OnOffComponent +# ruff: noqa: E501 +from advancedbilling.models.on_off_component import ( + OnOffComponent, +) -class CreateOnOffComponent(object): +class CreateOnOffComponent(object): """Implementation of the 'Create On/Off Component' model. Attributes: - on_off_component (OnOffComponent): The model property of type - OnOffComponent. - additional_properties (Dict[str, object]): The additional properties - for the model. + on_off_component (OnOffComponent): The model property of type OnOffComponent. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "on_off_component": 'on_off_component' + "on_off_component": "on_off_component", } - def __init__(self, - on_off_component=None, - additional_properties=None): - """Constructor for the CreateOnOffComponent class""" - + def __init__( + self, + on_off_component=None, + additional_properties=None): + """Initialize a CreateOnOffComponent instance.""" # Initialize members of the class - self.on_off_component = on_off_component + self.on_off_component = on_off_component # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - on_off_component = OnOffComponent.from_dictionary(dictionary.get('on_off_component')) if dictionary.get('on_off_component') else None + on_off_component =\ + OnOffComponent.from_dictionary( + dictionary.get("on_off_component"))\ + if dictionary.get("on_off_component") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(on_off_component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'on_off_component={self.on_off_component!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _on_off_component=self.on_off_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"on_off_component={_on_off_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'on_off_component={self.on_off_component!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _on_off_component=self.on_off_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"on_off_component={_on_off_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_or_update_endpoint.py b/advancedbilling/models/create_or_update_endpoint.py index 19d2facc..65610c10 100644 --- a/advancedbilling/models/create_or_update_endpoint.py +++ b/advancedbilling/models/create_or_update_endpoint.py @@ -1,43 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class CreateOrUpdateEndpoint(object): - """Implementation of the 'Create or Update Endpoint' model. Used to Create or Update Endpoint Attributes: url (str): The model property of type str. - webhook_subscriptions (List[WebhookSubscription]): The model property - of type List[WebhookSubscription]. - additional_properties (Dict[str, object]): The additional properties - for the model. + webhook_subscriptions (List[WebhookSubscription]): The model property of type + List[WebhookSubscription]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "url": 'url', - "webhook_subscriptions": 'webhook_subscriptions' + "url": "url", + "webhook_subscriptions": "webhook_subscriptions", } - def __init__(self, - url=None, - webhook_subscriptions=None, - additional_properties=None): - """Constructor for the CreateOrUpdateEndpoint class""" - + def __init__( + self, + url=None, + webhook_subscriptions=None, + additional_properties=None): + """Initialize a CreateOrUpdateEndpoint instance.""" # Initialize members of the class - self.url = url - self.webhook_subscriptions = webhook_subscriptions + self.url = url + self.webhook_subscriptions = webhook_subscriptions # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,28 +54,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - url = dictionary.get("url") if dictionary.get("url") else None - webhook_subscriptions = dictionary.get("webhook_subscriptions") if dictionary.get("webhook_subscriptions") else None + url =\ + dictionary.get("url")\ + if dictionary.get("url")\ + else None + webhook_subscriptions =\ + dictionary.get("webhook_subscriptions")\ + if dictionary.get("webhook_subscriptions")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(url, webhook_subscriptions, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'url={self.url!r}, ' - f'webhook_subscriptions={self.webhook_subscriptions!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _url=self.url + _webhook_subscriptions=self.webhook_subscriptions + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"url={_url!r}, " + f"webhook_subscriptions={_webhook_subscriptions!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'url={self.url!s}, ' - f'webhook_subscriptions={self.webhook_subscriptions!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _url=self.url + _webhook_subscriptions=self.webhook_subscriptions + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"url={_url!s}, " + f"webhook_subscriptions={_webhook_subscriptions!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_or_update_endpoint_request.py b/advancedbilling/models/create_or_update_endpoint_request.py index d1c70b58..4869bd16 100644 --- a/advancedbilling/models/create_or_update_endpoint_request.py +++ b/advancedbilling/models/create_or_update_endpoint_request.py @@ -1,39 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_or_update_endpoint import CreateOrUpdateEndpoint +# ruff: noqa: E501 +from advancedbilling.models.create_or_update_endpoint import ( + CreateOrUpdateEndpoint, +) -class CreateOrUpdateEndpointRequest(object): +class CreateOrUpdateEndpointRequest(object): """Implementation of the 'Create or Update Endpoint Request' model. Used to Create or Update Endpoint Attributes: endpoint (CreateOrUpdateEndpoint): Used to Create or Update Endpoint - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "endpoint": 'endpoint' + "endpoint": "endpoint", } - def __init__(self, - endpoint=None, - additional_properties=None): - """Constructor for the CreateOrUpdateEndpointRequest class""" - + def __init__( + self, + endpoint=None, + additional_properties=None): + """Initialize a CreateOrUpdateEndpointRequest instance.""" # Initialize members of the class - self.endpoint = endpoint + self.endpoint = endpoint # Add additional model properties to the instance if additional_properties is None: @@ -43,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -54,24 +54,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - endpoint = CreateOrUpdateEndpoint.from_dictionary(dictionary.get('endpoint')) if dictionary.get('endpoint') else None + endpoint =\ + CreateOrUpdateEndpoint.from_dictionary( + dictionary.get("endpoint"))\ + if dictionary.get("endpoint") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(endpoint, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'endpoint={self.endpoint!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _endpoint=self.endpoint + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"endpoint={_endpoint!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'endpoint={self.endpoint!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _endpoint=self.endpoint + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"endpoint={_endpoint!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_or_update_product.py b/advancedbilling/models/create_or_update_product.py index 0880ca72..2bc12cc2 100644 --- a/advancedbilling/models/create_or_update_product.py +++ b/advancedbilling/models/create_or_update_product.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateOrUpdateProduct(object): - """Implementation of the 'Create or Update Product' model. Attributes: @@ -18,133 +16,128 @@ class CreateOrUpdateProduct(object): handle (str): The product API handle description (str): The product description accounting_code (str): E.g. Internal ID or SKU Number - require_credit_card (bool): Deprecated value that can be ignored - unless you have legacy hosted pages. For Public Signup Page users, - read this attribute from under the signup page. + require_credit_card (bool): Deprecated value that can be ignored unless you + have legacy hosted pages. For Public Signup Page users, read this + attribute from under the signup page. price_in_cents (int): The product price, in integer cents - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this product would - renew every 30 days - interval_unit (IntervalUnit): A string representing the interval unit - for this product, either month or day + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this product would renew every 30 days + interval_unit (IntervalUnit): A string representing the interval unit for + this product, either month or day trial_price_in_cents (int): The product trial price, in integer cents - trial_interval (int): The numerical trial interval. i.e. an interval - of ‘30’ coupled with a trial_interval_unit of day would mean this - product trial would last 30 days. - trial_interval_unit (IntervalUnit): A string representing the trial - interval unit for this product, either month or day - trial_type (TrialType): Indicates how a trial is handled when the - trail period ends and there is no credit card on file. For - `no_obligation`, the subscription transitions to a Trial Ended - state. Maxio will not send any emails or statements. For - `payment_expected`, the subscription transitions to a Past Due - state. Maxio will send normal dunning emails and statements - according to your other settings. + trial_interval (int): The numerical trial interval. i.e. an interval of ‘30’ + coupled with a trial_interval_unit of day would mean this product trial + would last 30 days. + trial_interval_unit (IntervalUnit): A string representing the trial interval + unit for this product, either month or day + trial_type (TrialType): Indicates how a trial is handled when the trail + period ends and there is no credit card on file. For `no_obligation`, the + subscription transitions to a Trial Ended state. Maxio will not send any + emails or statements. For `payment_expected`, the subscription + transitions to a Past Due state. Maxio will send normal dunning emails + and statements according to your other settings. expiration_interval (int): The numerical expiration interval. i.e. an - expiration_interval of ‘30’ coupled with an - expiration_interval_unit of day would mean this product would - expire after 30 days. - expiration_interval_unit (ExpirationIntervalUnit): A string - representing the expiration interval unit for this product, either - month, day or never + expiration_interval of ‘30’ coupled with an expiration_interval_unit of + day would mean this product would expire after 30 days. + expiration_interval_unit (ExpirationIntervalUnit): A string representing the + expiration interval unit for this product, either month, day or never auto_create_signup_page (bool): The model property of type bool. - tax_code (str): A string representing the tax code related to the - product type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. - additional_properties (Dict[str, object]): The additional properties - for the model. + tax_code (str): A string representing the tax code related to the product + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "description": 'description', - "price_in_cents": 'price_in_cents', - "interval": 'interval', - "interval_unit": 'interval_unit', - "handle": 'handle', - "accounting_code": 'accounting_code', - "require_credit_card": 'require_credit_card', - "trial_price_in_cents": 'trial_price_in_cents', - "trial_interval": 'trial_interval', - "trial_interval_unit": 'trial_interval_unit', - "trial_type": 'trial_type', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit', - "auto_create_signup_page": 'auto_create_signup_page', - "tax_code": 'tax_code' + "name": "name", + "description": "description", + "price_in_cents": "price_in_cents", + "interval": "interval", + "interval_unit": "interval_unit", + "handle": "handle", + "accounting_code": "accounting_code", + "require_credit_card": "require_credit_card", + "trial_price_in_cents": "trial_price_in_cents", + "trial_interval": "trial_interval", + "trial_interval_unit": "trial_interval_unit", + "trial_type": "trial_type", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + "auto_create_signup_page": "auto_create_signup_page", + "tax_code": "tax_code", } _optionals = [ - 'handle', - 'accounting_code', - 'require_credit_card', - 'trial_price_in_cents', - 'trial_interval', - 'trial_interval_unit', - 'trial_type', - 'expiration_interval', - 'expiration_interval_unit', - 'auto_create_signup_page', - 'tax_code', + "handle", + "accounting_code", + "require_credit_card", + "trial_price_in_cents", + "trial_interval", + "trial_interval_unit", + "trial_type", + "expiration_interval", + "expiration_interval_unit", + "auto_create_signup_page", + "tax_code", ] _nullables = [ - 'trial_interval_unit', - 'trial_type', - 'expiration_interval_unit', + "trial_interval_unit", + "trial_type", + "expiration_interval_unit", ] - def __init__(self, - name=None, - description=None, - price_in_cents=None, - interval=None, - interval_unit=None, - handle=APIHelper.SKIP, - accounting_code=APIHelper.SKIP, - require_credit_card=APIHelper.SKIP, - trial_price_in_cents=APIHelper.SKIP, - trial_interval=APIHelper.SKIP, - trial_interval_unit=APIHelper.SKIP, - trial_type=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - auto_create_signup_page=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateOrUpdateProduct class""" - + def __init__( + self, + name=None, + description=None, + price_in_cents=None, + interval=None, + interval_unit=None, + handle=APIHelper.SKIP, + accounting_code=APIHelper.SKIP, + require_credit_card=APIHelper.SKIP, + trial_price_in_cents=APIHelper.SKIP, + trial_interval=APIHelper.SKIP, + trial_interval_unit=APIHelper.SKIP, + trial_type=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + auto_create_signup_page=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateOrUpdateProduct instance.""" # Initialize members of the class - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle - self.description = description + self.handle = handle + self.description = description if accounting_code is not APIHelper.SKIP: - self.accounting_code = accounting_code + self.accounting_code = accounting_code if require_credit_card is not APIHelper.SKIP: - self.require_credit_card = require_credit_card - self.price_in_cents = price_in_cents - self.interval = interval - self.interval_unit = interval_unit + self.require_credit_card = require_credit_card + self.price_in_cents = price_in_cents + self.interval = interval + self.interval_unit = interval_unit if trial_price_in_cents is not APIHelper.SKIP: - self.trial_price_in_cents = trial_price_in_cents + self.trial_price_in_cents = trial_price_in_cents if trial_interval is not APIHelper.SKIP: - self.trial_interval = trial_interval + self.trial_interval = trial_interval if trial_interval_unit is not APIHelper.SKIP: - self.trial_interval_unit = trial_interval_unit + self.trial_interval_unit = trial_interval_unit if trial_type is not APIHelper.SKIP: - self.trial_type = trial_type + self.trial_type = trial_type if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit if auto_create_signup_page is not APIHelper.SKIP: - self.auto_create_signup_page = auto_create_signup_page + self.auto_create_signup_page = auto_create_signup_page if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code # Add additional model properties to the instance if additional_properties is None: @@ -154,7 +147,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -165,29 +158,79 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - description = dictionary.get("description") if dictionary.get("description") else None - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") else None - interval = dictionary.get("interval") if dictionary.get("interval") else None - interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else None - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - accounting_code = dictionary.get("accounting_code") if dictionary.get("accounting_code") else APIHelper.SKIP - require_credit_card = dictionary.get("require_credit_card") if "require_credit_card" in dictionary.keys() else APIHelper.SKIP - trial_price_in_cents = dictionary.get("trial_price_in_cents") if dictionary.get("trial_price_in_cents") else APIHelper.SKIP - trial_interval = dictionary.get("trial_interval") if dictionary.get("trial_interval") else APIHelper.SKIP - trial_interval_unit = dictionary.get("trial_interval_unit") if "trial_interval_unit" in dictionary.keys() else APIHelper.SKIP - trial_type = dictionary.get("trial_type") if "trial_type" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if dictionary.get("expiration_interval") else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP - auto_create_signup_page = dictionary.get("auto_create_signup_page") if "auto_create_signup_page" in dictionary.keys() else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else None + price_in_cents =\ + dictionary.get("price_in_cents")\ + if dictionary.get("price_in_cents")\ + else None + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else None + interval_unit =\ + dictionary.get("interval_unit")\ + if dictionary.get("interval_unit")\ + else None + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + accounting_code =\ + dictionary.get("accounting_code")\ + if dictionary.get("accounting_code")\ + else APIHelper.SKIP + require_credit_card =\ + dictionary.get("require_credit_card")\ + if "require_credit_card" in dictionary.keys()\ + else APIHelper.SKIP + trial_price_in_cents =\ + dictionary.get("trial_price_in_cents")\ + if dictionary.get("trial_price_in_cents")\ + else APIHelper.SKIP + trial_interval =\ + dictionary.get("trial_interval")\ + if dictionary.get("trial_interval")\ + else APIHelper.SKIP + trial_interval_unit =\ + dictionary.get("trial_interval_unit")\ + if "trial_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + trial_type =\ + dictionary.get("trial_type")\ + if "trial_type" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if dictionary.get("expiration_interval")\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + auto_create_signup_page =\ + dictionary.get("auto_create_signup_page")\ + if "auto_create_signup_page" in dictionary.keys()\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, description, @@ -208,41 +251,171 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'description={self.description!r}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!r}, ' - f'require_credit_card={(self.require_credit_card if hasattr(self, "require_credit_card") else None)!r}, ' - f'price_in_cents={self.price_in_cents!r}, ' - f'interval={self.interval!r}, ' - f'interval_unit={self.interval_unit!r}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!r}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!r}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!r}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'auto_create_signup_page={(self.auto_create_signup_page if hasattr(self, "auto_create_signup_page") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=self.description + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _require_credit_card=( + self.require_credit_card + if hasattr(self, "require_credit_card") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _auto_create_signup_page=( + self.auto_create_signup_page + if hasattr(self, "auto_create_signup_page") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"description={_description!r}, " + f"accounting_code={_accounting_code!r}, " + f"require_credit_card={_require_credit_card!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"trial_price_in_cents={_trial_price_in_cents!r}, " + f"trial_interval={_trial_interval!r}, " + f"trial_interval_unit={_trial_interval_unit!r}, " + f"trial_type={_trial_type!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"auto_create_signup_page={_auto_create_signup_page!r}, " + f"tax_code={_tax_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'description={self.description!s}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!s}, ' - f'require_credit_card={(self.require_credit_card if hasattr(self, "require_credit_card") else None)!s}, ' - f'price_in_cents={self.price_in_cents!s}, ' - f'interval={self.interval!s}, ' - f'interval_unit={self.interval_unit!s}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!s}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!s}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!s}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'auto_create_signup_page={(self.auto_create_signup_page if hasattr(self, "auto_create_signup_page") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=self.description + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _require_credit_card=( + self.require_credit_card + if hasattr(self, "require_credit_card") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _auto_create_signup_page=( + self.auto_create_signup_page + if hasattr(self, "auto_create_signup_page") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"description={_description!s}, " + f"accounting_code={_accounting_code!s}, " + f"require_credit_card={_require_credit_card!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"trial_price_in_cents={_trial_price_in_cents!s}, " + f"trial_interval={_trial_interval!s}, " + f"trial_interval_unit={_trial_interval_unit!s}, " + f"trial_type={_trial_type!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"auto_create_signup_page={_auto_create_signup_page!s}, " + f"tax_code={_tax_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_or_update_product_request.py b/advancedbilling/models/create_or_update_product_request.py index 107f75b6..48029b9b 100644 --- a/advancedbilling/models/create_or_update_product_request.py +++ b/advancedbilling/models/create_or_update_product_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_or_update_product import CreateOrUpdateProduct +# ruff: noqa: E501 +from advancedbilling.models.create_or_update_product import ( + CreateOrUpdateProduct, +) -class CreateOrUpdateProductRequest(object): +class CreateOrUpdateProductRequest(object): """Implementation of the 'Create or Update Product Request' model. Attributes: product (CreateOrUpdateProduct): The model property of type CreateOrUpdateProduct. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product": 'product' + "product": "product", } - def __init__(self, - product=None, - additional_properties=None): - """Constructor for the CreateOrUpdateProductRequest class""" - + def __init__( + self, + product=None, + additional_properties=None): + """Initialize a CreateOrUpdateProductRequest instance.""" # Initialize members of the class - self.product = product + self.product = product # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product = CreateOrUpdateProduct.from_dictionary(dictionary.get('product')) if dictionary.get('product') else None + product =\ + CreateOrUpdateProduct.from_dictionary( + dictionary.get("product"))\ + if dictionary.get("product") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product={self.product!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product=self.product + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product={_product!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product={self.product!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product=self.product + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product={_product!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_or_update_segment_price.py b/advancedbilling/models/create_or_update_segment_price.py index cafdf045..f1418c34 100644 --- a/advancedbilling/models/create_or_update_segment_price.py +++ b/advancedbilling/models/create_or_update_segment_price.py @@ -1,53 +1,51 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateOrUpdateSegmentPrice(object): - """Implementation of the 'Create or Update Segment Price' model. Attributes: starting_quantity (int): The model property of type int. ending_quantity (int): The model property of type int. - unit_price (str | float): The price can contain up to 8 decimal - places. i.e. 1.00 or 0.0012 or 0.00000065 - additional_properties (Dict[str, object]): The additional properties - for the model. + unit_price (str | float): The price can contain up to 8 decimal places. i.e. + 1.00 or 0.0012 or 0.00000065 + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "unit_price": 'unit_price', - "starting_quantity": 'starting_quantity', - "ending_quantity": 'ending_quantity' + "unit_price": "unit_price", + "starting_quantity": "starting_quantity", + "ending_quantity": "ending_quantity", } _optionals = [ - 'starting_quantity', - 'ending_quantity', + "starting_quantity", + "ending_quantity", ] - def __init__(self, - unit_price=None, - starting_quantity=APIHelper.SKIP, - ending_quantity=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateOrUpdateSegmentPrice class""" - + def __init__( + self, + unit_price=None, + starting_quantity=APIHelper.SKIP, + ending_quantity=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateOrUpdateSegmentPrice instance.""" # Initialize members of the class if starting_quantity is not APIHelper.SKIP: - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity if ending_quantity is not APIHelper.SKIP: - self.ending_quantity = ending_quantity - self.unit_price = unit_price + self.ending_quantity = ending_quantity + self.unit_price = unit_price # Add additional model properties to the instance if additional_properties is None: @@ -57,7 +55,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -68,17 +66,33 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateOrUpdateSegmentPriceUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else None - starting_quantity = dictionary.get("starting_quantity") if dictionary.get("starting_quantity") else APIHelper.SKIP - ending_quantity = dictionary.get("ending_quantity") if dictionary.get("ending_quantity") else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateOrUpdateSegmentPriceUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else None + starting_quantity =\ + dictionary.get("starting_quantity")\ + if dictionary.get("starting_quantity")\ + else APIHelper.SKIP + ending_quantity =\ + dictionary.get("ending_quantity")\ + if dictionary.get("ending_quantity")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(unit_price, starting_quantity, @@ -87,7 +101,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -98,26 +112,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('CreateOrUpdateSegmentPriceUnitPrice').validate(dictionary.unit_price).is_valid + return (UnionTypeLookUp.get("CreateOrUpdateSegmentPriceUnitPrice") + .validate(dictionary.unit_price).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('CreateOrUpdateSegmentPriceUnitPrice').validate(dictionary.get('unit_price')).is_valid + return (UnionTypeLookUp.get("CreateOrUpdateSegmentPriceUnitPrice") + .validate(dictionary.get("unit_price")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!r}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!r}, ' - f'unit_price={self.unit_price!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=self.unit_price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starting_quantity={_starting_quantity!r}, " + f"ending_quantity={_ending_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!s}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!s}, ' - f'unit_price={self.unit_price!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=self.unit_price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starting_quantity={_starting_quantity!s}, " + f"ending_quantity={_ending_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_payment.py b/advancedbilling/models/create_payment.py index 0b40f119..b9384ad4 100644 --- a/advancedbilling/models/create_payment.py +++ b/advancedbilling/models/create_payment.py @@ -1,49 +1,45 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class CreatePayment(object): - """Implementation of the 'Create Payment' model. Attributes: amount (str): The model property of type str. memo (str): The model property of type str. payment_details (str): The model property of type str. - payment_method (InvoicePaymentMethodType): The type of payment method - used. Defaults to other. - additional_properties (Dict[str, object]): The additional properties - for the model. + payment_method (InvoicePaymentMethodType): The type of payment method used. + Defaults to other. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "memo": 'memo', - "payment_details": 'payment_details', - "payment_method": 'payment_method' + "amount": "amount", + "memo": "memo", + "payment_details": "payment_details", + "payment_method": "payment_method", } - def __init__(self, - amount=None, - memo=None, - payment_details=None, - payment_method=None, - additional_properties=None): - """Constructor for the CreatePayment class""" - + def __init__( + self, + amount=None, + memo=None, + payment_details=None, + payment_method=None, + additional_properties=None): + """Initialize a CreatePayment instance.""" # Initialize members of the class - self.amount = amount - self.memo = memo - self.payment_details = payment_details - self.payment_method = payment_method + self.amount = amount + self.memo = memo + self.payment_details = payment_details + self.payment_method = payment_method # Add additional model properties to the instance if additional_properties is None: @@ -53,7 +49,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -64,17 +60,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = dictionary.get("amount") if dictionary.get("amount") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - payment_details = dictionary.get("payment_details") if dictionary.get("payment_details") else None - payment_method = dictionary.get("payment_method") if dictionary.get("payment_method") else None + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + payment_details =\ + dictionary.get("payment_details")\ + if dictionary.get("payment_details")\ + else None + payment_method =\ + dictionary.get("payment_method")\ + if dictionary.get("payment_method")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, memo, @@ -83,17 +93,35 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!r}, ' - f'memo={self.memo!r}, ' - f'payment_details={self.payment_details!r}, ' - f'payment_method={self.payment_method!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=self.amount + _memo=self.memo + _payment_details=self.payment_details + _payment_method=self.payment_method + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"memo={_memo!r}, " + f"payment_details={_payment_details!r}, " + f"payment_method={_payment_method!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!s}, ' - f'memo={self.memo!s}, ' - f'payment_details={self.payment_details!s}, ' - f'payment_method={self.payment_method!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=self.amount + _memo=self.memo + _payment_details=self.payment_details + _payment_method=self.payment_method + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"memo={_memo!s}, " + f"payment_details={_payment_details!s}, " + f"payment_method={_payment_method!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_payment_profile.py b/advancedbilling/models/create_payment_profile.py index c1dd44a8..12f70132 100644 --- a/advancedbilling/models/create_payment_profile.py +++ b/advancedbilling/models/create_payment_profile.py @@ -1,287 +1,281 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreatePaymentProfile(object): - """Implementation of the 'Create Payment Profile' model. Attributes: - chargify_token (str): Token received after sending billing information - using chargify.js. + chargify_token (str): Token received after sending billing information using + chargify.js. id (int): The model property of type int. payment_type (PaymentType): The model property of type PaymentType. first_name (str): First name on card or bank account. If omitted, the first_name from customer attributes will be used. - last_name (str): Last name on card or bank account. If omitted, the - last_name from customer attributes will be used. + last_name (str): Last name on card or bank account. If omitted, the last_name + from customer attributes will be used. masked_card_number (str): The model property of type str. full_number (str): The full credit card number card_type (CardType): The type of card used. - expiration_month (int | str | None): (Optional when performing an - Import via vault_token, required otherwise) The 1- or 2-digit - credit card expiration month, as an integer or string, i.e. 5 - expiration_year (int | str | None): (Optional when performing a Import - via vault_token, required otherwise) The 4-digit credit card - expiration year, as an integer or string, i.e. 2012 - billing_address (str): The credit card or bank account billing street - address (i.e. 123 Main St.). This value is merely passed through - to the payment gateway. - billing_address_2 (str): Second line of the customer’s billing address - i.e. Apt. 100 - billing_city (str): The credit card or bank account billing address - city (i.e. “Boston”). This value is merely passed through to the - payment gateway. - billing_state (str): The credit card or bank account billing address - state (i.e. MA). This value is merely passed through to the - payment gateway. This must conform to the - [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes - ) in order to be valid for tax locale purposes. + expiration_month (int | str | None): (Optional when performing an Import via + vault_token, required otherwise) The 1- or 2-digit credit card expiration + month, as an integer or string, i.e. 5 + expiration_year (int | str | None): (Optional when performing a Import via + vault_token, required otherwise) The 4-digit credit card expiration year, + as an integer or string, i.e. 2012 + billing_address (str): The credit card or bank account billing street address + (i.e. 123 Main St.). This value is merely passed through to the payment + gateway. + billing_address_2 (str): Second line of the customer’s billing address i.e. + Apt. 100 + billing_city (str): The credit card or bank account billing address city + (i.e. “Boston”). This value is merely passed through to the payment + gateway. + billing_state (str): The credit card or bank account billing address state + (i.e. MA). This value is merely passed through to the payment gateway. + This must conform to the + [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in + order to be valid for tax locale purposes. billing_country (str): The credit card or bank account billing address country, required in [ISO_3166-1 - alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format - (i.e. “US”). This value is merely passed through to the payment - gateway. Some gateways require country codes in a specific format. - Check your gateway’s documentation. If creating an ACH - subscription, only US is supported at this time. - billing_zip (str): The credit card or bank account billing address zip - code (i.e. 12345). This value is merely passed through to the - payment gateway. - current_vault (AllVaults): The vault that stores the payment profile - with the provided `vault_token`. Use `bogus` for testing. - vault_token (str): The “token” provided by your vault storage for an - already stored payment profile - customer_vault_token (str): (only for Authorize.Net CIM storage or - Square) The customerProfileId for the owner of the - customerPaymentProfileId provided as the vault_token + alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. + “US”). This value is merely passed through to the payment gateway. Some + gateways require country codes in a specific format. Check your gateway’s + documentation. If creating an ACH subscription, only US is supported at + this time. + billing_zip (str): The credit card or bank account billing address zip code + (i.e. 12345). This value is merely passed through to the payment gateway. + current_vault (AllVaults): The vault that stores the payment profile with the + provided `vault_token`. Use `bogus` for testing. + vault_token (str): The “token” provided by your vault storage for an already + stored payment profile + customer_vault_token (str): (only for Authorize.Net CIM storage or Square) + The customerProfileId for the owner of the customerPaymentProfileId + provided as the vault_token customer_id (int): (Required when creating a new payment profile) The Chargify customer id. paypal_email (str): used by merchants that implemented BraintreeBlue - javaScript libraries on their own. We recommend using Chargify.js - instead. - payment_method_nonce (str): used by merchants that implemented - BraintreeBlue javaScript libraries on their own. We recommend - using Chargify.js instead. + javaScript libraries on their own. We recommend using Chargify.js instead. + payment_method_nonce (str): used by merchants that implemented BraintreeBlue + javaScript libraries on their own. We recommend using Chargify.js instead. gateway_handle (str): This attribute is only available if MultiGateway - feature is enabled for your Site. This feature is in the Private - Beta currently. gateway_handle is used to directly select a - gateway where a payment profile will be stored in. Every connected - gateway must have a unique gateway handle specified. Read - [Multigateway - description](https://chargify.zendesk.com/hc/en-us/articles/4407761 - 759643#connecting-with-multiple-gateways) to learn more about new - concepts that MultiGateway introduces and the default behavior - when this attribute is not passed. - cvv (str): The 3- or 4-digit Card Verification Value. This value is - merely passed through to the payment gateway. - bank_name (str): (Required when creating with ACH or GoCardless, - optional with Stripe Direct Debit). The name of the bank where the - customerʼs account resides - bank_iban (str): (Optional when creating with GoCardless, required - with Stripe Direct Debit). International Bank Account Number. - Alternatively, local bank details can be provided - bank_routing_number (str): (Required when creating with ACH. Optional - when creating a subscription with GoCardless). The routing number - of the bank. It becomes bank_code while passing via GoCardless API - bank_account_number (str): (Required when creating with ACH, - GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban is - blank) The customerʼs bank account number - bank_branch_code (str): (Optional when creating with GoCardless, - required with Stripe BECS or BACS Direct Debit) Branch/Sort code. - Alternatively, an IBAN can be provided + feature is enabled for your Site. This feature is in the Private Beta + currently. gateway_handle is used to directly select a gateway where a + payment profile will be stored in. Every connected gateway must have a + unique gateway handle specified. Read [Multigateway + description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643# + connecting-with-multiple-gateways) to learn more about new concepts that + MultiGateway introduces and the default behavior when this attribute is + not passed. + cvv (str): The 3- or 4-digit Card Verification Value. This value is merely + passed through to the payment gateway. + bank_name (str): (Required when creating with ACH or GoCardless, optional + with Stripe Direct Debit). The name of the bank where the customerʼs + account resides + bank_iban (str): (Optional when creating with GoCardless, required with + Stripe Direct Debit). International Bank Account Number. Alternatively, + local bank details can be provided + bank_routing_number (str): (Required when creating with ACH. Optional when + creating a subscription with GoCardless). The routing number of the bank. + It becomes bank_code while passing via GoCardless API + bank_account_number (str): (Required when creating with ACH, GoCardless, + Stripe BECS or BACS Direct Debit, and bank_iban is blank) The customerʼs + bank account number + bank_branch_code (str): (Optional when creating with GoCardless, required + with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, + an IBAN can be provided bank_account_type (BankAccountType): Defaults to checking bank_account_holder_type (BankAccountHolderType): Defaults to personal - last_four (str): (Optional) Used for creating subscription with - payment profile imported using vault_token, for proper display in - Advanced Billing UI - additional_properties (Dict[str, object]): The additional properties - for the model. + last_four (str): (Optional) Used for creating subscription with payment + profile imported using vault_token, for proper display in Advanced + Billing UI + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify_token": 'chargify_token', - "id": 'id', - "payment_type": 'payment_type', - "first_name": 'first_name', - "last_name": 'last_name', - "masked_card_number": 'masked_card_number', - "full_number": 'full_number', - "card_type": 'card_type', - "expiration_month": 'expiration_month', - "expiration_year": 'expiration_year', - "billing_address": 'billing_address', - "billing_address_2": 'billing_address_2', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_country": 'billing_country', - "billing_zip": 'billing_zip', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "customer_vault_token": 'customer_vault_token', - "customer_id": 'customer_id', - "paypal_email": 'paypal_email', - "payment_method_nonce": 'payment_method_nonce', - "gateway_handle": 'gateway_handle', - "cvv": 'cvv', - "bank_name": 'bank_name', - "bank_iban": 'bank_iban', - "bank_routing_number": 'bank_routing_number', - "bank_account_number": 'bank_account_number', - "bank_branch_code": 'bank_branch_code', - "bank_account_type": 'bank_account_type', - "bank_account_holder_type": 'bank_account_holder_type', - "last_four": 'last_four' + "chargify_token": "chargify_token", + "id": "id", + "payment_type": "payment_type", + "first_name": "first_name", + "last_name": "last_name", + "masked_card_number": "masked_card_number", + "full_number": "full_number", + "card_type": "card_type", + "expiration_month": "expiration_month", + "expiration_year": "expiration_year", + "billing_address": "billing_address", + "billing_address_2": "billing_address_2", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_country": "billing_country", + "billing_zip": "billing_zip", + "current_vault": "current_vault", + "vault_token": "vault_token", + "customer_vault_token": "customer_vault_token", + "customer_id": "customer_id", + "paypal_email": "paypal_email", + "payment_method_nonce": "payment_method_nonce", + "gateway_handle": "gateway_handle", + "cvv": "cvv", + "bank_name": "bank_name", + "bank_iban": "bank_iban", + "bank_routing_number": "bank_routing_number", + "bank_account_number": "bank_account_number", + "bank_branch_code": "bank_branch_code", + "bank_account_type": "bank_account_type", + "bank_account_holder_type": "bank_account_holder_type", + "last_four": "last_four", } _optionals = [ - 'chargify_token', - 'id', - 'payment_type', - 'first_name', - 'last_name', - 'masked_card_number', - 'full_number', - 'card_type', - 'expiration_month', - 'expiration_year', - 'billing_address', - 'billing_address_2', - 'billing_city', - 'billing_state', - 'billing_country', - 'billing_zip', - 'current_vault', - 'vault_token', - 'customer_vault_token', - 'customer_id', - 'paypal_email', - 'payment_method_nonce', - 'gateway_handle', - 'cvv', - 'bank_name', - 'bank_iban', - 'bank_routing_number', - 'bank_account_number', - 'bank_branch_code', - 'bank_account_type', - 'bank_account_holder_type', - 'last_four', + "chargify_token", + "id", + "payment_type", + "first_name", + "last_name", + "masked_card_number", + "full_number", + "card_type", + "expiration_month", + "expiration_year", + "billing_address", + "billing_address_2", + "billing_city", + "billing_state", + "billing_country", + "billing_zip", + "current_vault", + "vault_token", + "customer_vault_token", + "customer_id", + "paypal_email", + "payment_method_nonce", + "gateway_handle", + "cvv", + "bank_name", + "bank_iban", + "bank_routing_number", + "bank_account_number", + "bank_branch_code", + "bank_account_type", + "bank_account_holder_type", + "last_four", ] _nullables = [ - 'billing_address_2', + "billing_address_2", ] - def __init__(self, - chargify_token=APIHelper.SKIP, - id=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - masked_card_number=APIHelper.SKIP, - full_number=APIHelper.SKIP, - card_type=APIHelper.SKIP, - expiration_month=APIHelper.SKIP, - expiration_year=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - paypal_email=APIHelper.SKIP, - payment_method_nonce=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - cvv=APIHelper.SKIP, - bank_name=APIHelper.SKIP, - bank_iban=APIHelper.SKIP, - bank_routing_number=APIHelper.SKIP, - bank_account_number=APIHelper.SKIP, - bank_branch_code=APIHelper.SKIP, - bank_account_type=APIHelper.SKIP, - bank_account_holder_type=APIHelper.SKIP, - last_four=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreatePaymentProfile class""" - + def __init__( + self, + chargify_token=APIHelper.SKIP, + id=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + masked_card_number=APIHelper.SKIP, + full_number=APIHelper.SKIP, + card_type=APIHelper.SKIP, + expiration_month=APIHelper.SKIP, + expiration_year=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + paypal_email=APIHelper.SKIP, + payment_method_nonce=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + cvv=APIHelper.SKIP, + bank_name=APIHelper.SKIP, + bank_iban=APIHelper.SKIP, + bank_routing_number=APIHelper.SKIP, + bank_account_number=APIHelper.SKIP, + bank_branch_code=APIHelper.SKIP, + bank_account_type=APIHelper.SKIP, + bank_account_holder_type=APIHelper.SKIP, + last_four=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreatePaymentProfile instance.""" # Initialize members of the class if chargify_token is not APIHelper.SKIP: - self.chargify_token = chargify_token + self.chargify_token = chargify_token if id is not APIHelper.SKIP: - self.id = id + self.id = id if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type + self.payment_type = payment_type if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if masked_card_number is not APIHelper.SKIP: - self.masked_card_number = masked_card_number + self.masked_card_number = masked_card_number if full_number is not APIHelper.SKIP: - self.full_number = full_number + self.full_number = full_number if card_type is not APIHelper.SKIP: - self.card_type = card_type + self.card_type = card_type if expiration_month is not APIHelper.SKIP: - self.expiration_month = expiration_month + self.expiration_month = expiration_month if expiration_year is not APIHelper.SKIP: - self.expiration_year = expiration_year + self.expiration_year = expiration_year if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 + self.billing_address_2 = billing_address_2 if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if paypal_email is not APIHelper.SKIP: - self.paypal_email = paypal_email + self.paypal_email = paypal_email if payment_method_nonce is not APIHelper.SKIP: - self.payment_method_nonce = payment_method_nonce + self.payment_method_nonce = payment_method_nonce if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if cvv is not APIHelper.SKIP: - self.cvv = cvv + self.cvv = cvv if bank_name is not APIHelper.SKIP: - self.bank_name = bank_name + self.bank_name = bank_name if bank_iban is not APIHelper.SKIP: - self.bank_iban = bank_iban + self.bank_iban = bank_iban if bank_routing_number is not APIHelper.SKIP: - self.bank_routing_number = bank_routing_number + self.bank_routing_number = bank_routing_number if bank_account_number is not APIHelper.SKIP: - self.bank_account_number = bank_account_number + self.bank_account_number = bank_account_number if bank_branch_code is not APIHelper.SKIP: - self.bank_branch_code = bank_branch_code + self.bank_branch_code = bank_branch_code if bank_account_type is not APIHelper.SKIP: - self.bank_account_type = bank_account_type + self.bank_account_type = bank_account_type if bank_account_holder_type is not APIHelper.SKIP: - self.bank_account_holder_type = bank_account_holder_type + self.bank_account_holder_type = bank_account_holder_type if last_four is not APIHelper.SKIP: - self.last_four = last_four + self.last_four = last_four # Add additional model properties to the instance if additional_properties is None: @@ -291,7 +285,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -302,46 +296,151 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargify_token = dictionary.get("chargify_token") if dictionary.get("chargify_token") else APIHelper.SKIP - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - masked_card_number = dictionary.get("masked_card_number") if dictionary.get("masked_card_number") else APIHelper.SKIP - full_number = dictionary.get("full_number") if dictionary.get("full_number") else APIHelper.SKIP - card_type = dictionary.get("card_type") if dictionary.get("card_type") else APIHelper.SKIP - expiration_month = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreatePaymentProfileExpirationMonth'), dictionary.get('expiration_month'), False) if dictionary.get('expiration_month') is not None else APIHelper.SKIP - expiration_year = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreatePaymentProfileExpirationYear'), dictionary.get('expiration_year'), False) if dictionary.get('expiration_year') is not None else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if dictionary.get("billing_address") else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if "billing_address_2" in dictionary.keys() else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if dictionary.get("billing_city") else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if dictionary.get("billing_state") else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if dictionary.get("billing_country") else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if dictionary.get("billing_zip") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if dictionary.get("customer_vault_token") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - paypal_email = dictionary.get("paypal_email") if dictionary.get("paypal_email") else APIHelper.SKIP - payment_method_nonce = dictionary.get("payment_method_nonce") if dictionary.get("payment_method_nonce") else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if dictionary.get("gateway_handle") else APIHelper.SKIP - cvv = dictionary.get("cvv") if dictionary.get("cvv") else APIHelper.SKIP - bank_name = dictionary.get("bank_name") if dictionary.get("bank_name") else APIHelper.SKIP - bank_iban = dictionary.get("bank_iban") if dictionary.get("bank_iban") else APIHelper.SKIP - bank_routing_number = dictionary.get("bank_routing_number") if dictionary.get("bank_routing_number") else APIHelper.SKIP - bank_account_number = dictionary.get("bank_account_number") if dictionary.get("bank_account_number") else APIHelper.SKIP - bank_branch_code = dictionary.get("bank_branch_code") if dictionary.get("bank_branch_code") else APIHelper.SKIP - bank_account_type = dictionary.get("bank_account_type") if dictionary.get("bank_account_type") else APIHelper.SKIP - bank_account_holder_type = dictionary.get("bank_account_holder_type") if dictionary.get("bank_account_holder_type") else APIHelper.SKIP - last_four = dictionary.get("last_four") if dictionary.get("last_four") else APIHelper.SKIP + chargify_token =\ + dictionary.get("chargify_token")\ + if dictionary.get("chargify_token")\ + else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + masked_card_number =\ + dictionary.get("masked_card_number")\ + if dictionary.get("masked_card_number")\ + else APIHelper.SKIP + full_number =\ + dictionary.get("full_number")\ + if dictionary.get("full_number")\ + else APIHelper.SKIP + card_type =\ + dictionary.get("card_type")\ + if dictionary.get("card_type")\ + else APIHelper.SKIP + expiration_month = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreatePaymentProfileExpirationMonth"), + dictionary.get("expiration_month"), + False)\ + if dictionary.get("expiration_month") is not None\ + else APIHelper.SKIP + expiration_year = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreatePaymentProfileExpirationYear"), + dictionary.get("expiration_year"), + False)\ + if dictionary.get("expiration_year") is not None\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if dictionary.get("billing_address")\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if "billing_address_2" in dictionary.keys()\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if dictionary.get("billing_city")\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if dictionary.get("billing_state")\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if dictionary.get("billing_country")\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if dictionary.get("billing_zip")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if dictionary.get("customer_vault_token")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + paypal_email =\ + dictionary.get("paypal_email")\ + if dictionary.get("paypal_email")\ + else APIHelper.SKIP + payment_method_nonce =\ + dictionary.get("payment_method_nonce")\ + if dictionary.get("payment_method_nonce")\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if dictionary.get("gateway_handle")\ + else APIHelper.SKIP + cvv =\ + dictionary.get("cvv")\ + if dictionary.get("cvv")\ + else APIHelper.SKIP + bank_name =\ + dictionary.get("bank_name")\ + if dictionary.get("bank_name")\ + else APIHelper.SKIP + bank_iban =\ + dictionary.get("bank_iban")\ + if dictionary.get("bank_iban")\ + else APIHelper.SKIP + bank_routing_number =\ + dictionary.get("bank_routing_number")\ + if dictionary.get("bank_routing_number")\ + else APIHelper.SKIP + bank_account_number =\ + dictionary.get("bank_account_number")\ + if dictionary.get("bank_account_number")\ + else APIHelper.SKIP + bank_branch_code =\ + dictionary.get("bank_branch_code")\ + if dictionary.get("bank_branch_code")\ + else APIHelper.SKIP + bank_account_type =\ + dictionary.get("bank_account_type")\ + if dictionary.get("bank_account_type")\ + else APIHelper.SKIP + bank_account_holder_type =\ + dictionary.get("bank_account_holder_type")\ + if dictionary.get("bank_account_holder_type")\ + else APIHelper.SKIP + last_four =\ + dictionary.get("last_four")\ + if dictionary.get("last_four")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify_token, id, @@ -378,73 +477,403 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!r}, ' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!r}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!r}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!r}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!r}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'paypal_email={(self.paypal_email if hasattr(self, "paypal_email") else None)!r}, ' - f'payment_method_nonce={(self.payment_method_nonce if hasattr(self, "payment_method_nonce") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'cvv={(self.cvv if hasattr(self, "cvv") else None)!r}, ' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!r}, ' - f'bank_iban={(self.bank_iban if hasattr(self, "bank_iban") else None)!r}, ' - f'bank_routing_number={(self.bank_routing_number if hasattr(self, "bank_routing_number") else None)!r}, ' - f'bank_account_number={(self.bank_account_number if hasattr(self, "bank_account_number") else None)!r}, ' - f'bank_branch_code={(self.bank_branch_code if hasattr(self, "bank_branch_code") else None)!r}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!r}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!r}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _paypal_email=( + self.paypal_email + if hasattr(self, "paypal_email") + else None + ) + _payment_method_nonce=( + self.payment_method_nonce + if hasattr(self, "payment_method_nonce") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _cvv=( + self.cvv + if hasattr(self, "cvv") + else None + ) + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _bank_iban=( + self.bank_iban + if hasattr(self, "bank_iban") + else None + ) + _bank_routing_number=( + self.bank_routing_number + if hasattr(self, "bank_routing_number") + else None + ) + _bank_account_number=( + self.bank_account_number + if hasattr(self, "bank_account_number") + else None + ) + _bank_branch_code=( + self.bank_branch_code + if hasattr(self, "bank_branch_code") + else None + ) + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!r}, " + f"id={_id!r}, " + f"payment_type={_payment_type!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"masked_card_number={_masked_card_number!r}, " + f"full_number={_full_number!r}, " + f"card_type={_card_type!r}, " + f"expiration_month={_expiration_month!r}, " + f"expiration_year={_expiration_year!r}, " + f"billing_address={_billing_address!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_country={_billing_country!r}, " + f"billing_zip={_billing_zip!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"customer_id={_customer_id!r}, " + f"paypal_email={_paypal_email!r}, " + f"payment_method_nonce={_payment_method_nonce!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"cvv={_cvv!r}, " + f"bank_name={_bank_name!r}, " + f"bank_iban={_bank_iban!r}, " + f"bank_routing_number={_bank_routing_number!r}, " + f"bank_account_number={_bank_account_number!r}, " + f"bank_branch_code={_bank_branch_code!r}, " + f"bank_account_type={_bank_account_type!r}, " + f"bank_account_holder_type={_bank_account_holder_type!r}, " + f"last_four={_last_four!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!s}, ' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!s}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!s}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!s}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!s}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'paypal_email={(self.paypal_email if hasattr(self, "paypal_email") else None)!s}, ' - f'payment_method_nonce={(self.payment_method_nonce if hasattr(self, "payment_method_nonce") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'cvv={(self.cvv if hasattr(self, "cvv") else None)!s}, ' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!s}, ' - f'bank_iban={(self.bank_iban if hasattr(self, "bank_iban") else None)!s}, ' - f'bank_routing_number={(self.bank_routing_number if hasattr(self, "bank_routing_number") else None)!s}, ' - f'bank_account_number={(self.bank_account_number if hasattr(self, "bank_account_number") else None)!s}, ' - f'bank_branch_code={(self.bank_branch_code if hasattr(self, "bank_branch_code") else None)!s}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!s}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!s}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _paypal_email=( + self.paypal_email + if hasattr(self, "paypal_email") + else None + ) + _payment_method_nonce=( + self.payment_method_nonce + if hasattr(self, "payment_method_nonce") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _cvv=( + self.cvv + if hasattr(self, "cvv") + else None + ) + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _bank_iban=( + self.bank_iban + if hasattr(self, "bank_iban") + else None + ) + _bank_routing_number=( + self.bank_routing_number + if hasattr(self, "bank_routing_number") + else None + ) + _bank_account_number=( + self.bank_account_number + if hasattr(self, "bank_account_number") + else None + ) + _bank_branch_code=( + self.bank_branch_code + if hasattr(self, "bank_branch_code") + else None + ) + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!s}, " + f"id={_id!s}, " + f"payment_type={_payment_type!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"masked_card_number={_masked_card_number!s}, " + f"full_number={_full_number!s}, " + f"card_type={_card_type!s}, " + f"expiration_month={_expiration_month!s}, " + f"expiration_year={_expiration_year!s}, " + f"billing_address={_billing_address!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_country={_billing_country!s}, " + f"billing_zip={_billing_zip!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"customer_id={_customer_id!s}, " + f"paypal_email={_paypal_email!s}, " + f"payment_method_nonce={_payment_method_nonce!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"cvv={_cvv!s}, " + f"bank_name={_bank_name!s}, " + f"bank_iban={_bank_iban!s}, " + f"bank_routing_number={_bank_routing_number!s}, " + f"bank_account_number={_bank_account_number!s}, " + f"bank_branch_code={_bank_branch_code!s}, " + f"bank_account_type={_bank_account_type!s}, " + f"bank_account_holder_type={_bank_account_holder_type!s}, " + f"last_four={_last_four!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_payment_profile_request.py b/advancedbilling/models/create_payment_profile_request.py index 49d207b7..23af5332 100644 --- a/advancedbilling/models/create_payment_profile_request.py +++ b/advancedbilling/models/create_payment_profile_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_payment_profile import CreatePaymentProfile +# ruff: noqa: E501 +from advancedbilling.models.create_payment_profile import ( + CreatePaymentProfile, +) -class CreatePaymentProfileRequest(object): +class CreatePaymentProfileRequest(object): """Implementation of the 'Create Payment Profile Request' model. Attributes: payment_profile (CreatePaymentProfile): The model property of type CreatePaymentProfile. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_profile": 'payment_profile' + "payment_profile": "payment_profile", } - def __init__(self, - payment_profile=None, - additional_properties=None): - """Constructor for the CreatePaymentProfileRequest class""" - + def __init__( + self, + payment_profile=None, + additional_properties=None): + """Initialize a CreatePaymentProfileRequest instance.""" # Initialize members of the class - self.payment_profile = payment_profile + self.payment_profile = payment_profile # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_profile = CreatePaymentProfile.from_dictionary(dictionary.get('payment_profile')) if dictionary.get('payment_profile') else None + payment_profile =\ + CreatePaymentProfile.from_dictionary( + dictionary.get("payment_profile"))\ + if dictionary.get("payment_profile") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_profile, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_prepaid_component.py b/advancedbilling/models/create_prepaid_component.py index c94c2952..847a562d 100644 --- a/advancedbilling/models/create_prepaid_component.py +++ b/advancedbilling/models/create_prepaid_component.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.prepaid_usage_component import PrepaidUsageComponent +# ruff: noqa: E501 +from advancedbilling.models.prepaid_usage_component import ( + PrepaidUsageComponent, +) -class CreatePrepaidComponent(object): +class CreatePrepaidComponent(object): """Implementation of the 'Create Prepaid Component' model. Attributes: - prepaid_usage_component (PrepaidUsageComponent): The model property of - type PrepaidUsageComponent. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepaid_usage_component (PrepaidUsageComponent): The model property of type + PrepaidUsageComponent. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepaid_usage_component": 'prepaid_usage_component' + "prepaid_usage_component": "prepaid_usage_component", } - def __init__(self, - prepaid_usage_component=None, - additional_properties=None): - """Constructor for the CreatePrepaidComponent class""" - + def __init__( + self, + prepaid_usage_component=None, + additional_properties=None): + """Initialize a CreatePrepaidComponent instance.""" # Initialize members of the class - self.prepaid_usage_component = prepaid_usage_component + self.prepaid_usage_component = prepaid_usage_component # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepaid_usage_component = PrepaidUsageComponent.from_dictionary(dictionary.get('prepaid_usage_component')) if dictionary.get('prepaid_usage_component') else None + prepaid_usage_component =\ + PrepaidUsageComponent.from_dictionary( + dictionary.get("prepaid_usage_component"))\ + if dictionary.get("prepaid_usage_component") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepaid_usage_component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepaid_usage_component={self.prepaid_usage_component!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepaid_usage_component=self.prepaid_usage_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepaid_usage_component={_prepaid_usage_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepaid_usage_component={self.prepaid_usage_component!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepaid_usage_component=self.prepaid_usage_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepaid_usage_component={_prepaid_usage_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_prepaid_usage_component_price_point.py b/advancedbilling/models/create_prepaid_usage_component_price_point.py index 4bbc1e37..b3a2823e 100644 --- a/advancedbilling/models/create_prepaid_usage_component_price_point.py +++ b/advancedbilling/models/create_prepaid_usage_component_price_point.py @@ -1,110 +1,110 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.overage_pricing import OveragePricing +from advancedbilling.models.overage_pricing import ( + OveragePricing, +) from advancedbilling.models.price import Price -from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.pricing_scheme import ( + PricingScheme, +) class CreatePrepaidUsageComponentPricePoint(object): - """Implementation of the 'Create Prepaid Usage Component Price Point' model. Attributes: name (str): The model property of type str. handle (str): The model property of type str. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. prices (List[Price]): The model property of type List[Price]. - overage_pricing (OveragePricing): The model property of type - OveragePricing. - use_site_exchange_rate (bool): Whether to use the site level exchange - rate or define your own prices for each currency if you have - multiple currencies defined on the site. + overage_pricing (OveragePricing): The model property of type OveragePricing. + use_site_exchange_rate (bool): Whether to use the site level exchange rate or + define your own prices for each currency if you have multiple currencies + defined on the site. rollover_prepaid_remainder (bool): (only for prepaid usage components) - Boolean which controls whether or not remaining units should be - rolled over to the next period - renew_prepaid_allocation (bool): (only for prepaid usage components) - Boolean which controls whether or not the allocated quantity - should be renewed at the beginning of each period + Boolean which controls whether or not remaining units should be rolled + over to the next period + renew_prepaid_allocation (bool): (only for prepaid usage components) Boolean + which controls whether or not the allocated quantity should be renewed at + the beginning of each period expiration_interval (float): (only for prepaid usage components where rollover_prepaid_remainder is true) The number of - `expiration_interval_unit`s after which rollover amounts should - expire - expiration_interval_unit (ExpirationIntervalUnit): (only for prepaid - usage components where rollover_prepaid_remainder is true) A - string representing the expiration interval unit for this - component, either month or day - additional_properties (Dict[str, object]): The additional properties - for the model. + `expiration_interval_unit`s after which rollover amounts should expire + expiration_interval_unit (ExpirationIntervalUnit): (only for prepaid usage + components where rollover_prepaid_remainder is true) A string + representing the expiration interval unit for this component, either + month or day + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "pricing_scheme": 'pricing_scheme', - "prices": 'prices', - "overage_pricing": 'overage_pricing', - "handle": 'handle', - "use_site_exchange_rate": 'use_site_exchange_rate', - "rollover_prepaid_remainder": 'rollover_prepaid_remainder', - "renew_prepaid_allocation": 'renew_prepaid_allocation', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit' + "name": "name", + "pricing_scheme": "pricing_scheme", + "prices": "prices", + "overage_pricing": "overage_pricing", + "handle": "handle", + "use_site_exchange_rate": "use_site_exchange_rate", + "rollover_prepaid_remainder": "rollover_prepaid_remainder", + "renew_prepaid_allocation": "renew_prepaid_allocation", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", } _optionals = [ - 'handle', - 'use_site_exchange_rate', - 'rollover_prepaid_remainder', - 'renew_prepaid_allocation', - 'expiration_interval', - 'expiration_interval_unit', + "handle", + "use_site_exchange_rate", + "rollover_prepaid_remainder", + "renew_prepaid_allocation", + "expiration_interval", + "expiration_interval_unit", ] _nullables = [ - 'expiration_interval_unit', + "expiration_interval_unit", ] - def __init__(self, - name=None, - pricing_scheme=None, - prices=None, - overage_pricing=None, - handle=APIHelper.SKIP, - use_site_exchange_rate=True, - rollover_prepaid_remainder=APIHelper.SKIP, - renew_prepaid_allocation=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreatePrepaidUsageComponentPricePoint class""" - + def __init__( + self, + name=None, + pricing_scheme=None, + prices=None, + overage_pricing=None, + handle=APIHelper.SKIP, + use_site_exchange_rate=True, + rollover_prepaid_remainder=APIHelper.SKIP, + renew_prepaid_allocation=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreatePrepaidUsageComponentPricePoint instance.""" # Initialize members of the class - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle - self.pricing_scheme = pricing_scheme - self.prices = prices - self.overage_pricing = overage_pricing - self.use_site_exchange_rate = use_site_exchange_rate + self.handle = handle + self.pricing_scheme = pricing_scheme + self.prices = prices + self.overage_pricing = overage_pricing + self.use_site_exchange_rate = use_site_exchange_rate if rollover_prepaid_remainder is not APIHelper.SKIP: - self.rollover_prepaid_remainder = rollover_prepaid_remainder + self.rollover_prepaid_remainder = rollover_prepaid_remainder if renew_prepaid_allocation is not APIHelper.SKIP: - self.renew_prepaid_allocation = renew_prepaid_allocation + self.renew_prepaid_allocation = renew_prepaid_allocation if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -114,7 +114,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -125,25 +125,57 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] - overage_pricing = OveragePricing.from_dictionary(dictionary.get('overage_pricing')) if dictionary.get('overage_pricing') else None - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if dictionary.get("use_site_exchange_rate") else True - rollover_prepaid_remainder = dictionary.get("rollover_prepaid_remainder") if "rollover_prepaid_remainder" in dictionary.keys() else APIHelper.SKIP - renew_prepaid_allocation = dictionary.get("renew_prepaid_allocation") if "renew_prepaid_allocation" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if dictionary.get("expiration_interval") else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] + overage_pricing =\ + OveragePricing.from_dictionary( + dictionary.get("overage_pricing"))\ + if dictionary.get("overage_pricing") else None + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if dictionary.get("use_site_exchange_rate")\ + else True + rollover_prepaid_remainder =\ + dictionary.get("rollover_prepaid_remainder")\ + if "rollover_prepaid_remainder" in dictionary.keys()\ + else APIHelper.SKIP + renew_prepaid_allocation =\ + dictionary.get("renew_prepaid_allocation")\ + if "renew_prepaid_allocation" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if dictionary.get("expiration_interval")\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, pricing_scheme, @@ -159,7 +191,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -170,59 +202,158 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.pricing_scheme, - type_callable=lambda value: PricingScheme.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.prices, - type_callable=lambda value: Price.validate(value), - is_model_dict=True, - is_inner_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.overage_pricing, - type_callable=lambda value: OveragePricing.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.pricing_scheme, + type_callable=lambda value: + PricingScheme.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.prices, + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.overage_pricing, + type_callable=lambda value: + OveragePricing.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('name'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('pricing_scheme'), - type_callable=lambda value: PricingScheme.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('prices'), - type_callable=lambda value: Price.validate(value), - is_model_dict=True, - is_inner_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('overage_pricing'), - type_callable=lambda value: OveragePricing.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("pricing_scheme"), + type_callable=lambda value: + PricingScheme.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("prices"), + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("overage_pricing"), + type_callable=lambda value: + OveragePricing.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={self.prices!r}, ' - f'overage_pricing={self.overage_pricing!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!r}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _overage_pricing=self.overage_pricing + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"overage_pricing={_overage_pricing!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!r}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={self.prices!s}, ' - f'overage_pricing={self.overage_pricing!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!s}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _overage_pricing=self.overage_pricing + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"overage_pricing={_overage_pricing!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!s}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_prepayment.py b/advancedbilling/models/create_prepayment.py index 13ec2a73..6edc5dab 100644 --- a/advancedbilling/models/create_prepayment.py +++ b/advancedbilling/models/create_prepayment.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreatePrepayment(object): - """Implementation of the 'Create Prepayment' model. Attributes: @@ -18,45 +16,45 @@ class CreatePrepayment(object): details (str): The model property of type str. memo (str): The model property of type str. method (CreatePrepaymentMethod): :- When the `method` specified is - `"credit_card_on_file"`, the prepayment amount will be collected - using the default credit card payment profile and applied to the - prepayment account balance. This is especially useful for manual - replenishment of prepaid subscriptions. + `"credit_card_on_file"`, the prepayment amount will be collected using + the default credit card payment profile and applied to the prepayment + account balance. This is especially useful for manual replenishment of + prepaid subscriptions. payment_profile_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "details": 'details', - "memo": 'memo', - "method": 'method', - "payment_profile_id": 'payment_profile_id' + "amount": "amount", + "details": "details", + "memo": "memo", + "method": "method", + "payment_profile_id": "payment_profile_id", } _optionals = [ - 'payment_profile_id', + "payment_profile_id", ] - def __init__(self, - amount=None, - details=None, - memo=None, - method=None, - payment_profile_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreatePrepayment class""" - + def __init__( + self, + amount=None, + details=None, + memo=None, + method=None, + payment_profile_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreatePrepayment instance.""" # Initialize members of the class - self.amount = amount - self.details = details - self.memo = memo - self.method = method + self.amount = amount + self.details = details + self.memo = memo + self.method = method if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id # Add additional model properties to the instance if additional_properties is None: @@ -66,7 +64,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -77,18 +75,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = dictionary.get("amount") if dictionary.get("amount") else None - details = dictionary.get("details") if dictionary.get("details") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - method = dictionary.get("method") if dictionary.get("method") else None - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else None + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + method =\ + dictionary.get("method")\ + if dictionary.get("method")\ + else None + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, details, @@ -98,19 +113,47 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!r}, ' - f'details={self.details!r}, ' - f'memo={self.memo!r}, ' - f'method={self.method!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=self.amount + _details=self.details + _memo=self.memo + _method=self.method + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"details={_details!r}, " + f"memo={_memo!r}, " + f"method={_method!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!s}, ' - f'details={self.details!s}, ' - f'memo={self.memo!s}, ' - f'method={self.method!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=self.amount + _details=self.details + _memo=self.memo + _method=self.method + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"details={_details!s}, " + f"memo={_memo!s}, " + f"method={_method!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_prepayment_method.py b/advancedbilling/models/create_prepayment_method.py index 24611c3c..eac27501 100644 --- a/advancedbilling/models/create_prepayment_method.py +++ b/advancedbilling/models/create_prepayment_method.py @@ -1,21 +1,18 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CreatePrepaymentMethod(object): - """Implementation of the 'Create Prepayment Method' enum. - :- When the `method` specified is `"credit_card_on_file"`, the prepayment - amount will be collected using the default credit card payment profile and - applied to the prepayment account balance. This is especially useful for - manual replenishment of prepaid subscriptions. + :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount + will be collected using the default credit card payment profile and applied to + the prepayment account balance. This is especially useful for manual + replenishment of prepaid subscriptions. Attributes: CHECK: The enum member of type str. @@ -26,28 +23,30 @@ class CreatePrepaymentMethod(object): CREDIT_CARD: The enum member of type str. CREDIT_CARD_ON_FILE: The enum member of type str. OTHER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CHECK = 'check' - CASH = 'cash' + CHECK = "check" + + CASH = "cash" - MONEY_ORDER = 'money_order' + MONEY_ORDER = "money_order" - ACH = 'ach' + ACH = "ach" - PAYPAL_ACCOUNT = 'paypal_account' + PAYPAL_ACCOUNT = "paypal_account" - CREDIT_CARD = 'credit_card' + CREDIT_CARD = "credit_card" - CREDIT_CARD_ON_FILE = 'credit_card_on_file' + CREDIT_CARD_ON_FILE = "credit_card_on_file" - OTHER = 'other' + OTHER = "other" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/create_prepayment_request.py b/advancedbilling/models/create_prepayment_request.py index fbcbc0c6..a21fcb22 100644 --- a/advancedbilling/models/create_prepayment_request.py +++ b/advancedbilling/models/create_prepayment_request.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_prepayment import CreatePrepayment +# ruff: noqa: E501 +from advancedbilling.models.create_prepayment import ( + CreatePrepayment, +) -class CreatePrepaymentRequest(object): +class CreatePrepaymentRequest(object): """Implementation of the 'Create Prepayment Request' model. Attributes: - prepayment (CreatePrepayment): The model property of type - CreatePrepayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayment (CreatePrepayment): The model property of type CreatePrepayment. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayment": 'prepayment' + "prepayment": "prepayment", } - def __init__(self, - prepayment=None, - additional_properties=None): - """Constructor for the CreatePrepaymentRequest class""" - + def __init__( + self, + prepayment=None, + additional_properties=None): + """Initialize a CreatePrepaymentRequest instance.""" # Initialize members of the class - self.prepayment = prepayment + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepayment = CreatePrepayment.from_dictionary(dictionary.get('prepayment')) if dictionary.get('prepayment') else None + prepayment =\ + CreatePrepayment.from_dictionary( + dictionary.get("prepayment"))\ + if dictionary.get("prepayment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_prepayment_response.py b/advancedbilling/models/create_prepayment_response.py index 4a9e686a..b145a91f 100644 --- a/advancedbilling/models/create_prepayment_response.py +++ b/advancedbilling/models/create_prepayment_response.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.created_prepayment import CreatedPrepayment +# ruff: noqa: E501 +from advancedbilling.models.created_prepayment import ( + CreatedPrepayment, +) -class CreatePrepaymentResponse(object): +class CreatePrepaymentResponse(object): """Implementation of the 'Create Prepayment Response' model. Attributes: - prepayment (CreatedPrepayment): The model property of type - CreatedPrepayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayment (CreatedPrepayment): The model property of type CreatedPrepayment. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayment": 'prepayment' + "prepayment": "prepayment", } - def __init__(self, - prepayment=None, - additional_properties=None): - """Constructor for the CreatePrepaymentResponse class""" - + def __init__( + self, + prepayment=None, + additional_properties=None): + """Initialize a CreatePrepaymentResponse instance.""" # Initialize members of the class - self.prepayment = prepayment + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepayment = CreatedPrepayment.from_dictionary(dictionary.get('prepayment')) if dictionary.get('prepayment') else None + prepayment =\ + CreatedPrepayment.from_dictionary( + dictionary.get("prepayment"))\ + if dictionary.get("prepayment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_product_currency_price.py b/advancedbilling/models/create_product_currency_price.py index b0c8b328..557aa60e 100644 --- a/advancedbilling/models/create_product_currency_price.py +++ b/advancedbilling/models/create_product_currency_price.py @@ -1,44 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class CreateProductCurrencyPrice(object): - """Implementation of the 'Create Product Currency Price' model. Attributes: currency (str): ISO code for one of the site level currencies. price (int): Price for the given role. role (CurrencyPriceRole): Role for the price. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency": 'currency', - "price": 'price', - "role": 'role' + "currency": "currency", + "price": "price", + "role": "role", } - def __init__(self, - currency=None, - price=None, - role=None, - additional_properties=None): - """Constructor for the CreateProductCurrencyPrice class""" - + def __init__( + self, + currency=None, + price=None, + role=None, + additional_properties=None): + """Initialize a CreateProductCurrencyPrice instance.""" # Initialize members of the class - self.currency = currency - self.price = price - self.role = role + self.currency = currency + self.price = price + self.role = role # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,16 +55,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - currency = dictionary.get("currency") if dictionary.get("currency") else None - price = dictionary.get("price") if dictionary.get("price") else None - role = dictionary.get("role") if dictionary.get("role") else None + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else None + price =\ + dictionary.get("price")\ + if dictionary.get("price")\ + else None + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency, price, @@ -76,15 +83,31 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency={self.currency!r}, ' - f'price={self.price!r}, ' - f'role={self.role!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency=self.currency + _price=self.price + _role=self.role + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency={_currency!r}, " + f"price={_price!r}, " + f"role={_role!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency={self.currency!s}, ' - f'price={self.price!s}, ' - f'role={self.role!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency=self.currency + _price=self.price + _role=self.role + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency={_currency!s}, " + f"price={_price!s}, " + f"role={_role!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_product_currency_prices_request.py b/advancedbilling/models/create_product_currency_prices_request.py index 7b8731b5..f325c6eb 100644 --- a/advancedbilling/models/create_product_currency_prices_request.py +++ b/advancedbilling/models/create_product_currency_prices_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_product_currency_price import CreateProductCurrencyPrice +# ruff: noqa: E501 +from advancedbilling.models.create_product_currency_price import ( + CreateProductCurrencyPrice, +) -class CreateProductCurrencyPricesRequest(object): +class CreateProductCurrencyPricesRequest(object): """Implementation of the 'Create Product Currency Prices Request' model. Attributes: - currency_prices (List[CreateProductCurrencyPrice]): The model property - of type List[CreateProductCurrencyPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + currency_prices (List[CreateProductCurrencyPrice]): The model property of + type List[CreateProductCurrencyPrice]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency_prices": 'currency_prices' + "currency_prices": "currency_prices", } - def __init__(self, - currency_prices=None, - additional_properties=None): - """Constructor for the CreateProductCurrencyPricesRequest class""" - + def __init__( + self, + currency_prices=None, + additional_properties=None): + """Initialize a CreateProductCurrencyPricesRequest instance.""" # Initialize members of the class - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [CreateProductCurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + CreateProductCurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency_prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_product_family.py b/advancedbilling/models/create_product_family.py index abe397cf..e98be9f6 100644 --- a/advancedbilling/models/create_product_family.py +++ b/advancedbilling/models/create_product_family.py @@ -1,57 +1,55 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateProductFamily(object): - """Implementation of the 'Create Product Family' model. Attributes: name (str): The model property of type str. handle (str): The model property of type str. description (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "handle": 'handle', - "description": 'description' + "name": "name", + "handle": "handle", + "description": "description", } _optionals = [ - 'handle', - 'description', + "handle", + "description", ] _nullables = [ - 'handle', - 'description', + "handle", + "description", ] - def __init__(self, - name=None, - handle=APIHelper.SKIP, - description=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateProductFamily class""" - + def __init__( + self, + name=None, + handle=APIHelper.SKIP, + description=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateProductFamily instance.""" # Initialize members of the class - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if description is not APIHelper.SKIP: - self.description = description + self.description = description # Add additional model properties to the instance if additional_properties is None: @@ -61,7 +59,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -72,16 +70,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - handle = dictionary.get("handle") if "handle" in dictionary.keys() else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + handle =\ + dictionary.get("handle")\ + if "handle" in dictionary.keys()\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, handle, @@ -89,15 +98,47 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"description={_description!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"description={_description!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_product_family_request.py b/advancedbilling/models/create_product_family_request.py index 3ee74129..487339bc 100644 --- a/advancedbilling/models/create_product_family_request.py +++ b/advancedbilling/models/create_product_family_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_product_family import CreateProductFamily +# ruff: noqa: E501 +from advancedbilling.models.create_product_family import ( + CreateProductFamily, +) -class CreateProductFamilyRequest(object): +class CreateProductFamilyRequest(object): """Implementation of the 'Create Product Family Request' model. Attributes: product_family (CreateProductFamily): The model property of type CreateProductFamily. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_family": 'product_family' + "product_family": "product_family", } - def __init__(self, - product_family=None, - additional_properties=None): - """Constructor for the CreateProductFamilyRequest class""" - + def __init__( + self, + product_family=None, + additional_properties=None): + """Initialize a CreateProductFamilyRequest instance.""" # Initialize members of the class - self.product_family = product_family + self.product_family = product_family # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_family = CreateProductFamily.from_dictionary(dictionary.get('product_family')) if dictionary.get('product_family') else None + product_family =\ + CreateProductFamily.from_dictionary( + dictionary.get("product_family"))\ + if dictionary.get("product_family") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_family, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_family={self.product_family!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_family=self.product_family + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_family={_product_family!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_family={self.product_family!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_family=self.product_family + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_family={_product_family!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_product_price_point.py b/advancedbilling/models/create_product_price_point.py index 252bf101..8f6af3aa 100644 --- a/advancedbilling/models/create_product_price_point.py +++ b/advancedbilling/models/create_product_price_point.py @@ -1,137 +1,132 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateProductPricePoint(object): - """Implementation of the 'Create Product Price Point' model. Attributes: name (str): The product price point name handle (str): The product price point API handle price_in_cents (int): The product price point price, in integer cents - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this product price - point would renew every 30 days - interval_unit (IntervalUnit): A string representing the interval unit - for this product price point, either month or day - trial_price_in_cents (int): The product price point trial price, in + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this product price point would renew + every 30 days + interval_unit (IntervalUnit): A string representing the interval unit for + this product price point, either month or day + trial_price_in_cents (int): The product price point trial price, in integer + cents + trial_interval (int): The numerical trial interval. i.e. an interval of ‘30’ + coupled with a trial_interval_unit of day would mean this product price + point trial would last 30 days. + trial_interval_unit (IntervalUnit): A string representing the trial interval + unit for this product price point, either month or day + trial_type (TrialType): Indicates how a trial is handled when the trail + period ends and there is no credit card on file. For `no_obligation`, the + subscription transitions to a Trial Ended state. Maxio will not send any + emails or statements. For `payment_expected`, the subscription + transitions to a Past Due state. Maxio will send normal dunning emails + and statements according to your other settings. + initial_charge_in_cents (int): The product price point initial charge, in integer cents - trial_interval (int): The numerical trial interval. i.e. an interval - of ‘30’ coupled with a trial_interval_unit of day would mean this - product price point trial would last 30 days. - trial_interval_unit (IntervalUnit): A string representing the trial - interval unit for this product price point, either month or day - trial_type (TrialType): Indicates how a trial is handled when the - trail period ends and there is no credit card on file. For - `no_obligation`, the subscription transitions to a Trial Ended - state. Maxio will not send any emails or statements. For - `payment_expected`, the subscription transitions to a Past Due - state. Maxio will send normal dunning emails and statements - according to your other settings. - initial_charge_in_cents (int): The product price point initial charge, - in integer cents initial_charge_after_trial (bool): The model property of type bool. expiration_interval (int): The numerical expiration interval. i.e. an - expiration_interval of ‘30’ coupled with an - expiration_interval_unit of day would mean this product price - point would expire after 30 days. - expiration_interval_unit (ExpirationIntervalUnit): A string - representing the expiration interval unit for this product price - point, either month, day or never - use_site_exchange_rate (bool): Whether or not to use the site's - exchange rate or define your own pricing when your site has - multiple currencies defined. - additional_properties (Dict[str, object]): The additional properties - for the model. + expiration_interval of ‘30’ coupled with an expiration_interval_unit of + day would mean this product price point would expire after 30 days. + expiration_interval_unit (ExpirationIntervalUnit): A string representing the + expiration interval unit for this product price point, either month, day + or never + use_site_exchange_rate (bool): Whether or not to use the site's exchange rate + or define your own pricing when your site has multiple currencies defined. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "price_in_cents": 'price_in_cents', - "interval": 'interval', - "interval_unit": 'interval_unit', - "handle": 'handle', - "trial_price_in_cents": 'trial_price_in_cents', - "trial_interval": 'trial_interval', - "trial_interval_unit": 'trial_interval_unit', - "trial_type": 'trial_type', - "initial_charge_in_cents": 'initial_charge_in_cents', - "initial_charge_after_trial": 'initial_charge_after_trial', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit', - "use_site_exchange_rate": 'use_site_exchange_rate' + "name": "name", + "price_in_cents": "price_in_cents", + "interval": "interval", + "interval_unit": "interval_unit", + "handle": "handle", + "trial_price_in_cents": "trial_price_in_cents", + "trial_interval": "trial_interval", + "trial_interval_unit": "trial_interval_unit", + "trial_type": "trial_type", + "initial_charge_in_cents": "initial_charge_in_cents", + "initial_charge_after_trial": "initial_charge_after_trial", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + "use_site_exchange_rate": "use_site_exchange_rate", } _optionals = [ - 'handle', - 'trial_price_in_cents', - 'trial_interval', - 'trial_interval_unit', - 'trial_type', - 'initial_charge_in_cents', - 'initial_charge_after_trial', - 'expiration_interval', - 'expiration_interval_unit', - 'use_site_exchange_rate', + "handle", + "trial_price_in_cents", + "trial_interval", + "trial_interval_unit", + "trial_type", + "initial_charge_in_cents", + "initial_charge_after_trial", + "expiration_interval", + "expiration_interval_unit", + "use_site_exchange_rate", ] _nullables = [ - 'trial_type', - 'expiration_interval_unit', + "trial_type", + "expiration_interval_unit", ] - def __init__(self, - name=None, - price_in_cents=None, - interval=None, - interval_unit=None, - handle=APIHelper.SKIP, - trial_price_in_cents=APIHelper.SKIP, - trial_interval=APIHelper.SKIP, - trial_interval_unit=APIHelper.SKIP, - trial_type=APIHelper.SKIP, - initial_charge_in_cents=APIHelper.SKIP, - initial_charge_after_trial=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - use_site_exchange_rate=True, - additional_properties=None): - """Constructor for the CreateProductPricePoint class""" - + def __init__( + self, + name=None, + price_in_cents=None, + interval=None, + interval_unit=None, + handle=APIHelper.SKIP, + trial_price_in_cents=APIHelper.SKIP, + trial_interval=APIHelper.SKIP, + trial_interval_unit=APIHelper.SKIP, + trial_type=APIHelper.SKIP, + initial_charge_in_cents=APIHelper.SKIP, + initial_charge_after_trial=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + use_site_exchange_rate=True, + additional_properties=None): + """Initialize a CreateProductPricePoint instance.""" # Initialize members of the class - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle - self.price_in_cents = price_in_cents - self.interval = interval - self.interval_unit = interval_unit + self.handle = handle + self.price_in_cents = price_in_cents + self.interval = interval + self.interval_unit = interval_unit if trial_price_in_cents is not APIHelper.SKIP: - self.trial_price_in_cents = trial_price_in_cents + self.trial_price_in_cents = trial_price_in_cents if trial_interval is not APIHelper.SKIP: - self.trial_interval = trial_interval + self.trial_interval = trial_interval if trial_interval_unit is not APIHelper.SKIP: - self.trial_interval_unit = trial_interval_unit + self.trial_interval_unit = trial_interval_unit if trial_type is not APIHelper.SKIP: - self.trial_type = trial_type + self.trial_type = trial_type if initial_charge_in_cents is not APIHelper.SKIP: - self.initial_charge_in_cents = initial_charge_in_cents + self.initial_charge_in_cents = initial_charge_in_cents if initial_charge_after_trial is not APIHelper.SKIP: - self.initial_charge_after_trial = initial_charge_after_trial + self.initial_charge_after_trial = initial_charge_after_trial if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit - self.use_site_exchange_rate = use_site_exchange_rate + self.expiration_interval_unit = expiration_interval_unit + self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance if additional_properties is None: @@ -141,7 +136,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -152,27 +147,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") else None - interval = dictionary.get("interval") if dictionary.get("interval") else None - interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else None - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - trial_price_in_cents = dictionary.get("trial_price_in_cents") if dictionary.get("trial_price_in_cents") else APIHelper.SKIP - trial_interval = dictionary.get("trial_interval") if dictionary.get("trial_interval") else APIHelper.SKIP - trial_interval_unit = dictionary.get("trial_interval_unit") if dictionary.get("trial_interval_unit") else APIHelper.SKIP - trial_type = dictionary.get("trial_type") if "trial_type" in dictionary.keys() else APIHelper.SKIP - initial_charge_in_cents = dictionary.get("initial_charge_in_cents") if dictionary.get("initial_charge_in_cents") else APIHelper.SKIP - initial_charge_after_trial = dictionary.get("initial_charge_after_trial") if "initial_charge_after_trial" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if dictionary.get("expiration_interval") else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if dictionary.get("use_site_exchange_rate") else True + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + price_in_cents =\ + dictionary.get("price_in_cents")\ + if dictionary.get("price_in_cents")\ + else None + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else None + interval_unit =\ + dictionary.get("interval_unit")\ + if dictionary.get("interval_unit")\ + else None + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + trial_price_in_cents =\ + dictionary.get("trial_price_in_cents")\ + if dictionary.get("trial_price_in_cents")\ + else APIHelper.SKIP + trial_interval =\ + dictionary.get("trial_interval")\ + if dictionary.get("trial_interval")\ + else APIHelper.SKIP + trial_interval_unit =\ + dictionary.get("trial_interval_unit")\ + if dictionary.get("trial_interval_unit")\ + else APIHelper.SKIP + trial_type =\ + dictionary.get("trial_type")\ + if "trial_type" in dictionary.keys()\ + else APIHelper.SKIP + initial_charge_in_cents =\ + dictionary.get("initial_charge_in_cents")\ + if dictionary.get("initial_charge_in_cents")\ + else APIHelper.SKIP + initial_charge_after_trial =\ + dictionary.get("initial_charge_after_trial")\ + if "initial_charge_after_trial" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if dictionary.get("expiration_interval")\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if dictionary.get("use_site_exchange_rate")\ + else True + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, price_in_cents, @@ -191,37 +230,155 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'price_in_cents={self.price_in_cents!r}, ' - f'interval={self.interval!r}, ' - f'interval_unit={self.interval_unit!r}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!r}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!r}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!r}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!r}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!r}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"trial_price_in_cents={_trial_price_in_cents!r}, " + f"trial_interval={_trial_interval!r}, " + f"trial_interval_unit={_trial_interval_unit!r}, " + f"trial_type={_trial_type!r}, " + f"initial_charge_in_cents={_initial_charge_in_cents!r}, " + f"initial_charge_after_trial={_initial_charge_after_trial!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'price_in_cents={self.price_in_cents!s}, ' - f'interval={self.interval!s}, ' - f'interval_unit={self.interval_unit!s}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!s}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!s}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!s}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!s}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!s}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"trial_price_in_cents={_trial_price_in_cents!s}, " + f"trial_interval={_trial_interval!s}, " + f"trial_interval_unit={_trial_interval_unit!s}, " + f"trial_type={_trial_type!s}, " + f"initial_charge_in_cents={_initial_charge_in_cents!s}, " + f"initial_charge_after_trial={_initial_charge_after_trial!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_product_price_point_request.py b/advancedbilling/models/create_product_price_point_request.py index 123f2965..6ca9ecc1 100644 --- a/advancedbilling/models/create_product_price_point_request.py +++ b/advancedbilling/models/create_product_price_point_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_product_price_point import CreateProductPricePoint +# ruff: noqa: E501 +from advancedbilling.models.create_product_price_point import ( + CreateProductPricePoint, +) -class CreateProductPricePointRequest(object): +class CreateProductPricePointRequest(object): """Implementation of the 'Create Product Price Point Request' model. Attributes: price_point (CreateProductPricePoint): The model property of type CreateProductPricePoint. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point": 'price_point' + "price_point": "price_point", } - def __init__(self, - price_point=None, - additional_properties=None): - """Constructor for the CreateProductPricePointRequest class""" - + def __init__( + self, + price_point=None, + additional_properties=None): + """Initialize a CreateProductPricePointRequest instance.""" # Initialize members of the class - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point = CreateProductPricePoint.from_dictionary(dictionary.get('price_point')) if dictionary.get('price_point') else None + price_point =\ + CreateProductPricePoint.from_dictionary( + dictionary.get("price_point"))\ + if dictionary.get("price_point") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_quantity_based_component.py b/advancedbilling/models/create_quantity_based_component.py index 477cf07d..de7fce84 100644 --- a/advancedbilling/models/create_quantity_based_component.py +++ b/advancedbilling/models/create_quantity_based_component.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.quantity_based_component import QuantityBasedComponent +# ruff: noqa: E501 +from advancedbilling.models.quantity_based_component import ( + QuantityBasedComponent, +) -class CreateQuantityBasedComponent(object): +class CreateQuantityBasedComponent(object): """Implementation of the 'Create Quantity Based Component' model. Attributes: - quantity_based_component (QuantityBasedComponent): The model property - of type QuantityBasedComponent. - additional_properties (Dict[str, object]): The additional properties - for the model. + quantity_based_component (QuantityBasedComponent): The model property of type + QuantityBasedComponent. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "quantity_based_component": 'quantity_based_component' + "quantity_based_component": "quantity_based_component", } - def __init__(self, - quantity_based_component=None, - additional_properties=None): - """Constructor for the CreateQuantityBasedComponent class""" - + def __init__( + self, + quantity_based_component=None, + additional_properties=None): + """Initialize a CreateQuantityBasedComponent instance.""" # Initialize members of the class - self.quantity_based_component = quantity_based_component + self.quantity_based_component = quantity_based_component # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - quantity_based_component = QuantityBasedComponent.from_dictionary(dictionary.get('quantity_based_component')) if dictionary.get('quantity_based_component') else None + quantity_based_component =\ + QuantityBasedComponent.from_dictionary( + dictionary.get("quantity_based_component"))\ + if dictionary.get("quantity_based_component") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(quantity_based_component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'quantity_based_component={self.quantity_based_component!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _quantity_based_component=self.quantity_based_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"quantity_based_component={_quantity_based_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'quantity_based_component={self.quantity_based_component!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _quantity_based_component=self.quantity_based_component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"quantity_based_component={_quantity_based_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_reason_code.py b/advancedbilling/models/create_reason_code.py index f99da787..1a7914af 100644 --- a/advancedbilling/models/create_reason_code.py +++ b/advancedbilling/models/create_reason_code.py @@ -1,50 +1,48 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateReasonCode(object): - """Implementation of the 'Create Reason Code' model. Attributes: code (str): The unique identifier for the ReasonCode description (str): The friendly summary of what the code signifies position (int): The order that code appears in lists - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "code": 'code', - "description": 'description', - "position": 'position' + "code": "code", + "description": "description", + "position": "position", } _optionals = [ - 'position', + "position", ] - def __init__(self, - code=None, - description=None, - position=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateReasonCode class""" - + def __init__( + self, + code=None, + description=None, + position=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateReasonCode instance.""" # Initialize members of the class - self.code = code - self.description = description + self.code = code + self.description = description if position is not APIHelper.SKIP: - self.position = position + self.position = position # Add additional model properties to the instance if additional_properties is None: @@ -54,7 +52,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -65,16 +63,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - code = dictionary.get("code") if dictionary.get("code") else None - description = dictionary.get("description") if dictionary.get("description") else None - position = dictionary.get("position") if dictionary.get("position") else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else None + position =\ + dictionary.get("position")\ + if dictionary.get("position")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(code, description, @@ -82,15 +91,39 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'code={self.code!r}, ' - f'description={self.description!r}, ' - f'position={(self.position if hasattr(self, "position") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _code=self.code + _description=self.description + _position=( + self.position + if hasattr(self, "position") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!r}, " + f"description={_description!r}, " + f"position={_position!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'code={self.code!s}, ' - f'description={self.description!s}, ' - f'position={(self.position if hasattr(self, "position") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _code=self.code + _description=self.description + _position=( + self.position + if hasattr(self, "position") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!s}, " + f"description={_description!s}, " + f"position={_position!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_reason_code_request.py b/advancedbilling/models/create_reason_code_request.py index c2f7cc19..c2663e1c 100644 --- a/advancedbilling/models/create_reason_code_request.py +++ b/advancedbilling/models/create_reason_code_request.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_reason_code import CreateReasonCode +# ruff: noqa: E501 +from advancedbilling.models.create_reason_code import ( + CreateReasonCode, +) -class CreateReasonCodeRequest(object): +class CreateReasonCodeRequest(object): """Implementation of the 'Create Reason Code Request' model. Attributes: - reason_code (CreateReasonCode): The model property of type - CreateReasonCode. - additional_properties (Dict[str, object]): The additional properties - for the model. + reason_code (CreateReasonCode): The model property of type CreateReasonCode. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reason_code": 'reason_code' + "reason_code": "reason_code", } - def __init__(self, - reason_code=None, - additional_properties=None): - """Constructor for the CreateReasonCodeRequest class""" - + def __init__( + self, + reason_code=None, + additional_properties=None): + """Initialize a CreateReasonCodeRequest instance.""" # Initialize members of the class - self.reason_code = reason_code + self.reason_code = reason_code # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reason_code = CreateReasonCode.from_dictionary(dictionary.get('reason_code')) if dictionary.get('reason_code') else None + reason_code =\ + CreateReasonCode.from_dictionary( + dictionary.get("reason_code"))\ + if dictionary.get("reason_code") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reason_code, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reason_code={self.reason_code!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reason_code=self.reason_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason_code={_reason_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reason_code={self.reason_code!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reason_code=self.reason_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason_code={_reason_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_segment.py b/advancedbilling/models/create_segment.py index a873ec2b..57820425 100644 --- a/advancedbilling/models/create_segment.py +++ b/advancedbilling/models/create_segment.py @@ -1,87 +1,83 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.create_or_update_segment_price import ( + CreateOrUpdateSegmentPrice, +) class CreateSegment(object): - """Implementation of the 'Create Segment' model. Attributes: - segment_property_1_value (str | float | int | bool | None): A value - that will occur in your events that you want to bill upon. The - type of the value depends on the property type in the related - event based billing metric. - segment_property_2_value (str | float | int | bool | None): A value - that will occur in your events that you want to bill upon. The - type of the value depends on the property type in the related - event based billing metric. - segment_property_3_value (str | float | int | bool | None): A value - that will occur in your events that you want to bill upon. The - type of the value depends on the property type in the related - event based billing metric. - segment_property_4_value (str | float | int | bool | None): A value - that will occur in your events that you want to bill upon. The - type of the value depends on the property type in the related - event based billing metric. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + segment_property_1_value (str | float | int | bool | None): A value that will + occur in your events that you want to bill upon. The type of the value + depends on the property type in the related event based billing metric. + segment_property_2_value (str | float | int | bool | None): A value that will + occur in your events that you want to bill upon. The type of the value + depends on the property type in the related event based billing metric. + segment_property_3_value (str | float | int | bool | None): A value that will + occur in your events that you want to bill upon. The type of the value + depends on the property type in the related event based billing metric. + segment_property_4_value (str | float | int | bool | None): A value that will + occur in your events that you want to bill upon. The type of the value + depends on the property type in the related event based billing metric. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. prices (List[CreateOrUpdateSegmentPrice]): The model property of type List[CreateOrUpdateSegmentPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "pricing_scheme": 'pricing_scheme', - "segment_property_1_value": 'segment_property_1_value', - "segment_property_2_value": 'segment_property_2_value', - "segment_property_3_value": 'segment_property_3_value', - "segment_property_4_value": 'segment_property_4_value', - "prices": 'prices' + "pricing_scheme": "pricing_scheme", + "segment_property_1_value": "segment_property_1_value", + "segment_property_2_value": "segment_property_2_value", + "segment_property_3_value": "segment_property_3_value", + "segment_property_4_value": "segment_property_4_value", + "prices": "prices", } _optionals = [ - 'segment_property_1_value', - 'segment_property_2_value', - 'segment_property_3_value', - 'segment_property_4_value', - 'prices', + "segment_property_1_value", + "segment_property_2_value", + "segment_property_3_value", + "segment_property_4_value", + "prices", ] - def __init__(self, - pricing_scheme=None, - segment_property_1_value=APIHelper.SKIP, - segment_property_2_value=APIHelper.SKIP, - segment_property_3_value=APIHelper.SKIP, - segment_property_4_value=APIHelper.SKIP, - prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateSegment class""" - + def __init__( + self, + pricing_scheme=None, + segment_property_1_value=APIHelper.SKIP, + segment_property_2_value=APIHelper.SKIP, + segment_property_3_value=APIHelper.SKIP, + segment_property_4_value=APIHelper.SKIP, + prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateSegment instance.""" # Initialize members of the class if segment_property_1_value is not APIHelper.SKIP: - self.segment_property_1_value = segment_property_1_value + self.segment_property_1_value = segment_property_1_value if segment_property_2_value is not APIHelper.SKIP: - self.segment_property_2_value = segment_property_2_value + self.segment_property_2_value = segment_property_2_value if segment_property_3_value is not APIHelper.SKIP: - self.segment_property_3_value = segment_property_3_value + self.segment_property_3_value = segment_property_3_value if segment_property_4_value is not APIHelper.SKIP: - self.segment_property_4_value = segment_property_4_value - self.pricing_scheme = pricing_scheme + self.segment_property_4_value = segment_property_4_value + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices # Add additional model properties to the instance if additional_properties is None: @@ -91,7 +87,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -102,24 +98,55 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None - segment_property_1_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSegmentSegmentProperty1Value'), dictionary.get('segment_property_1_value'), False) if dictionary.get('segment_property_1_value') is not None else APIHelper.SKIP - segment_property_2_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSegmentSegmentProperty2Value'), dictionary.get('segment_property_2_value'), False) if dictionary.get('segment_property_2_value') is not None else APIHelper.SKIP - segment_property_3_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSegmentSegmentProperty3Value'), dictionary.get('segment_property_3_value'), False) if dictionary.get('segment_property_3_value') is not None else APIHelper.SKIP - segment_property_4_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSegmentSegmentProperty4Value'), dictionary.get('segment_property_4_value'), False) if dictionary.get('segment_property_4_value') is not None else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None + segment_property_1_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSegmentSegmentProperty1Value"), + dictionary.get("segment_property_1_value"), + False)\ + if dictionary.get("segment_property_1_value") is not None\ + else APIHelper.SKIP + segment_property_2_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSegmentSegmentProperty2Value"), + dictionary.get("segment_property_2_value"), + False)\ + if dictionary.get("segment_property_2_value") is not None\ + else APIHelper.SKIP + segment_property_3_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSegmentSegmentProperty3Value"), + dictionary.get("segment_property_3_value"), + False)\ + if dictionary.get("segment_property_3_value") is not None\ + else APIHelper.SKIP + segment_property_4_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSegmentSegmentProperty4Value"), + dictionary.get("segment_property_4_value"), + False)\ + if dictionary.get("segment_property_4_value") is not None\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [CreateOrUpdateSegmentPrice.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + CreateOrUpdateSegmentPrice.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(pricing_scheme, segment_property_1_value, @@ -130,21 +157,83 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segment_property_1_value={(self.segment_property_1_value if hasattr(self, "segment_property_1_value") else None)!r}, ' - f'segment_property_2_value={(self.segment_property_2_value if hasattr(self, "segment_property_2_value") else None)!r}, ' - f'segment_property_3_value={(self.segment_property_3_value if hasattr(self, "segment_property_3_value") else None)!r}, ' - f'segment_property_4_value={(self.segment_property_4_value if hasattr(self, "segment_property_4_value") else None)!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segment_property_1_value=( + self.segment_property_1_value + if hasattr(self, "segment_property_1_value") + else None + ) + _segment_property_2_value=( + self.segment_property_2_value + if hasattr(self, "segment_property_2_value") + else None + ) + _segment_property_3_value=( + self.segment_property_3_value + if hasattr(self, "segment_property_3_value") + else None + ) + _segment_property_4_value=( + self.segment_property_4_value + if hasattr(self, "segment_property_4_value") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment_property_1_value={_segment_property_1_value!r}, " + f"segment_property_2_value={_segment_property_2_value!r}, " + f"segment_property_3_value={_segment_property_3_value!r}, " + f"segment_property_4_value={_segment_property_4_value!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segment_property_1_value={(self.segment_property_1_value if hasattr(self, "segment_property_1_value") else None)!s}, ' - f'segment_property_2_value={(self.segment_property_2_value if hasattr(self, "segment_property_2_value") else None)!s}, ' - f'segment_property_3_value={(self.segment_property_3_value if hasattr(self, "segment_property_3_value") else None)!s}, ' - f'segment_property_4_value={(self.segment_property_4_value if hasattr(self, "segment_property_4_value") else None)!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segment_property_1_value=( + self.segment_property_1_value + if hasattr(self, "segment_property_1_value") + else None + ) + _segment_property_2_value=( + self.segment_property_2_value + if hasattr(self, "segment_property_2_value") + else None + ) + _segment_property_3_value=( + self.segment_property_3_value + if hasattr(self, "segment_property_3_value") + else None + ) + _segment_property_4_value=( + self.segment_property_4_value + if hasattr(self, "segment_property_4_value") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment_property_1_value={_segment_property_1_value!s}, " + f"segment_property_2_value={_segment_property_2_value!s}, " + f"segment_property_3_value={_segment_property_3_value!s}, " + f"segment_property_4_value={_segment_property_4_value!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_segment_request.py b/advancedbilling/models/create_segment_request.py index d44ff2b2..ba43bf0d 100644 --- a/advancedbilling/models/create_segment_request.py +++ b/advancedbilling/models/create_segment_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_segment import CreateSegment +# ruff: noqa: E501 +from advancedbilling.models.create_segment import ( + CreateSegment, +) -class CreateSegmentRequest(object): +class CreateSegmentRequest(object): """Implementation of the 'Create Segment Request' model. Attributes: segment (CreateSegment): The model property of type CreateSegment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segment": 'segment' + "segment": "segment", } - def __init__(self, - segment=None, - additional_properties=None): - """Constructor for the CreateSegmentRequest class""" - + def __init__( + self, + segment=None, + additional_properties=None): + """Initialize a CreateSegmentRequest instance.""" # Initialize members of the class - self.segment = segment + self.segment = segment # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - segment = CreateSegment.from_dictionary(dictionary.get('segment')) if dictionary.get('segment') else None + segment =\ + CreateSegment.from_dictionary( + dictionary.get("segment"))\ + if dictionary.get("segment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segment={self.segment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segment=self.segment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment={_segment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segment={self.segment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segment=self.segment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment={_segment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_signup_proforma_preview_include.py b/advancedbilling/models/create_signup_proforma_preview_include.py index 3ab3459b..e5ec88d3 100644 --- a/advancedbilling/models/create_signup_proforma_preview_include.py +++ b/advancedbilling/models/create_signup_proforma_preview_include.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CreateSignupProformaPreviewInclude(object): - """Implementation of the 'Create Signup Proforma Preview Include' enum. Attributes: NEXT_PROFORMA_INVOICE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - NEXT_PROFORMA_INVOICE = 'next_proforma_invoice' + + NEXT_PROFORMA_INVOICE = "next_proforma_invoice" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/create_subscription.py b/advancedbilling/models/create_subscription.py index 0a16396a..5285699d 100644 --- a/advancedbilling/models/create_subscription.py +++ b/advancedbilling/models/create_subscription.py @@ -1,116 +1,127 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.ach_agreement import ACHAgreement -from advancedbilling.models.agreement_acceptance import AgreementAcceptance -from advancedbilling.models.bank_account_attributes import BankAccountAttributes -from advancedbilling.models.calendar_billing import CalendarBilling -from advancedbilling.models.create_subscription_component import CreateSubscriptionComponent -from advancedbilling.models.customer_attributes import CustomerAttributes -from advancedbilling.models.group_settings import GroupSettings -from advancedbilling.models.payment_profile_attributes import PaymentProfileAttributes -from advancedbilling.models.subscription_custom_price import SubscriptionCustomPrice -from advancedbilling.models.upsert_prepaid_configuration import UpsertPrepaidConfiguration +from advancedbilling.models.ach_agreement import ( + ACHAgreement, +) +from advancedbilling.models.agreement_acceptance import ( + AgreementAcceptance, +) +from advancedbilling.models.bank_account_attributes import ( + BankAccountAttributes, +) +from advancedbilling.models.calendar_billing import ( + CalendarBilling, +) +from advancedbilling.models.create_subscription_component import ( + CreateSubscriptionComponent, +) +from advancedbilling.models.customer_attributes import ( + CustomerAttributes, +) +from advancedbilling.models.group_settings import ( + GroupSettings, +) +from advancedbilling.models.payment_profile_attributes import ( + PaymentProfileAttributes, +) +from advancedbilling.models.subscription_custom_price import ( + SubscriptionCustomPrice, +) +from advancedbilling.models.upsert_prepaid_configuration import ( + UpsertPrepaidConfiguration, +) class CreateSubscription(object): - """Implementation of the 'Create Subscription' model. Attributes: product_handle (str): The API Handle of the product for which you are - creating a subscription. Required, unless a `product_id` is given - instead. - product_id (int): The Product ID of the product for which you are - creating a subscription. The product ID is not currently - published, so we recommend using the API Handle instead. - product_price_point_handle (str): The user-friendly API handle of a - product's particular price point. - product_price_point_id (int): The ID of the particular price point on - the product. + creating a subscription. Required, unless a `product_id` is given instead. + product_id (int): The Product ID of the product for which you are creating a + subscription. The product ID is not currently published, so we recommend + using the API Handle instead. + product_price_point_handle (str): The user-friendly API handle of a product's + particular price point. + product_price_point_id (int): The ID of the particular price point on the + product. custom_price (SubscriptionCustomPrice): (Optional) Used in place of - `product_price_point_id` to define a custom price point unique to - the subscription + `product_price_point_id` to define a custom price point unique to the + subscription. A subscription can have up to 30 custom price points. + Exceeding this limit will result in an API error. coupon_code (str): (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. coupon_codes (List[str]): An array for all the coupons attached to the subscription. - payment_collection_method (CollectionMethod): The type of payment - collection to be used in the subscription. For legacy Statements - Architecture valid options are - `invoice`, `automatic`. For - current Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. - receives_invoice_emails (str): (Optional) Default: True - Whether or - not this subscription is set to receive emails related to this - subscription. - net_terms (str): (Optional) Default: null The number of days after - renewal (on invoice billing) that a subscription is due. A value - between 0 (due immediately) and 180. - customer_id (int): The ID of an existing customer within Chargify. - Required, unless a `customer_reference` or a set of - `customer_attributes` is given. + payment_collection_method (CollectionMethod): The type of payment collection + to be used in the subscription. For legacy Statements Architecture valid + options are - `invoice`, `automatic`. For current Relationship Invoicing + Architecture valid options are - `remittance`, `automatic`, `prepaid`. + receives_invoice_emails (str): (Optional) Default: True - Whether or not this + subscription is set to receive emails related to this subscription. + net_terms (str): (Optional) Default: null The number of days after renewal + (on invoice billing) that a subscription is due. A value between 0 (due + immediately) and 180. + customer_id (int): The ID of an existing customer within Chargify. Required, + unless a `customer_reference` or a set of `customer_attributes` is given. next_billing_at (datetime): (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal - schedule. See the notes on “Date/Time Format” in our [subscription - import - documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489 - 107213-Advanced-Billing-Subscription-Imports#date-format). If you - provide a next_billing_at timestamp that is in the future, no - trial or initial charges will be applied when you create the - subscription. In fact, no payment will be captured at all. The - first payment will be captured, according to the prices defined by - the product, near the time specified by next_billing_at. If you do - not provide a value for next_billing_at, any trial and/or initial - charges will be assessed and charged at the time of subscription - creation. If the card cannot be successfully charged, the - subscription will not be created. See further notes in the section - on Importing Subscriptions. - initial_billing_at (datetime): (Optional) Set this attribute to a - future date/time to create a subscription in the Awaiting Signup - state, rather than Active or Trialing. You can omit the - initial_billing_at date to activate the subscription immediately. - In the Awaiting Signup state, a subscription behaves like any - other. It can be canceled, allocated to, or have its billing date - changed. etc. When the initial_billing_at date hits, the - subscription will transition to the expected state. If the product - has a trial, the subscription will enter a trial, otherwise it - will go active. Setup fees will be respected either before or - after the trial, as configured on the price point. If the payment - is due at the initial_billing_at and it fails the subscription - will be immediately canceled. See the [subscription - import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213- - Advanced-Billing-Subscription-Imports#date-format) documentation - for more information about Date/Time Formats. - defer_signup (bool): (Optional) Set this attribute to true to create - the subscription in the Awaiting Signup Date state. Use this when - you want to create a subscription that has an unknown first - billing date. When the first billing date is known, update a - subscription and set the `initial_billing_at` date. The - subscription moves to the Awaiting Signup state with a scheduled - initial billing date. You can omit the initial_billing_at date to - activate the subscription immediately. See [Subscription - States](https://maxio-chargify.zendesk.com/hc/en-us/articles/540422 - 2005773-Subscription-States) for more information. - stored_credential_transaction_id (int): For European sites subject to - PSD2 and using 3D Secure, this can be used to reference a previous - transaction for the customer. This will ensure the card will be - charged successfully at renewal. + schedule. See the notes on “Date/Time Format” in our [subscription import + documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213- + Advanced-Billing-Subscription-Imports#date-format). If you provide a + next_billing_at timestamp that is in the future, no trial or initial + charges will be applied when you create the subscription. In fact, no + payment will be captured at all. The first payment will be captured, + according to the prices defined by the product, near the time specified + by next_billing_at. If you do not provide a value for next_billing_at, + any trial and/or initial charges will be assessed and charged at the time + of subscription creation. If the card cannot be successfully charged, the + subscription will not be created. See further notes in the section on + Importing Subscriptions. + initial_billing_at (datetime): (Optional) Set this attribute to a future + date/time to create a subscription in the Awaiting Signup state, rather + than Active or Trialing. You can omit the initial_billing_at date to + activate the subscription immediately. In the Awaiting Signup state, a + subscription behaves like any other. It can be canceled, allocated to, or + have its billing date changed. etc. When the initial_billing_at date + hits, the subscription will transition to the expected state. If the + product has a trial, the subscription will enter a trial, otherwise it + will go active. Setup fees will be respected either before or after the + trial, as configured on the price point. If the payment is due at the + initial_billing_at and it fails the subscription will be immediately + canceled. See the [subscription + import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advance + d-Billing-Subscription-Imports#date-format) documentation for more + information about Date/Time Formats. + defer_signup (bool): (Optional) Set this attribute to true to create the + subscription in the Awaiting Signup Date state. Use this when you want to + create a subscription that has an unknown first billing date. When the + first billing date is known, update a subscription and set the + `initial_billing_at` date. The subscription moves to the Awaiting Signup + state with a scheduled initial billing date. You can omit the + initial_billing_at date to activate the subscription immediately. See + [Subscription + States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773 + -Subscription-States) for more information. + stored_credential_transaction_id (int): For European sites subject to PSD2 + and using 3D Secure, this can be used to reference a previous transaction + for the customer. This will ensure the card will be charged successfully + at renewal. sales_rep_id (int): The model property of type int. - payment_profile_id (int): The Payment Profile ID of an existing card - or bank account, which belongs to an existing customer to use for - payment for this subscription. If the card, bank account, or - customer does not exist already, or if you want to use a new - (unstored) card or bank account for the subscription, use - `payment_profile_attributes` instead to create a new payment - profile along with the subscription. (This value is available on - an existing subscription via the API as `credit_card` > id or + payment_profile_id (int): The Payment Profile ID of an existing card or bank + account, which belongs to an existing customer to use for payment for + this subscription. If the card, bank account, or customer does not exist + already, or if you want to use a new (unstored) card or bank account for + the subscription, use `payment_profile_attributes` instead to create a + new payment profile along with the subscription. (This value is available + on an existing subscription via the API as `credit_card` > id or `bank_account` > id) reference (str): The reference value (provided by your app) for the subscription itself. @@ -118,85 +129,80 @@ class CreateSubscription(object): CustomerAttributes. payment_profile_attributes (PaymentProfileAttributes): alias to credit_card_attributes - credit_card_attributes (PaymentProfileAttributes): Credit Card data to - create a new Subscription. Interchangeable with - `payment_profile_attributes` property. - bank_account_attributes (BankAccountAttributes): The model property of - type BankAccountAttributes. + credit_card_attributes (PaymentProfileAttributes): Credit Card data to create + a new Subscription. Interchangeable with `payment_profile_attributes` + property. + bank_account_attributes (BankAccountAttributes): The model property of type + BankAccountAttributes. components (List[CreateSubscriptionComponent]): (Optional) An array of component ids and quantities to be added to the subscription. See - [Components](https://maxio.zendesk.com/hc/en-us/articles/2426114152 - 2189-Components-Overview) for more information. - calendar_billing (CalendarBilling): (Optional). Cannot be used when - also specifying next_billing_at - metafields (Dict[str, str]): (Optional) A set of key/value pairs - representing custom fields and their values. Metafields will be - created “on-the-fly” in your site for a given key, if they have - not been created yet. - customer_reference (str): The reference value (provided by your app) - of an existing customer within Chargify. Required, unless a - `customer_id` or a set of `customer_attributes` is given. + [Components](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Co + mponents-Overview) for more information. + calendar_billing (CalendarBilling): (Optional). Cannot be used when also + specifying next_billing_at + metafields (Dict[str, str]): (Optional) A set of key/value pairs representing + custom fields and their values. Metafields will be created “on-the-fly” + in your site for a given key, if they have not been created yet. + customer_reference (str): The reference value (provided by your app) of an + existing customer within Chargify. Required, unless a `customer_id` or a + set of `customer_attributes` is given. group (GroupSettings): The model property of type GroupSettings. ref (str): A valid referral code. (optional, see - [Referrals](https://maxio.zendesk.com/hc/en-us/articles/24286981223 - 693-Referrals-Reference#how-to-obtain-referral-codes) for more - details). If supplied, must be valid, or else subscription - creation will fail. + [Referrals](https://maxio.zendesk.com/hc/en-us/articles/24286981223693-Ref + errals-Reference#how-to-obtain-referral-codes) for more details). If + supplied, must be valid, or else subscription creation will fail. cancellation_message (str): (Optional) Can be used when canceling a - subscription (via the HTTP DELETE method) to make a note about the - reason for cancellation. + subscription (via the HTTP DELETE method) to make a note about the reason + for cancellation. cancellation_method (str): (Optional) Can be used when canceling a - subscription (via the HTTP DELETE method) to make a note about how - the subscription was canceled. - currency (str): (Optional) If Multi-Currency is enabled and the - currency is configured in Chargify, pass it at signup to create a - subscription on a non-default currency. Note that you cannot - update the currency of an existing subscription. + subscription (via the HTTP DELETE method) to make a note about how the + subscription was canceled. + currency (str): (Optional) If Multi-Currency is enabled and the currency is + configured in Chargify, pass it at signup to create a subscription on a + non-default currency. Note that you cannot update the currency of an + existing subscription. expires_at (datetime): Timestamp giving the expiration date of this - subscription (if any). You may manually change the expiration date - at any point during a subscription period. - expiration_tracks_next_billing_change (str): (Optional, default false) - When set to true, and when next_billing_at is present, if the - subscription expires, the expires_at will be shifted by the same - amount of time as the difference between the old and new “next - billing” dates. - agreement_terms (str): (Optional) The ACH authorization agreement - terms. If enabled, an email will be sent to the customer with a - copy of the terms. + subscription (if any). You may manually change the expiration date at any + point during a subscription period. + expiration_tracks_next_billing_change (str): (Optional, default false) When + set to true, and when next_billing_at is present, if the subscription + expires, the expires_at will be shifted by the same amount of time as the + difference between the old and new “next billing” dates. + agreement_terms (str): (Optional) The ACH authorization agreement terms. If + enabled, an email will be sent to the customer with a copy of the terms. authorizer_first_name (str): (Optional) The first name of the person authorizing the ACH agreement. authorizer_last_name (str): (Optional) The last name of the person authorizing the ACH agreement. calendar_billing_first_charge (str): (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), - “immediate” (the full product price will be charged immediately), - or “delayed” (the full product price will be charged with the - first scheduled renewal). - reason_code (str): (Optional) Can be used when canceling a - subscription (via the HTTP DELETE method) to indicate why a - subscription was canceled. - product_change_delayed (bool): (Optional) used only for Delayed - Product Change When set to true, indicates that a changed value - for product_handle should schedule the product change to the next + “immediate” (the full product price will be charged immediately), or + “delayed” (the full product price will be charged with the first + scheduled renewal). + reason_code (str): (Optional) Can be used when canceling a subscription (via + the HTTP DELETE method) to indicate why a subscription was canceled. + product_change_delayed (bool): (Optional) used only for Delayed Product + Change When set to true, indicates that a changed value for + product_handle should schedule the product change to the next subscription renewal. - offer_id (str | int | None): Use in place of passing product and - component information to set up the subscription with an existing - offer. May be either the Chargify id of the offer or its handle - prefixed with `handle:`.er - prepaid_configuration (UpsertPrepaidConfiguration): The model property - of type UpsertPrepaidConfiguration. - previous_billing_at (datetime): Providing a previous_billing_at that - is in the past will set the current_period_starts_at when the - subscription is created. It will also set activated_at if not - explicitly passed during the subscription import. Can only be used - if next_billing_at is also passed. Using this option will allow - you to set the period start for the subscription so mid period - component allocations have the correct prorated amount. + offer_id (str | int | None): Use in place of passing product and component + information to set up the subscription with an existing offer. May be + either the Chargify id of the offer or its handle prefixed with + `handle:`.er + prepaid_configuration (UpsertPrepaidConfiguration): The model property of + type UpsertPrepaidConfiguration. + previous_billing_at (datetime): Providing a previous_billing_at that is in + the past will set the current_period_starts_at when the subscription is + created. It will also set activated_at if not explicitly passed during + the subscription import. Can only be used if next_billing_at is also + passed. Using this option will allow you to set the period start for the + subscription so mid period component allocations have the correct + prorated amount. import_mrr (bool): Setting this attribute to true will cause the - subscription's MRR to be added to your MRR analytics immediately. - For this value to be honored, a next_billing_at must be present - and set to a future date. This key/value will not be returned in - the subscription response body. + subscription's MRR to be added to your MRR analytics immediately. For + this value to be honored, a next_billing_at must be present and set to a + future date. This key/value will not be returned in the subscription + response body. canceled_at (datetime): The model property of type datetime. activated_at (datetime): The model property of type datetime. agreement_acceptance (AgreementAcceptance): Required when creating a @@ -204,282 +210,305 @@ class CreateSubscription(object): ach_agreement (ACHAgreement): (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. dunning_communication_delay_enabled (bool): Enable Communication Delay - feature, making sure no communication (email or SMS) is sent to - the Customer between 9PM and 8AM in time zone set by the + feature, making sure no communication (email or SMS) is sent to the + Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. dunning_communication_delay_time_zone (str): Time zone for the Dunning Communication Delay feature. - skip_billing_manifest_taxes (bool): Valid only for the Subscription - Preview endpoint. When set to `true` it skips calculating taxes - for the current and next billing manifests. - additional_properties (Dict[str, object]): The additional properties - for the model. + skip_billing_manifest_taxes (bool): Valid only for the Subscription Preview + endpoint. When set to `true` it skips calculating taxes for the current + and next billing manifests. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_handle": 'product_handle', - "product_id": 'product_id', - "product_price_point_handle": 'product_price_point_handle', - "product_price_point_id": 'product_price_point_id', - "custom_price": 'custom_price', - "coupon_code": 'coupon_code', - "coupon_codes": 'coupon_codes', - "payment_collection_method": 'payment_collection_method', - "receives_invoice_emails": 'receives_invoice_emails', - "net_terms": 'net_terms', - "customer_id": 'customer_id', - "next_billing_at": 'next_billing_at', - "initial_billing_at": 'initial_billing_at', - "defer_signup": 'defer_signup', - "stored_credential_transaction_id": 'stored_credential_transaction_id', - "sales_rep_id": 'sales_rep_id', - "payment_profile_id": 'payment_profile_id', - "reference": 'reference', - "customer_attributes": 'customer_attributes', - "payment_profile_attributes": 'payment_profile_attributes', - "credit_card_attributes": 'credit_card_attributes', - "bank_account_attributes": 'bank_account_attributes', - "components": 'components', - "calendar_billing": 'calendar_billing', - "metafields": 'metafields', - "customer_reference": 'customer_reference', - "group": 'group', - "ref": 'ref', - "cancellation_message": 'cancellation_message', - "cancellation_method": 'cancellation_method', - "currency": 'currency', - "expires_at": 'expires_at', - "expiration_tracks_next_billing_change": 'expiration_tracks_next_billing_change', - "agreement_terms": 'agreement_terms', - "authorizer_first_name": 'authorizer_first_name', - "authorizer_last_name": 'authorizer_last_name', - "calendar_billing_first_charge": 'calendar_billing_first_charge', - "reason_code": 'reason_code', - "product_change_delayed": 'product_change_delayed', - "offer_id": 'offer_id', - "prepaid_configuration": 'prepaid_configuration', - "previous_billing_at": 'previous_billing_at', - "import_mrr": 'import_mrr', - "canceled_at": 'canceled_at', - "activated_at": 'activated_at', - "agreement_acceptance": 'agreement_acceptance', - "ach_agreement": 'ach_agreement', - "dunning_communication_delay_enabled": 'dunning_communication_delay_enabled', - "dunning_communication_delay_time_zone": 'dunning_communication_delay_time_zone', - "skip_billing_manifest_taxes": 'skip_billing_manifest_taxes' + "product_handle": "product_handle", + "product_id": "product_id", + "product_price_point_handle": "product_price_point_handle", + "product_price_point_id": "product_price_point_id", + "custom_price": "custom_price", + "coupon_code": "coupon_code", + "coupon_codes": "coupon_codes", + "payment_collection_method": "payment_collection_method", + "receives_invoice_emails": "receives_invoice_emails", + "net_terms": "net_terms", + "customer_id": "customer_id", + "next_billing_at": "next_billing_at", + "initial_billing_at": "initial_billing_at", + "defer_signup": "defer_signup", + "stored_credential_transaction_id": "stored_credential_transaction_id", + "sales_rep_id": "sales_rep_id", + "payment_profile_id": "payment_profile_id", + "reference": "reference", + "customer_attributes": "customer_attributes", + "payment_profile_attributes": "payment_profile_attributes", + "credit_card_attributes": "credit_card_attributes", + "bank_account_attributes": "bank_account_attributes", + "components": "components", + "calendar_billing": "calendar_billing", + "metafields": "metafields", + "customer_reference": "customer_reference", + "group": "group", + "ref": "ref", + "cancellation_message": "cancellation_message", + "cancellation_method": "cancellation_method", + "currency": "currency", + "expires_at": "expires_at", + "expiration_tracks_next_billing_change": + "expiration_tracks_next_billing_change", + "agreement_terms": "agreement_terms", + "authorizer_first_name": "authorizer_first_name", + "authorizer_last_name": "authorizer_last_name", + "calendar_billing_first_charge": "calendar_billing_first_charge", + "reason_code": "reason_code", + "product_change_delayed": "product_change_delayed", + "offer_id": "offer_id", + "prepaid_configuration": "prepaid_configuration", + "previous_billing_at": "previous_billing_at", + "import_mrr": "import_mrr", + "canceled_at": "canceled_at", + "activated_at": "activated_at", + "agreement_acceptance": "agreement_acceptance", + "ach_agreement": "ach_agreement", + "dunning_communication_delay_enabled": "dunning_communication_delay_enabled", + "dunning_communication_delay_time_zone": + "dunning_communication_delay_time_zone", + "skip_billing_manifest_taxes": "skip_billing_manifest_taxes", } _optionals = [ - 'product_handle', - 'product_id', - 'product_price_point_handle', - 'product_price_point_id', - 'custom_price', - 'coupon_code', - 'coupon_codes', - 'payment_collection_method', - 'receives_invoice_emails', - 'net_terms', - 'customer_id', - 'next_billing_at', - 'initial_billing_at', - 'defer_signup', - 'stored_credential_transaction_id', - 'sales_rep_id', - 'payment_profile_id', - 'reference', - 'customer_attributes', - 'payment_profile_attributes', - 'credit_card_attributes', - 'bank_account_attributes', - 'components', - 'calendar_billing', - 'metafields', - 'customer_reference', - 'group', - 'ref', - 'cancellation_message', - 'cancellation_method', - 'currency', - 'expires_at', - 'expiration_tracks_next_billing_change', - 'agreement_terms', - 'authorizer_first_name', - 'authorizer_last_name', - 'calendar_billing_first_charge', - 'reason_code', - 'product_change_delayed', - 'offer_id', - 'prepaid_configuration', - 'previous_billing_at', - 'import_mrr', - 'canceled_at', - 'activated_at', - 'agreement_acceptance', - 'ach_agreement', - 'dunning_communication_delay_enabled', - 'dunning_communication_delay_time_zone', - 'skip_billing_manifest_taxes', + "product_handle", + "product_id", + "product_price_point_handle", + "product_price_point_id", + "custom_price", + "coupon_code", + "coupon_codes", + "payment_collection_method", + "receives_invoice_emails", + "net_terms", + "customer_id", + "next_billing_at", + "initial_billing_at", + "defer_signup", + "stored_credential_transaction_id", + "sales_rep_id", + "payment_profile_id", + "reference", + "customer_attributes", + "payment_profile_attributes", + "credit_card_attributes", + "bank_account_attributes", + "components", + "calendar_billing", + "metafields", + "customer_reference", + "group", + "ref", + "cancellation_message", + "cancellation_method", + "currency", + "expires_at", + "expiration_tracks_next_billing_change", + "agreement_terms", + "authorizer_first_name", + "authorizer_last_name", + "calendar_billing_first_charge", + "reason_code", + "product_change_delayed", + "offer_id", + "prepaid_configuration", + "previous_billing_at", + "import_mrr", + "canceled_at", + "activated_at", + "agreement_acceptance", + "ach_agreement", + "dunning_communication_delay_enabled", + "dunning_communication_delay_time_zone", + "skip_billing_manifest_taxes", ] _nullables = [ - 'dunning_communication_delay_time_zone', + "dunning_communication_delay_time_zone", ] - def __init__(self, - product_handle=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_price_point_handle=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - coupon_code=APIHelper.SKIP, - coupon_codes=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - receives_invoice_emails=APIHelper.SKIP, - net_terms=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - next_billing_at=APIHelper.SKIP, - initial_billing_at=APIHelper.SKIP, - defer_signup=False, - stored_credential_transaction_id=APIHelper.SKIP, - sales_rep_id=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - reference=APIHelper.SKIP, - customer_attributes=APIHelper.SKIP, - payment_profile_attributes=APIHelper.SKIP, - credit_card_attributes=APIHelper.SKIP, - bank_account_attributes=APIHelper.SKIP, - components=APIHelper.SKIP, - calendar_billing=APIHelper.SKIP, - metafields=APIHelper.SKIP, - customer_reference=APIHelper.SKIP, - group=APIHelper.SKIP, - ref=APIHelper.SKIP, - cancellation_message=APIHelper.SKIP, - cancellation_method=APIHelper.SKIP, - currency=APIHelper.SKIP, - expires_at=APIHelper.SKIP, - expiration_tracks_next_billing_change=APIHelper.SKIP, - agreement_terms=APIHelper.SKIP, - authorizer_first_name=APIHelper.SKIP, - authorizer_last_name=APIHelper.SKIP, - calendar_billing_first_charge=APIHelper.SKIP, - reason_code=APIHelper.SKIP, - product_change_delayed=APIHelper.SKIP, - offer_id=APIHelper.SKIP, - prepaid_configuration=APIHelper.SKIP, - previous_billing_at=APIHelper.SKIP, - import_mrr=APIHelper.SKIP, - canceled_at=APIHelper.SKIP, - activated_at=APIHelper.SKIP, - agreement_acceptance=APIHelper.SKIP, - ach_agreement=APIHelper.SKIP, - dunning_communication_delay_enabled=False, - dunning_communication_delay_time_zone=APIHelper.SKIP, - skip_billing_manifest_taxes=False, - additional_properties=None): - """Constructor for the CreateSubscription class""" - + def __init__( + self, + product_handle=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_price_point_handle=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + coupon_code=APIHelper.SKIP, + coupon_codes=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + receives_invoice_emails=APIHelper.SKIP, + net_terms=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + next_billing_at=APIHelper.SKIP, + initial_billing_at=APIHelper.SKIP, + defer_signup=False, + stored_credential_transaction_id=APIHelper.SKIP, + sales_rep_id=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + reference=APIHelper.SKIP, + customer_attributes=APIHelper.SKIP, + payment_profile_attributes=APIHelper.SKIP, + credit_card_attributes=APIHelper.SKIP, + bank_account_attributes=APIHelper.SKIP, + components=APIHelper.SKIP, + calendar_billing=APIHelper.SKIP, + metafields=APIHelper.SKIP, + customer_reference=APIHelper.SKIP, + group=APIHelper.SKIP, + ref=APIHelper.SKIP, + cancellation_message=APIHelper.SKIP, + cancellation_method=APIHelper.SKIP, + currency=APIHelper.SKIP, + expires_at=APIHelper.SKIP, + expiration_tracks_next_billing_change=APIHelper.SKIP, + agreement_terms=APIHelper.SKIP, + authorizer_first_name=APIHelper.SKIP, + authorizer_last_name=APIHelper.SKIP, + calendar_billing_first_charge=APIHelper.SKIP, + reason_code=APIHelper.SKIP, + product_change_delayed=APIHelper.SKIP, + offer_id=APIHelper.SKIP, + prepaid_configuration=APIHelper.SKIP, + previous_billing_at=APIHelper.SKIP, + import_mrr=APIHelper.SKIP, + canceled_at=APIHelper.SKIP, + activated_at=APIHelper.SKIP, + agreement_acceptance=APIHelper.SKIP, + ach_agreement=APIHelper.SKIP, + dunning_communication_delay_enabled=False, + dunning_communication_delay_time_zone=APIHelper.SKIP, + skip_billing_manifest_taxes=False, + additional_properties=None): + """Initialize a CreateSubscription instance.""" # Initialize members of the class if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_price_point_handle is not APIHelper.SKIP: - self.product_price_point_handle = product_price_point_handle + self.product_price_point_handle = product_price_point_handle if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price if coupon_code is not APIHelper.SKIP: - self.coupon_code = coupon_code + self.coupon_code = coupon_code if coupon_codes is not APIHelper.SKIP: - self.coupon_codes = coupon_codes + self.coupon_codes = coupon_codes if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method if receives_invoice_emails is not APIHelper.SKIP: - self.receives_invoice_emails = receives_invoice_emails + self.receives_invoice_emails = receives_invoice_emails if net_terms is not APIHelper.SKIP: - self.net_terms = net_terms + self.net_terms = net_terms if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if next_billing_at is not APIHelper.SKIP: - self.next_billing_at = APIHelper.apply_datetime_converter(next_billing_at, APIHelper.RFC3339DateTime) if next_billing_at else None + self.next_billing_at =\ + APIHelper.apply_datetime_converter( + next_billing_at, APIHelper.RFC3339DateTime)\ + if next_billing_at else None if initial_billing_at is not APIHelper.SKIP: - self.initial_billing_at = APIHelper.apply_datetime_converter(initial_billing_at, APIHelper.RFC3339DateTime) if initial_billing_at else None - self.defer_signup = defer_signup + self.initial_billing_at =\ + APIHelper.apply_datetime_converter( + initial_billing_at, APIHelper.RFC3339DateTime)\ + if initial_billing_at else None + self.defer_signup = defer_signup if stored_credential_transaction_id is not APIHelper.SKIP: - self.stored_credential_transaction_id = stored_credential_transaction_id + self.stored_credential_transaction_id = stored_credential_transaction_id if sales_rep_id is not APIHelper.SKIP: - self.sales_rep_id = sales_rep_id + self.sales_rep_id = sales_rep_id if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if customer_attributes is not APIHelper.SKIP: - self.customer_attributes = customer_attributes + self.customer_attributes = customer_attributes if payment_profile_attributes is not APIHelper.SKIP: - self.payment_profile_attributes = payment_profile_attributes + self.payment_profile_attributes = payment_profile_attributes if credit_card_attributes is not APIHelper.SKIP: - self.credit_card_attributes = credit_card_attributes + self.credit_card_attributes = credit_card_attributes if bank_account_attributes is not APIHelper.SKIP: - self.bank_account_attributes = bank_account_attributes + self.bank_account_attributes = bank_account_attributes if components is not APIHelper.SKIP: - self.components = components + self.components = components if calendar_billing is not APIHelper.SKIP: - self.calendar_billing = calendar_billing + self.calendar_billing = calendar_billing if metafields is not APIHelper.SKIP: - self.metafields = metafields + self.metafields = metafields if customer_reference is not APIHelper.SKIP: - self.customer_reference = customer_reference + self.customer_reference = customer_reference if group is not APIHelper.SKIP: - self.group = group + self.group = group if ref is not APIHelper.SKIP: - self.ref = ref + self.ref = ref if cancellation_message is not APIHelper.SKIP: - self.cancellation_message = cancellation_message + self.cancellation_message = cancellation_message if cancellation_method is not APIHelper.SKIP: - self.cancellation_method = cancellation_method + self.cancellation_method = cancellation_method if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if expires_at is not APIHelper.SKIP: - self.expires_at = APIHelper.apply_datetime_converter(expires_at, APIHelper.RFC3339DateTime) if expires_at else None + self.expires_at =\ + APIHelper.apply_datetime_converter( + expires_at, APIHelper.RFC3339DateTime)\ + if expires_at else None if expiration_tracks_next_billing_change is not APIHelper.SKIP: - self.expiration_tracks_next_billing_change = expiration_tracks_next_billing_change + self.expiration_tracks_next_billing_change =\ + expiration_tracks_next_billing_change if agreement_terms is not APIHelper.SKIP: - self.agreement_terms = agreement_terms + self.agreement_terms = agreement_terms if authorizer_first_name is not APIHelper.SKIP: - self.authorizer_first_name = authorizer_first_name + self.authorizer_first_name = authorizer_first_name if authorizer_last_name is not APIHelper.SKIP: - self.authorizer_last_name = authorizer_last_name + self.authorizer_last_name = authorizer_last_name if calendar_billing_first_charge is not APIHelper.SKIP: - self.calendar_billing_first_charge = calendar_billing_first_charge + self.calendar_billing_first_charge = calendar_billing_first_charge if reason_code is not APIHelper.SKIP: - self.reason_code = reason_code + self.reason_code = reason_code if product_change_delayed is not APIHelper.SKIP: - self.product_change_delayed = product_change_delayed + self.product_change_delayed = product_change_delayed if offer_id is not APIHelper.SKIP: - self.offer_id = offer_id + self.offer_id = offer_id if prepaid_configuration is not APIHelper.SKIP: - self.prepaid_configuration = prepaid_configuration + self.prepaid_configuration = prepaid_configuration if previous_billing_at is not APIHelper.SKIP: - self.previous_billing_at = APIHelper.apply_datetime_converter(previous_billing_at, APIHelper.RFC3339DateTime) if previous_billing_at else None + self.previous_billing_at =\ + APIHelper.apply_datetime_converter( + previous_billing_at, APIHelper.RFC3339DateTime)\ + if previous_billing_at else None if import_mrr is not APIHelper.SKIP: - self.import_mrr = import_mrr + self.import_mrr = import_mrr if canceled_at is not APIHelper.SKIP: - self.canceled_at = APIHelper.apply_datetime_converter(canceled_at, APIHelper.RFC3339DateTime) if canceled_at else None + self.canceled_at =\ + APIHelper.apply_datetime_converter( + canceled_at, APIHelper.RFC3339DateTime)\ + if canceled_at else None if activated_at is not APIHelper.SKIP: - self.activated_at = APIHelper.apply_datetime_converter(activated_at, APIHelper.RFC3339DateTime) if activated_at else None + self.activated_at =\ + APIHelper.apply_datetime_converter( + activated_at, APIHelper.RFC3339DateTime)\ + if activated_at else None if agreement_acceptance is not APIHelper.SKIP: - self.agreement_acceptance = agreement_acceptance + self.agreement_acceptance = agreement_acceptance if ach_agreement is not APIHelper.SKIP: - self.ach_agreement = ach_agreement - self.dunning_communication_delay_enabled = dunning_communication_delay_enabled + self.ach_agreement = ach_agreement + self.dunning_communication_delay_enabled =\ + dunning_communication_delay_enabled if dunning_communication_delay_time_zone is not APIHelper.SKIP: - self.dunning_communication_delay_time_zone = dunning_communication_delay_time_zone - self.skip_billing_manifest_taxes = skip_billing_manifest_taxes + self.dunning_communication_delay_time_zone =\ + dunning_communication_delay_time_zone + self.skip_billing_manifest_taxes = skip_billing_manifest_taxes # Add additional model properties to the instance if additional_properties is None: @@ -489,7 +518,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -500,68 +529,229 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_handle = dictionary.get("product_handle") if dictionary.get("product_handle") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_price_point_handle = dictionary.get("product_price_point_handle") if dictionary.get("product_price_point_handle") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - custom_price = SubscriptionCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP - coupon_code = dictionary.get("coupon_code") if dictionary.get("coupon_code") else APIHelper.SKIP - coupon_codes = dictionary.get("coupon_codes") if dictionary.get("coupon_codes") else APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP - receives_invoice_emails = dictionary.get("receives_invoice_emails") if dictionary.get("receives_invoice_emails") else APIHelper.SKIP - net_terms = dictionary.get("net_terms") if dictionary.get("net_terms") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - next_billing_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_billing_at")).datetime if dictionary.get("next_billing_at") else APIHelper.SKIP - initial_billing_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("initial_billing_at")).datetime if dictionary.get("initial_billing_at") else APIHelper.SKIP - defer_signup = dictionary.get("defer_signup") if dictionary.get("defer_signup") else False - stored_credential_transaction_id = dictionary.get("stored_credential_transaction_id") if dictionary.get("stored_credential_transaction_id") else APIHelper.SKIP - sales_rep_id = dictionary.get("sales_rep_id") if dictionary.get("sales_rep_id") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP - customer_attributes = CustomerAttributes.from_dictionary(dictionary.get('customer_attributes')) if 'customer_attributes' in dictionary.keys() else APIHelper.SKIP - payment_profile_attributes = PaymentProfileAttributes.from_dictionary(dictionary.get('payment_profile_attributes')) if 'payment_profile_attributes' in dictionary.keys() else APIHelper.SKIP - credit_card_attributes = PaymentProfileAttributes.from_dictionary(dictionary.get('credit_card_attributes')) if 'credit_card_attributes' in dictionary.keys() else APIHelper.SKIP - bank_account_attributes = BankAccountAttributes.from_dictionary(dictionary.get('bank_account_attributes')) if 'bank_account_attributes' in dictionary.keys() else APIHelper.SKIP + product_handle =\ + dictionary.get("product_handle")\ + if dictionary.get("product_handle")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_price_point_handle =\ + dictionary.get("product_price_point_handle")\ + if dictionary.get("product_price_point_handle")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + custom_price =\ + SubscriptionCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + coupon_code =\ + dictionary.get("coupon_code")\ + if dictionary.get("coupon_code")\ + else APIHelper.SKIP + coupon_codes =\ + dictionary.get("coupon_codes")\ + if dictionary.get("coupon_codes")\ + else APIHelper.SKIP + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + receives_invoice_emails =\ + dictionary.get("receives_invoice_emails")\ + if dictionary.get("receives_invoice_emails")\ + else APIHelper.SKIP + net_terms =\ + dictionary.get("net_terms")\ + if dictionary.get("net_terms")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + next_billing_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_billing_at")).datetime\ + if dictionary.get("next_billing_at") else APIHelper.SKIP + initial_billing_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("initial_billing_at")).datetime\ + if dictionary.get("initial_billing_at") else APIHelper.SKIP + defer_signup =\ + dictionary.get("defer_signup")\ + if dictionary.get("defer_signup")\ + else False + stored_credential_transaction_id =\ + dictionary.get("stored_credential_transaction_id")\ + if dictionary.get("stored_credential_transaction_id")\ + else APIHelper.SKIP + sales_rep_id =\ + dictionary.get("sales_rep_id")\ + if dictionary.get("sales_rep_id")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + customer_attributes =\ + CustomerAttributes.from_dictionary( + dictionary.get("customer_attributes"))\ + if "customer_attributes" in dictionary.keys()\ + else APIHelper.SKIP + payment_profile_attributes =\ + PaymentProfileAttributes.from_dictionary( + dictionary.get("payment_profile_attributes"))\ + if "payment_profile_attributes" in dictionary.keys()\ + else APIHelper.SKIP + credit_card_attributes =\ + PaymentProfileAttributes.from_dictionary( + dictionary.get("credit_card_attributes"))\ + if "credit_card_attributes" in dictionary.keys()\ + else APIHelper.SKIP + bank_account_attributes =\ + BankAccountAttributes.from_dictionary( + dictionary.get("bank_account_attributes"))\ + if "bank_account_attributes" in dictionary.keys()\ + else APIHelper.SKIP components = None - if dictionary.get('components') is not None: - components = [CreateSubscriptionComponent.from_dictionary(x) for x in dictionary.get('components')] + if dictionary.get("components") is not None: + components = [ + CreateSubscriptionComponent.from_dictionary(x) + for x in dictionary.get("components") + ] else: components = APIHelper.SKIP - calendar_billing = CalendarBilling.from_dictionary(dictionary.get('calendar_billing')) if 'calendar_billing' in dictionary.keys() else APIHelper.SKIP - metafields = dictionary.get("metafields") if dictionary.get("metafields") else APIHelper.SKIP - customer_reference = dictionary.get("customer_reference") if dictionary.get("customer_reference") else APIHelper.SKIP - group = GroupSettings.from_dictionary(dictionary.get('group')) if 'group' in dictionary.keys() else APIHelper.SKIP - ref = dictionary.get("ref") if dictionary.get("ref") else APIHelper.SKIP - cancellation_message = dictionary.get("cancellation_message") if dictionary.get("cancellation_message") else APIHelper.SKIP - cancellation_method = dictionary.get("cancellation_method") if dictionary.get("cancellation_method") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else APIHelper.SKIP - expiration_tracks_next_billing_change = dictionary.get("expiration_tracks_next_billing_change") if dictionary.get("expiration_tracks_next_billing_change") else APIHelper.SKIP - agreement_terms = dictionary.get("agreement_terms") if dictionary.get("agreement_terms") else APIHelper.SKIP - authorizer_first_name = dictionary.get("authorizer_first_name") if dictionary.get("authorizer_first_name") else APIHelper.SKIP - authorizer_last_name = dictionary.get("authorizer_last_name") if dictionary.get("authorizer_last_name") else APIHelper.SKIP - calendar_billing_first_charge = dictionary.get("calendar_billing_first_charge") if dictionary.get("calendar_billing_first_charge") else APIHelper.SKIP - reason_code = dictionary.get("reason_code") if dictionary.get("reason_code") else APIHelper.SKIP - product_change_delayed = dictionary.get("product_change_delayed") if "product_change_delayed" in dictionary.keys() else APIHelper.SKIP - offer_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSubscriptionOfferId'), dictionary.get('offer_id'), False) if dictionary.get('offer_id') is not None else APIHelper.SKIP - prepaid_configuration = UpsertPrepaidConfiguration.from_dictionary(dictionary.get('prepaid_configuration')) if 'prepaid_configuration' in dictionary.keys() else APIHelper.SKIP - previous_billing_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("previous_billing_at")).datetime if dictionary.get("previous_billing_at") else APIHelper.SKIP - import_mrr = dictionary.get("import_mrr") if "import_mrr" in dictionary.keys() else APIHelper.SKIP - canceled_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("canceled_at")).datetime if dictionary.get("canceled_at") else APIHelper.SKIP - activated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("activated_at")).datetime if dictionary.get("activated_at") else APIHelper.SKIP - agreement_acceptance = AgreementAcceptance.from_dictionary(dictionary.get('agreement_acceptance')) if 'agreement_acceptance' in dictionary.keys() else APIHelper.SKIP - ach_agreement = ACHAgreement.from_dictionary(dictionary.get('ach_agreement')) if 'ach_agreement' in dictionary.keys() else APIHelper.SKIP - dunning_communication_delay_enabled = dictionary.get("dunning_communication_delay_enabled") if dictionary.get("dunning_communication_delay_enabled") else False - dunning_communication_delay_time_zone = dictionary.get("dunning_communication_delay_time_zone") if "dunning_communication_delay_time_zone" in dictionary.keys() else APIHelper.SKIP - skip_billing_manifest_taxes = dictionary.get("skip_billing_manifest_taxes") if dictionary.get("skip_billing_manifest_taxes") else False + calendar_billing =\ + CalendarBilling.from_dictionary( + dictionary.get("calendar_billing"))\ + if "calendar_billing" in dictionary.keys()\ + else APIHelper.SKIP + metafields =\ + dictionary.get("metafields")\ + if dictionary.get("metafields")\ + else APIHelper.SKIP + customer_reference =\ + dictionary.get("customer_reference")\ + if dictionary.get("customer_reference")\ + else APIHelper.SKIP + group =\ + GroupSettings.from_dictionary( + dictionary.get("group"))\ + if "group" in dictionary.keys()\ + else APIHelper.SKIP + ref =\ + dictionary.get("ref")\ + if dictionary.get("ref")\ + else APIHelper.SKIP + cancellation_message =\ + dictionary.get("cancellation_message")\ + if dictionary.get("cancellation_message")\ + else APIHelper.SKIP + cancellation_method =\ + dictionary.get("cancellation_method")\ + if dictionary.get("cancellation_method")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + expires_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("expires_at")).datetime\ + if dictionary.get("expires_at") else APIHelper.SKIP + expiration_tracks_next_billing_change =\ + dictionary.get("expiration_tracks_next_billing_change")\ + if dictionary.get("expiration_tracks_next_billing_change")\ + else APIHelper.SKIP + agreement_terms =\ + dictionary.get("agreement_terms")\ + if dictionary.get("agreement_terms")\ + else APIHelper.SKIP + authorizer_first_name =\ + dictionary.get("authorizer_first_name")\ + if dictionary.get("authorizer_first_name")\ + else APIHelper.SKIP + authorizer_last_name =\ + dictionary.get("authorizer_last_name")\ + if dictionary.get("authorizer_last_name")\ + else APIHelper.SKIP + calendar_billing_first_charge =\ + dictionary.get("calendar_billing_first_charge")\ + if dictionary.get("calendar_billing_first_charge")\ + else APIHelper.SKIP + reason_code =\ + dictionary.get("reason_code")\ + if dictionary.get("reason_code")\ + else APIHelper.SKIP + product_change_delayed =\ + dictionary.get("product_change_delayed")\ + if "product_change_delayed" in dictionary.keys()\ + else APIHelper.SKIP + offer_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSubscriptionOfferId"), + dictionary.get("offer_id"), + False)\ + if dictionary.get("offer_id") is not None\ + else APIHelper.SKIP + prepaid_configuration =\ + UpsertPrepaidConfiguration.from_dictionary( + dictionary.get("prepaid_configuration"))\ + if "prepaid_configuration" in dictionary.keys()\ + else APIHelper.SKIP + previous_billing_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("previous_billing_at")).datetime\ + if dictionary.get("previous_billing_at") else APIHelper.SKIP + import_mrr =\ + dictionary.get("import_mrr")\ + if "import_mrr" in dictionary.keys()\ + else APIHelper.SKIP + canceled_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("canceled_at")).datetime\ + if dictionary.get("canceled_at") else APIHelper.SKIP + activated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("activated_at")).datetime\ + if dictionary.get("activated_at") else APIHelper.SKIP + agreement_acceptance =\ + AgreementAcceptance.from_dictionary( + dictionary.get("agreement_acceptance"))\ + if "agreement_acceptance" in dictionary.keys()\ + else APIHelper.SKIP + ach_agreement =\ + ACHAgreement.from_dictionary( + dictionary.get("ach_agreement"))\ + if "ach_agreement" in dictionary.keys()\ + else APIHelper.SKIP + dunning_communication_delay_enabled =\ + dictionary.get("dunning_communication_delay_enabled")\ + if dictionary.get("dunning_communication_delay_enabled")\ + else False + dunning_communication_delay_time_zone =\ + dictionary.get("dunning_communication_delay_time_zone")\ + if "dunning_communication_delay_time_zone" in dictionary.keys()\ + else APIHelper.SKIP + skip_billing_manifest_taxes =\ + dictionary.get("skip_billing_manifest_taxes")\ + if dictionary.get("skip_billing_manifest_taxes")\ + else False + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_handle, product_id, @@ -616,109 +806,619 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!r}, ' - f'coupon_codes={(self.coupon_codes if hasattr(self, "coupon_codes") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'receives_invoice_emails={(self.receives_invoice_emails if hasattr(self, "receives_invoice_emails") else None)!r}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'next_billing_at={(self.next_billing_at if hasattr(self, "next_billing_at") else None)!r}, ' - f'initial_billing_at={(self.initial_billing_at if hasattr(self, "initial_billing_at") else None)!r}, ' - f'defer_signup={(self.defer_signup if hasattr(self, "defer_signup") else None)!r}, ' - f'stored_credential_transaction_id={(self.stored_credential_transaction_id if hasattr(self, "stored_credential_transaction_id") else None)!r}, ' - f'sales_rep_id={(self.sales_rep_id if hasattr(self, "sales_rep_id") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'customer_attributes={(self.customer_attributes if hasattr(self, "customer_attributes") else None)!r}, ' - f'payment_profile_attributes={(self.payment_profile_attributes if hasattr(self, "payment_profile_attributes") else None)!r}, ' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!r}, ' - f'bank_account_attributes={(self.bank_account_attributes if hasattr(self, "bank_account_attributes") else None)!r}, ' - f'components={(self.components if hasattr(self, "components") else None)!r}, ' - f'calendar_billing={(self.calendar_billing if hasattr(self, "calendar_billing") else None)!r}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!r}, ' - f'customer_reference={(self.customer_reference if hasattr(self, "customer_reference") else None)!r}, ' - f'group={(self.group if hasattr(self, "group") else None)!r}, ' - f'ref={(self.ref if hasattr(self, "ref") else None)!r}, ' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!r}, ' - f'cancellation_method={(self.cancellation_method if hasattr(self, "cancellation_method") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'expiration_tracks_next_billing_change={(self.expiration_tracks_next_billing_change if hasattr(self, "expiration_tracks_next_billing_change") else None)!r}, ' - f'agreement_terms={(self.agreement_terms if hasattr(self, "agreement_terms") else None)!r}, ' - f'authorizer_first_name={(self.authorizer_first_name if hasattr(self, "authorizer_first_name") else None)!r}, ' - f'authorizer_last_name={(self.authorizer_last_name if hasattr(self, "authorizer_last_name") else None)!r}, ' - f'calendar_billing_first_charge={(self.calendar_billing_first_charge if hasattr(self, "calendar_billing_first_charge") else None)!r}, ' - f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!r}, ' - f'product_change_delayed={(self.product_change_delayed if hasattr(self, "product_change_delayed") else None)!r}, ' - f'offer_id={(self.offer_id if hasattr(self, "offer_id") else None)!r}, ' - f'prepaid_configuration={(self.prepaid_configuration if hasattr(self, "prepaid_configuration") else None)!r}, ' - f'previous_billing_at={(self.previous_billing_at if hasattr(self, "previous_billing_at") else None)!r}, ' - f'import_mrr={(self.import_mrr if hasattr(self, "import_mrr") else None)!r}, ' - f'canceled_at={(self.canceled_at if hasattr(self, "canceled_at") else None)!r}, ' - f'activated_at={(self.activated_at if hasattr(self, "activated_at") else None)!r}, ' - f'agreement_acceptance={(self.agreement_acceptance if hasattr(self, "agreement_acceptance") else None)!r}, ' - f'ach_agreement={(self.ach_agreement if hasattr(self, "ach_agreement") else None)!r}, ' - f'dunning_communication_delay_enabled={(self.dunning_communication_delay_enabled if hasattr(self, "dunning_communication_delay_enabled") else None)!r}, ' - f'dunning_communication_delay_time_zone={(self.dunning_communication_delay_time_zone if hasattr(self, "dunning_communication_delay_time_zone") else None)!r}, ' - f'skip_billing_manifest_taxes={(self.skip_billing_manifest_taxes if hasattr(self, "skip_billing_manifest_taxes") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _coupon_codes=( + self.coupon_codes + if hasattr(self, "coupon_codes") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _receives_invoice_emails=( + self.receives_invoice_emails + if hasattr(self, "receives_invoice_emails") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _next_billing_at=( + self.next_billing_at + if hasattr(self, "next_billing_at") + else None + ) + _initial_billing_at=( + self.initial_billing_at + if hasattr(self, "initial_billing_at") + else None + ) + _defer_signup=( + self.defer_signup + if hasattr(self, "defer_signup") + else None + ) + _stored_credential_transaction_id=( + self.stored_credential_transaction_id + if hasattr(self, "stored_credential_transaction_id") + else None + ) + _sales_rep_id=( + self.sales_rep_id + if hasattr(self, "sales_rep_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _customer_attributes=( + self.customer_attributes + if hasattr(self, "customer_attributes") + else None + ) + _payment_profile_attributes=( + self.payment_profile_attributes + if hasattr(self, "payment_profile_attributes") + else None + ) + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _bank_account_attributes=( + self.bank_account_attributes + if hasattr(self, "bank_account_attributes") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _calendar_billing=( + self.calendar_billing + if hasattr(self, "calendar_billing") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _customer_reference=( + self.customer_reference + if hasattr(self, "customer_reference") + else None + ) + _group=( + self.group + if hasattr(self, "group") + else None + ) + _ref=( + self.ref + if hasattr(self, "ref") + else None + ) + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _cancellation_method=( + self.cancellation_method + if hasattr(self, "cancellation_method") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _expiration_tracks_next_billing_change=( + self.expiration_tracks_next_billing_change + if hasattr(self, "expiration_tracks_next_billing_change") + else None + ) + _agreement_terms=( + self.agreement_terms + if hasattr(self, "agreement_terms") + else None + ) + _authorizer_first_name=( + self.authorizer_first_name + if hasattr(self, "authorizer_first_name") + else None + ) + _authorizer_last_name=( + self.authorizer_last_name + if hasattr(self, "authorizer_last_name") + else None + ) + _calendar_billing_first_charge=( + self.calendar_billing_first_charge + if hasattr(self, "calendar_billing_first_charge") + else None + ) + _reason_code=( + self.reason_code + if hasattr(self, "reason_code") + else None + ) + _product_change_delayed=( + self.product_change_delayed + if hasattr(self, "product_change_delayed") + else None + ) + _offer_id=( + self.offer_id + if hasattr(self, "offer_id") + else None + ) + _prepaid_configuration=( + self.prepaid_configuration + if hasattr(self, "prepaid_configuration") + else None + ) + _previous_billing_at=( + self.previous_billing_at + if hasattr(self, "previous_billing_at") + else None + ) + _import_mrr=( + self.import_mrr + if hasattr(self, "import_mrr") + else None + ) + _canceled_at=( + self.canceled_at + if hasattr(self, "canceled_at") + else None + ) + _activated_at=( + self.activated_at + if hasattr(self, "activated_at") + else None + ) + _agreement_acceptance=( + self.agreement_acceptance + if hasattr(self, "agreement_acceptance") + else None + ) + _ach_agreement=( + self.ach_agreement + if hasattr(self, "ach_agreement") + else None + ) + _dunning_communication_delay_enabled=( + self.dunning_communication_delay_enabled + if hasattr(self, "dunning_communication_delay_enabled") + else None + ) + _dunning_communication_delay_time_zone=( + self.dunning_communication_delay_time_zone + if hasattr(self, "dunning_communication_delay_time_zone") + else None + ) + _skip_billing_manifest_taxes=( + self.skip_billing_manifest_taxes + if hasattr(self, "skip_billing_manifest_taxes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_handle={_product_handle!r}, " + f"product_id={_product_id!r}, " + f"product_price_point_handle={_product_price_point_handle!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"custom_price={_custom_price!r}, " + f"coupon_code={_coupon_code!r}, " + f"coupon_codes={_coupon_codes!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"receives_invoice_emails={_receives_invoice_emails!r}, " + f"net_terms={_net_terms!r}, " + f"customer_id={_customer_id!r}, " + f"next_billing_at={_next_billing_at!r}, " + f"initial_billing_at={_initial_billing_at!r}, " + f"defer_signup={_defer_signup!r}, " + f"stored_credential_transaction_id={_stored_credential_transaction_id!r}, " + f"sales_rep_id={_sales_rep_id!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"reference={_reference!r}, " + f"customer_attributes={_customer_attributes!r}, " + f"payment_profile_attributes={_payment_profile_attributes!r}, " + f"credit_card_attributes={_credit_card_attributes!r}, " + f"bank_account_attributes={_bank_account_attributes!r}, " + f"components={_components!r}, " + f"calendar_billing={_calendar_billing!r}, " + f"metafields={_metafields!r}, " + f"customer_reference={_customer_reference!r}, " + f"group={_group!r}, " + f"ref={_ref!r}, " + f"cancellation_message={_cancellation_message!r}, " + f"cancellation_method={_cancellation_method!r}, " + f"currency={_currency!r}, " + f"expires_at={_expires_at!r}, " + f"expiration_tracks_next_billing_change={_expiration_tracks_next_billing_change!r}, " + f"agreement_terms={_agreement_terms!r}, " + f"authorizer_first_name={_authorizer_first_name!r}, " + f"authorizer_last_name={_authorizer_last_name!r}, " + f"calendar_billing_first_charge={_calendar_billing_first_charge!r}, " + f"reason_code={_reason_code!r}, " + f"product_change_delayed={_product_change_delayed!r}, " + f"offer_id={_offer_id!r}, " + f"prepaid_configuration={_prepaid_configuration!r}, " + f"previous_billing_at={_previous_billing_at!r}, " + f"import_mrr={_import_mrr!r}, " + f"canceled_at={_canceled_at!r}, " + f"activated_at={_activated_at!r}, " + f"agreement_acceptance={_agreement_acceptance!r}, " + f"ach_agreement={_ach_agreement!r}, " + f"dunning_communication_delay_enabled={_dunning_communication_delay_enabled!r}, " + f"dunning_communication_delay_time_zone={_dunning_communication_delay_time_zone!r}, " + f"skip_billing_manifest_taxes={_skip_billing_manifest_taxes!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!s}, ' - f'coupon_codes={(self.coupon_codes if hasattr(self, "coupon_codes") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'receives_invoice_emails={(self.receives_invoice_emails if hasattr(self, "receives_invoice_emails") else None)!s}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'next_billing_at={(self.next_billing_at if hasattr(self, "next_billing_at") else None)!s}, ' - f'initial_billing_at={(self.initial_billing_at if hasattr(self, "initial_billing_at") else None)!s}, ' - f'defer_signup={(self.defer_signup if hasattr(self, "defer_signup") else None)!s}, ' - f'stored_credential_transaction_id={(self.stored_credential_transaction_id if hasattr(self, "stored_credential_transaction_id") else None)!s}, ' - f'sales_rep_id={(self.sales_rep_id if hasattr(self, "sales_rep_id") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'customer_attributes={(self.customer_attributes if hasattr(self, "customer_attributes") else None)!s}, ' - f'payment_profile_attributes={(self.payment_profile_attributes if hasattr(self, "payment_profile_attributes") else None)!s}, ' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!s}, ' - f'bank_account_attributes={(self.bank_account_attributes if hasattr(self, "bank_account_attributes") else None)!s}, ' - f'components={(self.components if hasattr(self, "components") else None)!s}, ' - f'calendar_billing={(self.calendar_billing if hasattr(self, "calendar_billing") else None)!s}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!s}, ' - f'customer_reference={(self.customer_reference if hasattr(self, "customer_reference") else None)!s}, ' - f'group={(self.group if hasattr(self, "group") else None)!s}, ' - f'ref={(self.ref if hasattr(self, "ref") else None)!s}, ' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!s}, ' - f'cancellation_method={(self.cancellation_method if hasattr(self, "cancellation_method") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'expiration_tracks_next_billing_change={(self.expiration_tracks_next_billing_change if hasattr(self, "expiration_tracks_next_billing_change") else None)!s}, ' - f'agreement_terms={(self.agreement_terms if hasattr(self, "agreement_terms") else None)!s}, ' - f'authorizer_first_name={(self.authorizer_first_name if hasattr(self, "authorizer_first_name") else None)!s}, ' - f'authorizer_last_name={(self.authorizer_last_name if hasattr(self, "authorizer_last_name") else None)!s}, ' - f'calendar_billing_first_charge={(self.calendar_billing_first_charge if hasattr(self, "calendar_billing_first_charge") else None)!s}, ' - f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!s}, ' - f'product_change_delayed={(self.product_change_delayed if hasattr(self, "product_change_delayed") else None)!s}, ' - f'offer_id={(self.offer_id if hasattr(self, "offer_id") else None)!s}, ' - f'prepaid_configuration={(self.prepaid_configuration if hasattr(self, "prepaid_configuration") else None)!s}, ' - f'previous_billing_at={(self.previous_billing_at if hasattr(self, "previous_billing_at") else None)!s}, ' - f'import_mrr={(self.import_mrr if hasattr(self, "import_mrr") else None)!s}, ' - f'canceled_at={(self.canceled_at if hasattr(self, "canceled_at") else None)!s}, ' - f'activated_at={(self.activated_at if hasattr(self, "activated_at") else None)!s}, ' - f'agreement_acceptance={(self.agreement_acceptance if hasattr(self, "agreement_acceptance") else None)!s}, ' - f'ach_agreement={(self.ach_agreement if hasattr(self, "ach_agreement") else None)!s}, ' - f'dunning_communication_delay_enabled={(self.dunning_communication_delay_enabled if hasattr(self, "dunning_communication_delay_enabled") else None)!s}, ' - f'dunning_communication_delay_time_zone={(self.dunning_communication_delay_time_zone if hasattr(self, "dunning_communication_delay_time_zone") else None)!s}, ' - f'skip_billing_manifest_taxes={(self.skip_billing_manifest_taxes if hasattr(self, "skip_billing_manifest_taxes") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _coupon_codes=( + self.coupon_codes + if hasattr(self, "coupon_codes") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _receives_invoice_emails=( + self.receives_invoice_emails + if hasattr(self, "receives_invoice_emails") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _next_billing_at=( + self.next_billing_at + if hasattr(self, "next_billing_at") + else None + ) + _initial_billing_at=( + self.initial_billing_at + if hasattr(self, "initial_billing_at") + else None + ) + _defer_signup=( + self.defer_signup + if hasattr(self, "defer_signup") + else None + ) + _stored_credential_transaction_id=( + self.stored_credential_transaction_id + if hasattr(self, "stored_credential_transaction_id") + else None + ) + _sales_rep_id=( + self.sales_rep_id + if hasattr(self, "sales_rep_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _customer_attributes=( + self.customer_attributes + if hasattr(self, "customer_attributes") + else None + ) + _payment_profile_attributes=( + self.payment_profile_attributes + if hasattr(self, "payment_profile_attributes") + else None + ) + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _bank_account_attributes=( + self.bank_account_attributes + if hasattr(self, "bank_account_attributes") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _calendar_billing=( + self.calendar_billing + if hasattr(self, "calendar_billing") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _customer_reference=( + self.customer_reference + if hasattr(self, "customer_reference") + else None + ) + _group=( + self.group + if hasattr(self, "group") + else None + ) + _ref=( + self.ref + if hasattr(self, "ref") + else None + ) + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _cancellation_method=( + self.cancellation_method + if hasattr(self, "cancellation_method") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _expiration_tracks_next_billing_change=( + self.expiration_tracks_next_billing_change + if hasattr(self, "expiration_tracks_next_billing_change") + else None + ) + _agreement_terms=( + self.agreement_terms + if hasattr(self, "agreement_terms") + else None + ) + _authorizer_first_name=( + self.authorizer_first_name + if hasattr(self, "authorizer_first_name") + else None + ) + _authorizer_last_name=( + self.authorizer_last_name + if hasattr(self, "authorizer_last_name") + else None + ) + _calendar_billing_first_charge=( + self.calendar_billing_first_charge + if hasattr(self, "calendar_billing_first_charge") + else None + ) + _reason_code=( + self.reason_code + if hasattr(self, "reason_code") + else None + ) + _product_change_delayed=( + self.product_change_delayed + if hasattr(self, "product_change_delayed") + else None + ) + _offer_id=( + self.offer_id + if hasattr(self, "offer_id") + else None + ) + _prepaid_configuration=( + self.prepaid_configuration + if hasattr(self, "prepaid_configuration") + else None + ) + _previous_billing_at=( + self.previous_billing_at + if hasattr(self, "previous_billing_at") + else None + ) + _import_mrr=( + self.import_mrr + if hasattr(self, "import_mrr") + else None + ) + _canceled_at=( + self.canceled_at + if hasattr(self, "canceled_at") + else None + ) + _activated_at=( + self.activated_at + if hasattr(self, "activated_at") + else None + ) + _agreement_acceptance=( + self.agreement_acceptance + if hasattr(self, "agreement_acceptance") + else None + ) + _ach_agreement=( + self.ach_agreement + if hasattr(self, "ach_agreement") + else None + ) + _dunning_communication_delay_enabled=( + self.dunning_communication_delay_enabled + if hasattr(self, "dunning_communication_delay_enabled") + else None + ) + _dunning_communication_delay_time_zone=( + self.dunning_communication_delay_time_zone + if hasattr(self, "dunning_communication_delay_time_zone") + else None + ) + _skip_billing_manifest_taxes=( + self.skip_billing_manifest_taxes + if hasattr(self, "skip_billing_manifest_taxes") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_handle={_product_handle!s}, " + f"product_id={_product_id!s}, " + f"product_price_point_handle={_product_price_point_handle!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"custom_price={_custom_price!s}, " + f"coupon_code={_coupon_code!s}, " + f"coupon_codes={_coupon_codes!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"receives_invoice_emails={_receives_invoice_emails!s}, " + f"net_terms={_net_terms!s}, " + f"customer_id={_customer_id!s}, " + f"next_billing_at={_next_billing_at!s}, " + f"initial_billing_at={_initial_billing_at!s}, " + f"defer_signup={_defer_signup!s}, " + f"stored_credential_transaction_id={_stored_credential_transaction_id!s}, " + f"sales_rep_id={_sales_rep_id!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"reference={_reference!s}, " + f"customer_attributes={_customer_attributes!s}, " + f"payment_profile_attributes={_payment_profile_attributes!s}, " + f"credit_card_attributes={_credit_card_attributes!s}, " + f"bank_account_attributes={_bank_account_attributes!s}, " + f"components={_components!s}, " + f"calendar_billing={_calendar_billing!s}, " + f"metafields={_metafields!s}, " + f"customer_reference={_customer_reference!s}, " + f"group={_group!s}, " + f"ref={_ref!s}, " + f"cancellation_message={_cancellation_message!s}, " + f"cancellation_method={_cancellation_method!s}, " + f"currency={_currency!s}, " + f"expires_at={_expires_at!s}, " + f"expiration_tracks_next_billing_change={_expiration_tracks_next_billing_change!s}, " + f"agreement_terms={_agreement_terms!s}, " + f"authorizer_first_name={_authorizer_first_name!s}, " + f"authorizer_last_name={_authorizer_last_name!s}, " + f"calendar_billing_first_charge={_calendar_billing_first_charge!s}, " + f"reason_code={_reason_code!s}, " + f"product_change_delayed={_product_change_delayed!s}, " + f"offer_id={_offer_id!s}, " + f"prepaid_configuration={_prepaid_configuration!s}, " + f"previous_billing_at={_previous_billing_at!s}, " + f"import_mrr={_import_mrr!s}, " + f"canceled_at={_canceled_at!s}, " + f"activated_at={_activated_at!s}, " + f"agreement_acceptance={_agreement_acceptance!s}, " + f"ach_agreement={_ach_agreement!s}, " + f"dunning_communication_delay_enabled={_dunning_communication_delay_enabled!s}, " + f"dunning_communication_delay_time_zone={_dunning_communication_delay_time_zone!s}, " + f"skip_billing_manifest_taxes={_skip_billing_manifest_taxes!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_subscription_component.py b/advancedbilling/models/create_subscription_component.py index 3701f927..62553164 100644 --- a/advancedbilling/models/create_subscription_component.py +++ b/advancedbilling/models/create_subscription_component.py @@ -1,83 +1,81 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.component_custom_price import ( + ComponentCustomPrice, +) class CreateSubscriptionComponent(object): - """Implementation of the 'Create Subscription Component' model. Attributes: - component_id (int | str | None): The model property of type int | str - | None. + component_id (int | str | None): The model property of type int | str | None. enabled (bool): Used for on/off components only. unit_balance (int): Used for metered and events based components. - allocated_quantity (int | str | None): Used for quantity based - components. + allocated_quantity (int | str | None): Used for quantity based components. quantity (int): Deprecated. Use `allocated_quantity` instead. - price_point_id (int | str | None): The model property of type int | - str | None. - custom_price (ComponentCustomPrice): Create or update custom pricing - unique to the subscription. Used in place of `price_point_id`. - additional_properties (Dict[str, object]): The additional properties - for the model. + price_point_id (int | str | None): The model property of type int | str | + None. + custom_price (ComponentCustomPrice): Create or update custom pricing unique + to the subscription. Used in place of `price_point_id`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "enabled": 'enabled', - "unit_balance": 'unit_balance', - "allocated_quantity": 'allocated_quantity', - "quantity": 'quantity', - "price_point_id": 'price_point_id', - "custom_price": 'custom_price' + "component_id": "component_id", + "enabled": "enabled", + "unit_balance": "unit_balance", + "allocated_quantity": "allocated_quantity", + "quantity": "quantity", + "price_point_id": "price_point_id", + "custom_price": "custom_price", } _optionals = [ - 'component_id', - 'enabled', - 'unit_balance', - 'allocated_quantity', - 'quantity', - 'price_point_id', - 'custom_price', + "component_id", + "enabled", + "unit_balance", + "allocated_quantity", + "quantity", + "price_point_id", + "custom_price", ] - def __init__(self, - component_id=APIHelper.SKIP, - enabled=APIHelper.SKIP, - unit_balance=APIHelper.SKIP, - allocated_quantity=APIHelper.SKIP, - quantity=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateSubscriptionComponent class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + enabled=APIHelper.SKIP, + unit_balance=APIHelper.SKIP, + allocated_quantity=APIHelper.SKIP, + quantity=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateSubscriptionComponent instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if enabled is not APIHelper.SKIP: - self.enabled = enabled + self.enabled = enabled if unit_balance is not APIHelper.SKIP: - self.unit_balance = unit_balance + self.unit_balance = unit_balance if allocated_quantity is not APIHelper.SKIP: - self.allocated_quantity = allocated_quantity + self.allocated_quantity = allocated_quantity if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price # Add additional model properties to the instance if additional_properties is None: @@ -87,7 +85,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -98,21 +96,54 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSubscriptionComponentComponentId'), dictionary.get('component_id'), False) if dictionary.get('component_id') is not None else APIHelper.SKIP - enabled = dictionary.get("enabled") if "enabled" in dictionary.keys() else APIHelper.SKIP - unit_balance = dictionary.get("unit_balance") if dictionary.get("unit_balance") else APIHelper.SKIP - allocated_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSubscriptionComponentAllocatedQuantity'), dictionary.get('allocated_quantity'), False) if dictionary.get('allocated_quantity') is not None else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - price_point_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateSubscriptionComponentPricePointId'), dictionary.get('price_point_id'), False) if dictionary.get('price_point_id') is not None else APIHelper.SKIP - custom_price = ComponentCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP + component_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSubscriptionComponentComponentId"), + dictionary.get("component_id"), + False)\ + if dictionary.get("component_id") is not None\ + else APIHelper.SKIP + enabled =\ + dictionary.get("enabled")\ + if "enabled" in dictionary.keys()\ + else APIHelper.SKIP + unit_balance =\ + dictionary.get("unit_balance")\ + if dictionary.get("unit_balance")\ + else APIHelper.SKIP + allocated_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSubscriptionComponentAllocatedQuantity"), + dictionary.get("allocated_quantity"), + False)\ + if dictionary.get("allocated_quantity") is not None\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSubscriptionComponentPricePointId"), + dictionary.get("price_point_id"), + False)\ + if dictionary.get("price_point_id") is not None\ + else APIHelper.SKIP + custom_price =\ + ComponentCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, enabled, @@ -125,7 +156,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -136,7 +167,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -146,23 +176,103 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'enabled={(self.enabled if hasattr(self, "enabled") else None)!r}, ' - f'unit_balance={(self.unit_balance if hasattr(self, "unit_balance") else None)!r}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _enabled=( + self.enabled + if hasattr(self, "enabled") + else None + ) + _unit_balance=( + self.unit_balance + if hasattr(self, "unit_balance") + else None + ) + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"enabled={_enabled!r}, " + f"unit_balance={_unit_balance!r}, " + f"allocated_quantity={_allocated_quantity!r}, " + f"quantity={_quantity!r}, " + f"price_point_id={_price_point_id!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'enabled={(self.enabled if hasattr(self, "enabled") else None)!s}, ' - f'unit_balance={(self.unit_balance if hasattr(self, "unit_balance") else None)!s}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _enabled=( + self.enabled + if hasattr(self, "enabled") + else None + ) + _unit_balance=( + self.unit_balance + if hasattr(self, "unit_balance") + else None + ) + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"enabled={_enabled!s}, " + f"unit_balance={_unit_balance!s}, " + f"allocated_quantity={_allocated_quantity!s}, " + f"quantity={_quantity!s}, " + f"price_point_id={_price_point_id!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_subscription_group.py b/advancedbilling/models/create_subscription_group.py index 3c496849..19536219 100644 --- a/advancedbilling/models/create_subscription_group.py +++ b/advancedbilling/models/create_subscription_group.py @@ -1,46 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreateSubscriptionGroup(object): - """Implementation of the 'Create Subscription Group' model. Attributes: subscription_id (int): The model property of type int. member_ids (List[int]): The model property of type List[int]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_id": 'subscription_id', - "member_ids": 'member_ids' + "subscription_id": "subscription_id", + "member_ids": "member_ids", } _optionals = [ - 'member_ids', + "member_ids", ] - def __init__(self, - subscription_id=None, - member_ids=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateSubscriptionGroup class""" - + def __init__( + self, + subscription_id=None, + member_ids=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateSubscriptionGroup instance.""" # Initialize members of the class - self.subscription_id = subscription_id + self.subscription_id = subscription_id if member_ids is not APIHelper.SKIP: - self.member_ids = member_ids + self.member_ids = member_ids # Add additional model properties to the instance if additional_properties is None: @@ -50,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -61,28 +59,58 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else None - member_ids = dictionary.get("member_ids") if dictionary.get("member_ids") else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else None + member_ids =\ + dictionary.get("member_ids")\ + if dictionary.get("member_ids")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_id, member_ids, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_id={self.subscription_id!r}, ' - f'member_ids={(self.member_ids if hasattr(self, "member_ids") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_id=self.subscription_id + _member_ids=( + self.member_ids + if hasattr(self, "member_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_id={_subscription_id!r}, " + f"member_ids={_member_ids!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_id={self.subscription_id!s}, ' - f'member_ids={(self.member_ids if hasattr(self, "member_ids") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_id=self.subscription_id + _member_ids=( + self.member_ids + if hasattr(self, "member_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_id={_subscription_id!s}, " + f"member_ids={_member_ids!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_subscription_group_request.py b/advancedbilling/models/create_subscription_group_request.py index d287e8df..cc8bb0c3 100644 --- a/advancedbilling/models/create_subscription_group_request.py +++ b/advancedbilling/models/create_subscription_group_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_subscription_group import CreateSubscriptionGroup +# ruff: noqa: E501 +from advancedbilling.models.create_subscription_group import ( + CreateSubscriptionGroup, +) -class CreateSubscriptionGroupRequest(object): +class CreateSubscriptionGroupRequest(object): """Implementation of the 'Create Subscription Group Request' model. Attributes: - subscription_group (CreateSubscriptionGroup): The model property of - type CreateSubscriptionGroup. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscription_group (CreateSubscriptionGroup): The model property of type + CreateSubscriptionGroup. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_group": 'subscription_group' + "subscription_group": "subscription_group", } - def __init__(self, - subscription_group=None, - additional_properties=None): - """Constructor for the CreateSubscriptionGroupRequest class""" - + def __init__( + self, + subscription_group=None, + additional_properties=None): + """Initialize a CreateSubscriptionGroupRequest instance.""" # Initialize members of the class - self.subscription_group = subscription_group + self.subscription_group = subscription_group # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_group = CreateSubscriptionGroup.from_dictionary(dictionary.get('subscription_group')) if dictionary.get('subscription_group') else None + subscription_group =\ + CreateSubscriptionGroup.from_dictionary( + dictionary.get("subscription_group"))\ + if dictionary.get("subscription_group") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_group, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_subscription_request.py b/advancedbilling/models/create_subscription_request.py index 8c7a6fc2..5ebc2b4b 100644 --- a/advancedbilling/models/create_subscription_request.py +++ b/advancedbilling/models/create_subscription_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_subscription import CreateSubscription +# ruff: noqa: E501 +from advancedbilling.models.create_subscription import ( + CreateSubscription, +) -class CreateSubscriptionRequest(object): +class CreateSubscriptionRequest(object): """Implementation of the 'Create Subscription Request' model. Attributes: subscription (CreateSubscription): The model property of type CreateSubscription. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription": 'subscription' + "subscription": "subscription", } - def __init__(self, - subscription=None, - additional_properties=None): - """Constructor for the CreateSubscriptionRequest class""" - + def __init__( + self, + subscription=None, + additional_properties=None): + """Initialize a CreateSubscriptionRequest instance.""" # Initialize members of the class - self.subscription = subscription + self.subscription = subscription # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription = CreateSubscription.from_dictionary(dictionary.get('subscription')) if dictionary.get('subscription') else None + subscription =\ + CreateSubscription.from_dictionary( + dictionary.get("subscription"))\ + if dictionary.get("subscription") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_usage.py b/advancedbilling/models/create_usage.py index 255e5968..30e82587 100644 --- a/advancedbilling/models/create_usage.py +++ b/advancedbilling/models/create_usage.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.billing_schedule import BillingSchedule -from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.billing_schedule import ( + BillingSchedule, +) +from advancedbilling.models.component_custom_price import ( + ComponentCustomPrice, +) class CreateUsage(object): - """Implementation of the 'Create Usage' model. Attributes: @@ -20,54 +22,54 @@ class CreateUsage(object): quantities are enabled for the component price_point_id (str): The model property of type str. memo (str): The model property of type str. - billing_schedule (BillingSchedule): This attribute is particularly - useful when you need to align billing events for different - components on distinct schedules within a subscription. This only - works for site with Multifrequency enabled. - custom_price (ComponentCustomPrice): Create or update custom pricing - unique to the subscription. Used in place of `price_point_id`. - additional_properties (Dict[str, object]): The additional properties - for the model. + billing_schedule (BillingSchedule): This attribute is particularly useful + when you need to align billing events for different components on + distinct schedules within a subscription. This only works for site with + Multifrequency enabled. + custom_price (ComponentCustomPrice): Create or update custom pricing unique + to the subscription. Used in place of `price_point_id`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "quantity": 'quantity', - "price_point_id": 'price_point_id', - "memo": 'memo', - "billing_schedule": 'billing_schedule', - "custom_price": 'custom_price' + "quantity": "quantity", + "price_point_id": "price_point_id", + "memo": "memo", + "billing_schedule": "billing_schedule", + "custom_price": "custom_price", } _optionals = [ - 'quantity', - 'price_point_id', - 'memo', - 'billing_schedule', - 'custom_price', + "quantity", + "price_point_id", + "memo", + "billing_schedule", + "custom_price", ] - def __init__(self, - quantity=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - memo=APIHelper.SKIP, - billing_schedule=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreateUsage class""" - + def __init__( + self, + quantity=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + memo=APIHelper.SKIP, + billing_schedule=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreateUsage instance.""" # Initialize members of the class if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if billing_schedule is not APIHelper.SKIP: - self.billing_schedule = billing_schedule + self.billing_schedule = billing_schedule if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price # Add additional model properties to the instance if additional_properties is None: @@ -77,7 +79,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -88,18 +90,37 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - billing_schedule = BillingSchedule.from_dictionary(dictionary.get('billing_schedule')) if 'billing_schedule' in dictionary.keys() else APIHelper.SKIP - custom_price = ComponentCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + billing_schedule =\ + BillingSchedule.from_dictionary( + dictionary.get("billing_schedule"))\ + if "billing_schedule" in dictionary.keys()\ + else APIHelper.SKIP + custom_price =\ + ComponentCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(quantity, price_point_id, @@ -109,19 +130,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'billing_schedule={(self.billing_schedule if hasattr(self, "billing_schedule") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _billing_schedule=( + self.billing_schedule + if hasattr(self, "billing_schedule") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"quantity={_quantity!r}, " + f"price_point_id={_price_point_id!r}, " + f"memo={_memo!r}, " + f"billing_schedule={_billing_schedule!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'billing_schedule={(self.billing_schedule if hasattr(self, "billing_schedule") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _billing_schedule=( + self.billing_schedule + if hasattr(self, "billing_schedule") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"quantity={_quantity!s}, " + f"price_point_id={_price_point_id!s}, " + f"memo={_memo!s}, " + f"billing_schedule={_billing_schedule!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/create_usage_request.py b/advancedbilling/models/create_usage_request.py index d7c45548..3d3afa9f 100644 --- a/advancedbilling/models/create_usage_request.py +++ b/advancedbilling/models/create_usage_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_usage import CreateUsage +# ruff: noqa: E501 +from advancedbilling.models.create_usage import ( + CreateUsage, +) -class CreateUsageRequest(object): +class CreateUsageRequest(object): """Implementation of the 'Create Usage Request' model. Attributes: usage (CreateUsage): The model property of type CreateUsage. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "usage": 'usage' + "usage": "usage", } - def __init__(self, - usage=None, - additional_properties=None): - """Constructor for the CreateUsageRequest class""" - + def __init__( + self, + usage=None, + additional_properties=None): + """Initialize a CreateUsageRequest instance.""" # Initialize members of the class - self.usage = usage + self.usage = usage # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - usage = CreateUsage.from_dictionary(dictionary.get('usage')) if dictionary.get('usage') else None + usage =\ + CreateUsage.from_dictionary( + dictionary.get("usage"))\ + if dictionary.get("usage") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(usage, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'usage={self.usage!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _usage=self.usage + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"usage={_usage!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'usage={self.usage!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _usage=self.usage + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"usage={_usage!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/created_prepayment.py b/advancedbilling/models/created_prepayment.py index 68d80b9a..dca5106e 100644 --- a/advancedbilling/models/created_prepayment.py +++ b/advancedbilling/models/created_prepayment.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreatedPrepayment(object): - """Implementation of the 'Created Prepayment' model. Attributes: @@ -21,58 +19,61 @@ class CreatedPrepayment(object): created_at (datetime): The model property of type datetime. starting_balance_in_cents (int): The model property of type int. ending_balance_in_cents (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "subscription_id": 'subscription_id', - "amount_in_cents": 'amount_in_cents', - "memo": 'memo', - "created_at": 'created_at', - "starting_balance_in_cents": 'starting_balance_in_cents', - "ending_balance_in_cents": 'ending_balance_in_cents' + "id": "id", + "subscription_id": "subscription_id", + "amount_in_cents": "amount_in_cents", + "memo": "memo", + "created_at": "created_at", + "starting_balance_in_cents": "starting_balance_in_cents", + "ending_balance_in_cents": "ending_balance_in_cents", } _optionals = [ - 'id', - 'subscription_id', - 'amount_in_cents', - 'memo', - 'created_at', - 'starting_balance_in_cents', - 'ending_balance_in_cents', + "id", + "subscription_id", + "amount_in_cents", + "memo", + "created_at", + "starting_balance_in_cents", + "ending_balance_in_cents", ] - def __init__(self, - id=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - memo=APIHelper.SKIP, - created_at=APIHelper.SKIP, - starting_balance_in_cents=APIHelper.SKIP, - ending_balance_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreatedPrepayment class""" - + def __init__( + self, + id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + memo=APIHelper.SKIP, + created_at=APIHelper.SKIP, + starting_balance_in_cents=APIHelper.SKIP, + ending_balance_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreatedPrepayment instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if starting_balance_in_cents is not APIHelper.SKIP: - self.starting_balance_in_cents = starting_balance_in_cents + self.starting_balance_in_cents = starting_balance_in_cents if ending_balance_in_cents is not APIHelper.SKIP: - self.ending_balance_in_cents = ending_balance_in_cents + self.ending_balance_in_cents = ending_balance_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -82,7 +83,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -93,20 +94,42 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - starting_balance_in_cents = dictionary.get("starting_balance_in_cents") if dictionary.get("starting_balance_in_cents") else APIHelper.SKIP - ending_balance_in_cents = dictionary.get("ending_balance_in_cents") if dictionary.get("ending_balance_in_cents") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + starting_balance_in_cents =\ + dictionary.get("starting_balance_in_cents")\ + if dictionary.get("starting_balance_in_cents")\ + else APIHelper.SKIP + ending_balance_in_cents =\ + dictionary.get("ending_balance_in_cents")\ + if dictionary.get("ending_balance_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, subscription_id, @@ -118,23 +141,103 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'starting_balance_in_cents={(self.starting_balance_in_cents if hasattr(self, "starting_balance_in_cents") else None)!r}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _starting_balance_in_cents=( + self.starting_balance_in_cents + if hasattr(self, "starting_balance_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"memo={_memo!r}, " + f"created_at={_created_at!r}, " + f"starting_balance_in_cents={_starting_balance_in_cents!r}, " + f"ending_balance_in_cents={_ending_balance_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'starting_balance_in_cents={(self.starting_balance_in_cents if hasattr(self, "starting_balance_in_cents") else None)!s}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _starting_balance_in_cents=( + self.starting_balance_in_cents + if hasattr(self, "starting_balance_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"memo={_memo!s}, " + f"created_at={_created_at!s}, " + f"starting_balance_in_cents={_starting_balance_in_cents!s}, " + f"ending_balance_in_cents={_ending_balance_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_account_balance_changed.py b/advancedbilling/models/credit_account_balance_changed.py index aa3aad40..119718ae 100644 --- a/advancedbilling/models/credit_account_balance_changed.py +++ b/advancedbilling/models/credit_account_balance_changed.py @@ -1,55 +1,58 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreditAccountBalanceChanged(object): - """Implementation of the 'Credit Account Balance Changed' model. Attributes: reason (str): The model property of type str. - service_credit_account_balance_in_cents (int): The model property of - type int. - service_credit_balance_change_in_cents (int): The model property of - type int. + service_credit_account_balance_in_cents (int): The model property of type int. + service_credit_balance_change_in_cents (int): The model property of type int. currency_code (str): The model property of type str. at_time (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reason": 'reason', - "service_credit_account_balance_in_cents": 'service_credit_account_balance_in_cents', - "service_credit_balance_change_in_cents": 'service_credit_balance_change_in_cents', - "currency_code": 'currency_code', - "at_time": 'at_time' + "reason": "reason", + "service_credit_account_balance_in_cents": + "service_credit_account_balance_in_cents", + "service_credit_balance_change_in_cents": + "service_credit_balance_change_in_cents", + "currency_code": "currency_code", + "at_time": "at_time", } - def __init__(self, - reason=None, - service_credit_account_balance_in_cents=None, - service_credit_balance_change_in_cents=None, - currency_code=None, - at_time=None, - additional_properties=None): - """Constructor for the CreditAccountBalanceChanged class""" - + def __init__( + self, + reason=None, + service_credit_account_balance_in_cents=None, + service_credit_balance_change_in_cents=None, + currency_code=None, + at_time=None, + additional_properties=None): + """Initialize a CreditAccountBalanceChanged instance.""" # Initialize members of the class - self.reason = reason - self.service_credit_account_balance_in_cents = service_credit_account_balance_in_cents - self.service_credit_balance_change_in_cents = service_credit_balance_change_in_cents - self.currency_code = currency_code - self.at_time = APIHelper.apply_datetime_converter(at_time, APIHelper.RFC3339DateTime) if at_time else None + self.reason = reason + self.service_credit_account_balance_in_cents =\ + service_credit_account_balance_in_cents + self.service_credit_balance_change_in_cents =\ + service_credit_balance_change_in_cents + self.currency_code = currency_code + self.at_time =\ + APIHelper.apply_datetime_converter( + at_time, APIHelper.RFC3339DateTime)\ + if at_time else None # Add additional model properties to the instance if additional_properties is None: @@ -59,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -70,18 +73,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reason = dictionary.get("reason") if dictionary.get("reason") else None - service_credit_account_balance_in_cents = dictionary.get("service_credit_account_balance_in_cents") if dictionary.get("service_credit_account_balance_in_cents") else None - service_credit_balance_change_in_cents = dictionary.get("service_credit_balance_change_in_cents") if dictionary.get("service_credit_balance_change_in_cents") else None - currency_code = dictionary.get("currency_code") if dictionary.get("currency_code") else None - at_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("at_time")).datetime if dictionary.get("at_time") else None + reason =\ + dictionary.get("reason")\ + if dictionary.get("reason")\ + else None + service_credit_account_balance_in_cents =\ + dictionary.get("service_credit_account_balance_in_cents")\ + if dictionary.get("service_credit_account_balance_in_cents")\ + else None + service_credit_balance_change_in_cents =\ + dictionary.get("service_credit_balance_change_in_cents")\ + if dictionary.get("service_credit_balance_change_in_cents")\ + else None + currency_code =\ + dictionary.get("currency_code")\ + if dictionary.get("currency_code")\ + else None + at_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("at_time")).datetime\ + if dictionary.get("at_time") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reason, service_credit_account_balance_in_cents, @@ -92,7 +111,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -103,47 +122,116 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.reason, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.service_credit_account_balance_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.service_credit_balance_change_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.currency_code, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.at_time, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) + return APIHelper.is_valid_type( + value=dictionary.reason, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.service_credit_account_balance_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.service_credit_balance_change_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.currency_code, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.at_time, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('reason'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('service_credit_account_balance_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('service_credit_balance_change_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('currency_code'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('at_time'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("reason"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("service_credit_account_balance_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("service_credit_balance_change_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("currency_code"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("at_time"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!r}, ' - f'service_credit_account_balance_in_cents={self.service_credit_account_balance_in_cents!r}, ' - f'service_credit_balance_change_in_cents={self.service_credit_balance_change_in_cents!r}, ' - f'currency_code={self.currency_code!r}, ' - f'at_time={self.at_time!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reason=self.reason + _service_credit_account_balance_in_cents=self.service_credit_account_balance_in_cents + _service_credit_balance_change_in_cents=self.service_credit_balance_change_in_cents + _currency_code=self.currency_code + _at_time=self.at_time + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!r}, " + f"service_credit_account_balance_in_cents={_service_credit_account_balance_in_cents!r}, " + f"service_credit_balance_change_in_cents={_service_credit_balance_change_in_cents!r}, " + f"currency_code={_currency_code!r}, " + f"at_time={_at_time!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!s}, ' - f'service_credit_account_balance_in_cents={self.service_credit_account_balance_in_cents!s}, ' - f'service_credit_balance_change_in_cents={self.service_credit_balance_change_in_cents!s}, ' - f'currency_code={self.currency_code!s}, ' - f'at_time={self.at_time!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reason=self.reason + _service_credit_account_balance_in_cents=self.service_credit_account_balance_in_cents + _service_credit_balance_change_in_cents=self.service_credit_balance_change_in_cents + _currency_code=self.currency_code + _at_time=self.at_time + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!s}, " + f"service_credit_account_balance_in_cents={_service_credit_account_balance_in_cents!s}, " + f"service_credit_balance_change_in_cents={_service_credit_balance_change_in_cents!s}, " + f"currency_code={_currency_code!s}, " + f"at_time={_at_time!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_card_attributes.py b/advancedbilling/models/credit_card_attributes.py index abc517bb..63440d04 100644 --- a/advancedbilling/models/credit_card_attributes.py +++ b/advancedbilling/models/credit_card_attributes.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreditCardAttributes(object): - """Implementation of the 'Credit Card Attributes' model. Attributes: full_number (str): The model property of type str. expiration_month (str): The model property of type str. expiration_year (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "full_number": 'full_number', - "expiration_month": 'expiration_month', - "expiration_year": 'expiration_year' + "full_number": "full_number", + "expiration_month": "expiration_month", + "expiration_year": "expiration_year", } _optionals = [ - 'full_number', - 'expiration_month', - 'expiration_year', + "full_number", + "expiration_month", + "expiration_year", ] - def __init__(self, - full_number=APIHelper.SKIP, - expiration_month=APIHelper.SKIP, - expiration_year=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreditCardAttributes class""" - + def __init__( + self, + full_number=APIHelper.SKIP, + expiration_month=APIHelper.SKIP, + expiration_year=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreditCardAttributes instance.""" # Initialize members of the class if full_number is not APIHelper.SKIP: - self.full_number = full_number + self.full_number = full_number if expiration_month is not APIHelper.SKIP: - self.expiration_month = expiration_month + self.expiration_month = expiration_month if expiration_year is not APIHelper.SKIP: - self.expiration_year = expiration_year + self.expiration_year = expiration_year # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - full_number = dictionary.get("full_number") if dictionary.get("full_number") else APIHelper.SKIP - expiration_month = dictionary.get("expiration_month") if dictionary.get("expiration_month") else APIHelper.SKIP - expiration_year = dictionary.get("expiration_year") if dictionary.get("expiration_year") else APIHelper.SKIP + full_number =\ + dictionary.get("full_number")\ + if dictionary.get("full_number")\ + else APIHelper.SKIP + expiration_month =\ + dictionary.get("expiration_month")\ + if dictionary.get("expiration_month")\ + else APIHelper.SKIP + expiration_year =\ + dictionary.get("expiration_year")\ + if dictionary.get("expiration_year")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(full_number, expiration_month, @@ -87,7 +96,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -98,7 +107,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -108,15 +116,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!r}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!r}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"full_number={_full_number!r}, " + f"expiration_month={_expiration_month!r}, " + f"expiration_year={_expiration_year!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!s}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!s}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"full_number={_full_number!s}, " + f"expiration_month={_expiration_month!s}, " + f"expiration_year={_expiration_year!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_card_payment_profile.py b/advancedbilling/models/credit_card_payment_profile.py index 9879484b..aeaa0717 100644 --- a/advancedbilling/models/credit_card_payment_profile.py +++ b/advancedbilling/models/credit_card_payment_profile.py @@ -1,211 +1,214 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payment_type import PaymentType +from advancedbilling.models.payment_type import ( + PaymentType, +) class CreditCardPaymentProfile(object): - """Implementation of the 'Credit Card Payment Profile' model. Attributes: - id (int): The Chargify-assigned ID of the stored card. This value can - be used as an input to payment_profile_id when creating a - subscription, in order to re-use a stored payment profile for the - same customer. + id (int): The Chargify-assigned ID of the stored card. This value can be used + as an input to payment_profile_id when creating a subscription, in order + to re-use a stored payment profile for the same customer. first_name (str): The first name of the card holder. last_name (str): The last name of the card holder. - masked_card_number (str): A string representation of the credit card - number with all but the last 4 digits masked with X’s (i.e. + masked_card_number (str): A string representation of the credit card number + with all but the last 4 digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). card_type (CardType): The type of card used. - expiration_month (int): An integer representing the expiration month - of the card(1 – 12). - expiration_year (int): An integer representing the 4-digit expiration - year of the card(i.e. ‘2012’). - customer_id (int): The Chargify-assigned id for the customer record to - which the card belongs. - current_vault (CreditCardVault): The vault that stores the payment - profile with the provided `vault_token`. Use `bogus` for testing. - vault_token (str): The “token” provided by your vault storage for an - already stored payment profile. + expiration_month (int): An integer representing the expiration month of the + card(1 – 12). + expiration_year (int): An integer representing the 4-digit expiration year of + the card(i.e. ‘2012’). + customer_id (int): The Chargify-assigned id for the customer record to which + the card belongs. + current_vault (CreditCardVault): The vault that stores the payment profile + with the provided `vault_token`. Use `bogus` for testing. + vault_token (str): The “token” provided by your vault storage for an already + stored payment profile. billing_address (str): The current billing street address for the card. billing_city (str): The current billing address city for the card. billing_state (str): The current billing address state for the card. billing_zip (str): The current billing address zip code for the card. - billing_country (str): The current billing address country for the - card. + billing_country (str): The current billing address country for the card. customer_vault_token (str): (only for Authorize.Net CIM storage): the - customerProfileId for the owner of the customerPaymentProfileId - provided as the vault_token. - billing_address_2 (str): The current billing street address, second - line, for the card. + customerProfileId for the owner of the customerPaymentProfileId provided + as the vault_token. + billing_address_2 (str): The current billing street address, second line, for + the card. payment_type (PaymentType): The model property of type PaymentType. disabled (bool): The model property of type bool. - chargify_token (str): Token received after sending billing information - using chargify.js. This token will only be received if passed as a - sole attribute of credit_card_attributes (i.e. - tok_9g6hw85pnpt6knmskpwp4ttt) + chargify_token (str): Token received after sending billing information using + chargify.js. This token will only be received if passed as a sole + attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) site_gateway_setting_id (int): The model property of type int. gateway_handle (str): An identifier of connected gateway. - created_at (datetime): A timestamp indicating when this payment - profile was created - updated_at (datetime): A timestamp indicating when this payment - profile was last updated - additional_properties (Dict[str, object]): The additional properties - for the model. + created_at (datetime): A timestamp indicating when this payment profile was + created + updated_at (datetime): A timestamp indicating when this payment profile was + last updated + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_type": 'payment_type', - "id": 'id', - "first_name": 'first_name', - "last_name": 'last_name', - "masked_card_number": 'masked_card_number', - "card_type": 'card_type', - "expiration_month": 'expiration_month', - "expiration_year": 'expiration_year', - "customer_id": 'customer_id', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "billing_address": 'billing_address', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "billing_country": 'billing_country', - "customer_vault_token": 'customer_vault_token', - "billing_address_2": 'billing_address_2', - "disabled": 'disabled', - "chargify_token": 'chargify_token', - "site_gateway_setting_id": 'site_gateway_setting_id', - "gateway_handle": 'gateway_handle', - "created_at": 'created_at', - "updated_at": 'updated_at' + "payment_type": "payment_type", + "id": "id", + "first_name": "first_name", + "last_name": "last_name", + "masked_card_number": "masked_card_number", + "card_type": "card_type", + "expiration_month": "expiration_month", + "expiration_year": "expiration_year", + "customer_id": "customer_id", + "current_vault": "current_vault", + "vault_token": "vault_token", + "billing_address": "billing_address", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "billing_country": "billing_country", + "customer_vault_token": "customer_vault_token", + "billing_address_2": "billing_address_2", + "disabled": "disabled", + "chargify_token": "chargify_token", + "site_gateway_setting_id": "site_gateway_setting_id", + "gateway_handle": "gateway_handle", + "created_at": "created_at", + "updated_at": "updated_at", } _optionals = [ - 'id', - 'first_name', - 'last_name', - 'masked_card_number', - 'card_type', - 'expiration_month', - 'expiration_year', - 'customer_id', - 'current_vault', - 'vault_token', - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'disabled', - 'chargify_token', - 'site_gateway_setting_id', - 'gateway_handle', - 'created_at', - 'updated_at', + "id", + "first_name", + "last_name", + "masked_card_number", + "card_type", + "expiration_month", + "expiration_year", + "customer_id", + "current_vault", + "vault_token", + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "disabled", + "chargify_token", + "site_gateway_setting_id", + "gateway_handle", + "created_at", + "updated_at", ] _nullables = [ - 'vault_token', - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'site_gateway_setting_id', - 'gateway_handle', + "vault_token", + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "site_gateway_setting_id", + "gateway_handle", ] - def __init__(self, - payment_type='credit_card', - id=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - masked_card_number=APIHelper.SKIP, - card_type=APIHelper.SKIP, - expiration_month=APIHelper.SKIP, - expiration_year=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - disabled=APIHelper.SKIP, - chargify_token=APIHelper.SKIP, - site_gateway_setting_id=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreditCardPaymentProfile class""" - + def __init__( + self, + payment_type="credit_card", + id=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + masked_card_number=APIHelper.SKIP, + card_type=APIHelper.SKIP, + expiration_month=APIHelper.SKIP, + expiration_year=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + disabled=APIHelper.SKIP, + chargify_token=APIHelper.SKIP, + site_gateway_setting_id=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreditCardPaymentProfile instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if masked_card_number is not APIHelper.SKIP: - self.masked_card_number = masked_card_number + self.masked_card_number = masked_card_number if card_type is not APIHelper.SKIP: - self.card_type = card_type + self.card_type = card_type if expiration_month is not APIHelper.SKIP: - self.expiration_month = expiration_month + self.expiration_month = expiration_month if expiration_year is not APIHelper.SKIP: - self.expiration_year = expiration_year + self.expiration_year = expiration_year if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 - self.payment_type = payment_type + self.billing_address_2 = billing_address_2 + self.payment_type = payment_type if disabled is not APIHelper.SKIP: - self.disabled = disabled + self.disabled = disabled if chargify_token is not APIHelper.SKIP: - self.chargify_token = chargify_token + self.chargify_token = chargify_token if site_gateway_setting_id is not APIHelper.SKIP: - self.site_gateway_setting_id = site_gateway_setting_id + self.site_gateway_setting_id = site_gateway_setting_id if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None # Add additional model properties to the instance if additional_properties is None: @@ -215,7 +218,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -226,37 +229,109 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else 'credit_card' - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - masked_card_number = dictionary.get("masked_card_number") if dictionary.get("masked_card_number") else APIHelper.SKIP - card_type = dictionary.get("card_type") if dictionary.get("card_type") else APIHelper.SKIP - expiration_month = dictionary.get("expiration_month") if dictionary.get("expiration_month") else APIHelper.SKIP - expiration_year = dictionary.get("expiration_year") if dictionary.get("expiration_year") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if "vault_token" in dictionary.keys() else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if "billing_address" in dictionary.keys() else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if "billing_city" in dictionary.keys() else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if "billing_state" in dictionary.keys() else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if "billing_zip" in dictionary.keys() else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if "billing_country" in dictionary.keys() else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if "customer_vault_token" in dictionary.keys() else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if "billing_address_2" in dictionary.keys() else APIHelper.SKIP - disabled = dictionary.get("disabled") if "disabled" in dictionary.keys() else APIHelper.SKIP - chargify_token = dictionary.get("chargify_token") if dictionary.get("chargify_token") else APIHelper.SKIP - site_gateway_setting_id = dictionary.get("site_gateway_setting_id") if "site_gateway_setting_id" in dictionary.keys() else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if "gateway_handle" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else "credit_card" + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + masked_card_number =\ + dictionary.get("masked_card_number")\ + if dictionary.get("masked_card_number")\ + else APIHelper.SKIP + card_type =\ + dictionary.get("card_type")\ + if dictionary.get("card_type")\ + else APIHelper.SKIP + expiration_month =\ + dictionary.get("expiration_month")\ + if dictionary.get("expiration_month")\ + else APIHelper.SKIP + expiration_year =\ + dictionary.get("expiration_year")\ + if dictionary.get("expiration_year")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if "vault_token" in dictionary.keys()\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if "billing_city" in dictionary.keys()\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if "billing_state" in dictionary.keys()\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if "billing_zip" in dictionary.keys()\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if "billing_country" in dictionary.keys()\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if "customer_vault_token" in dictionary.keys()\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if "billing_address_2" in dictionary.keys()\ + else APIHelper.SKIP + disabled =\ + dictionary.get("disabled")\ + if "disabled" in dictionary.keys()\ + else APIHelper.SKIP + chargify_token =\ + dictionary.get("chargify_token")\ + if dictionary.get("chargify_token")\ + else APIHelper.SKIP + site_gateway_setting_id =\ + dictionary.get("site_gateway_setting_id")\ + if "site_gateway_setting_id" in dictionary.keys()\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_type, id, @@ -286,7 +361,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -297,69 +372,314 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.payment_type, - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.payment_type, + type_callable=lambda value: + PaymentType.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('payment_type'), - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("payment_type"), + type_callable=lambda value: + PaymentType.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!r}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!r}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!r}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'payment_type={self.payment_type!r}, ' - f'disabled={(self.disabled if hasattr(self, "disabled") else None)!r}, ' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!r}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _payment_type=self.payment_type + _disabled=( + self.disabled + if hasattr(self, "disabled") + else None + ) + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"masked_card_number={_masked_card_number!r}, " + f"card_type={_card_type!r}, " + f"expiration_month={_expiration_month!r}, " + f"expiration_year={_expiration_year!r}, " + f"customer_id={_customer_id!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"billing_address={_billing_address!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"billing_country={_billing_country!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"payment_type={_payment_type!r}, " + f"disabled={_disabled!r}, " + f"chargify_token={_chargify_token!r}, " + f"site_gateway_setting_id={_site_gateway_setting_id!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!s}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!s}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!s}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'payment_type={self.payment_type!s}, ' - f'disabled={(self.disabled if hasattr(self, "disabled") else None)!s}, ' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!s}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _payment_type=self.payment_type + _disabled=( + self.disabled + if hasattr(self, "disabled") + else None + ) + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"masked_card_number={_masked_card_number!s}, " + f"card_type={_card_type!s}, " + f"expiration_month={_expiration_month!s}, " + f"expiration_year={_expiration_year!s}, " + f"customer_id={_customer_id!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"billing_address={_billing_address!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"billing_country={_billing_country!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"payment_type={_payment_type!s}, " + f"disabled={_disabled!s}, " + f"chargify_token={_chargify_token!s}, " + f"site_gateway_setting_id={_site_gateway_setting_id!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_card_vault.py b/advancedbilling/models/credit_card_vault.py index 613b5646..b9a01099 100644 --- a/advancedbilling/models/credit_card_vault.py +++ b/advancedbilling/models/credit_card_vault.py @@ -1,19 +1,16 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CreditCardVault(object): - """Implementation of the 'Credit Card Vault' enum. - The vault that stores the payment profile with the provided `vault_token`. - Use `bogus` for testing. + The vault that stores the payment profile with the provided `vault_token`. Use + `bogus` for testing. Attributes: ADYEN: The enum member of type str. @@ -49,80 +46,86 @@ class CreditCardVault(object): TRUST_COMMERCE: The enum member of type str. UNIPAAS: The enum member of type str. WIRECARD: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['adyen', 'authorizenet', 'beanstream', 'blue_snap', 'bogus', 'braintree1', 'braintree_blue', 'checkout', 'cybersource', 'elavon', 'eway', 'eway_rapid', 'eway_rapid_std', 'firstdata', 'forte', 'litle', 'maxio_payments', 'maxp', 'moduslink', 'moneris', 'nmi', 'orbital', 'payment_express', 'paymill', 'paypal', 'paypal_complete', 'pin', 'square', 'stripe', 'stripe_connect', 'trust_commerce', 'unipaas', 'wirecard'] - ADYEN = 'adyen' - AUTHORIZENET = 'authorizenet' + _all_values = ["adyen", "authorizenet", "beanstream", "blue_snap", + "bogus", "braintree1", "braintree_blue", "checkout", "cybersource", "elavon", + "eway", "eway_rapid", "eway_rapid_std", "firstdata", "forte", "litle", + "maxio_payments", "maxp", "moduslink", "moneris", "nmi", "orbital", + "payment_express", "paymill", "paypal", "paypal_complete", "pin", "square", + "stripe", "stripe_connect", "trust_commerce", "unipaas", "wirecard"] + ADYEN = "adyen" - BEANSTREAM = 'beanstream' + AUTHORIZENET = "authorizenet" - BLUE_SNAP = 'blue_snap' + BEANSTREAM = "beanstream" - BOGUS = 'bogus' + BLUE_SNAP = "blue_snap" - BRAINTREE1 = 'braintree1' + BOGUS = "bogus" - BRAINTREE_BLUE = 'braintree_blue' + BRAINTREE1 = "braintree1" - CHECKOUT = 'checkout' + BRAINTREE_BLUE = "braintree_blue" - CYBERSOURCE = 'cybersource' + CHECKOUT = "checkout" - ELAVON = 'elavon' + CYBERSOURCE = "cybersource" - EWAY = 'eway' + ELAVON = "elavon" - EWAY_RAPID = 'eway_rapid' + EWAY = "eway" - EWAY_RAPID_STD = 'eway_rapid_std' + EWAY_RAPID = "eway_rapid" - FIRSTDATA = 'firstdata' + EWAY_RAPID_STD = "eway_rapid_std" - FORTE = 'forte' + FIRSTDATA = "firstdata" - LITLE = 'litle' + FORTE = "forte" - MAXIO_PAYMENTS = 'maxio_payments' + LITLE = "litle" - MAXP = 'maxp' + MAXIO_PAYMENTS = "maxio_payments" - MODUSLINK = 'moduslink' + MAXP = "maxp" - MONERIS = 'moneris' + MODUSLINK = "moduslink" - NMI = 'nmi' + MONERIS = "moneris" - ORBITAL = 'orbital' + NMI = "nmi" - PAYMENT_EXPRESS = 'payment_express' + ORBITAL = "orbital" - PAYMILL = 'paymill' + PAYMENT_EXPRESS = "payment_express" - PAYPAL = 'paypal' + PAYMILL = "paymill" - PAYPAL_COMPLETE = 'paypal_complete' + PAYPAL = "paypal" - PIN = 'pin' + PAYPAL_COMPLETE = "paypal_complete" - SQUARE = 'square' + PIN = "pin" - STRIPE = 'stripe' + SQUARE = "square" - STRIPE_CONNECT = 'stripe_connect' + STRIPE = "stripe" - TRUST_COMMERCE = 'trust_commerce' + STRIPE_CONNECT = "stripe_connect" - UNIPAAS = 'unipaas' + TRUST_COMMERCE = "trust_commerce" - WIRECARD = 'wirecard' + UNIPAAS = "unipaas" + + WIRECARD = "wirecard" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -132,9 +135,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/credit_note.py b/advancedbilling/models/credit_note.py index 921f22b7..7d5aed05 100644 --- a/advancedbilling/models/credit_note.py +++ b/advancedbilling/models/credit_note.py @@ -1,27 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.credit_note_application import CreditNoteApplication -from advancedbilling.models.credit_note_line_item import CreditNoteLineItem -from advancedbilling.models.invoice_address import InvoiceAddress -from advancedbilling.models.invoice_customer import InvoiceCustomer -from advancedbilling.models.invoice_discount import InvoiceDiscount -from advancedbilling.models.invoice_refund import InvoiceRefund -from advancedbilling.models.invoice_seller import InvoiceSeller -from advancedbilling.models.invoice_tax import InvoiceTax -from advancedbilling.models.origin_invoice import OriginInvoice +from advancedbilling.models.credit_note_application import ( + CreditNoteApplication, +) +from advancedbilling.models.credit_note_line_item import ( + CreditNoteLineItem, +) +from advancedbilling.models.invoice_address import ( + InvoiceAddress, +) +from advancedbilling.models.invoice_customer import ( + InvoiceCustomer, +) +from advancedbilling.models.invoice_discount import ( + InvoiceDiscount, +) +from advancedbilling.models.invoice_refund import ( + InvoiceRefund, +) +from advancedbilling.models.invoice_seller import ( + InvoiceSeller, +) +from advancedbilling.models.invoice_tax import ( + InvoiceTax, +) +from advancedbilling.models.origin_invoice import ( + OriginInvoice, +) class CreditNote(object): - """Implementation of the 'Credit Note' model. Attributes: @@ -30,223 +46,219 @@ class CreditNote(object): alphanumeric characters. site_id (int): ID of the site to which the credit note belongs. customer_id (int): ID of the customer to which the credit note belongs. - subscription_id (int): ID of the subscription that generated the - credit note. - number (str): A unique, identifying string that appears on the credit - note and in places it is referenced. While the UID is long and - not appropriate to show to customers, the number is usually - shorter and consumable by the customer and the merchant alike. - sequence_number (int): A monotonically increasing number assigned to - credit notes as they are created. This number is unique within a - site and can be used to sort and order credit notes. - issue_date (date): Date the credit note was issued to the customer. - This is the date that the credit was made available for - application, and may come before it is fully applied. The format - is `"YYYY-MM-DD"`. - applied_date (date): Credit notes are applied to invoices to offset - invoiced amounts - they reduce the amount due. This field is the - date the credit note became fully applied to invoices. If the - credit note has been partially applied, this field will not have a - value until it has been fully applied. The format is - `"YYYY-MM-DD"`. + subscription_id (int): ID of the subscription that generated the credit note. + number (str): A unique, identifying string that appears on the credit note + and in places it is referenced. While the UID is long and not + appropriate to show to customers, the number is usually shorter and + consumable by the customer and the merchant alike. + sequence_number (int): A monotonically increasing number assigned to credit + notes as they are created. This number is unique within a site and can + be used to sort and order credit notes. + issue_date (date): Date the credit note was issued to the customer. This is + the date that the credit was made available for application, and may come + before it is fully applied. The format is `"YYYY-MM-DD"`. + applied_date (date): Credit notes are applied to invoices to offset invoiced + amounts - they reduce the amount due. This field is the date the credit + note became fully applied to invoices. If the credit note has been + partially applied, this field will not have a value until it has been + fully applied. The format is `"YYYY-MM-DD"`. status (CreditNoteStatus): Current status of the credit note. - currency (str): The ISO 4217 currency code (3 character string) - representing the currency of the credit note amount fields. - memo (str): The memo printed on credit note, which is a description of - the reason for the credit. - seller (InvoiceSeller): Information about the seller (merchant) listed - on the masthead of the credit note. - customer (InvoiceCustomer): Information about the customer who is - owner or recipient the credited subscription. + currency (str): The ISO 4217 currency code (3 character string) representing + the currency of the credit note amount fields. + memo (str): The memo printed on credit note, which is a description of the + reason for the credit. + seller (InvoiceSeller): Information about the seller (merchant) listed on the + masthead of the credit note. + customer (InvoiceCustomer): Information about the customer who is owner or + recipient the credited subscription. billing_address (InvoiceAddress): The billing address of the credit subscription. - shipping_address (InvoiceAddress): The shipping address of the - credited subscription. - subtotal_amount (str): Subtotal of the credit note, which is the sum - of all line items before discounts or taxes. Note that this is a - positive amount representing the credit back to the customer. - discount_amount (str): Total discount applied to the credit note. Note - that this is a positive amount representing the discount amount - being credited back to the customer (i.e. a credit on an earlier - discount). For example, if the original purchase was $1.00 and the - original discount was $0.10, a credit of $0.50 of the original - purchase (half) would have a discount credit of $0.05 (also half). - tax_amount (str): Total tax of the credit note. Note that this is a - positive amount representing a previously taxex amount being - credited back to the customer (i.e. a credit of an earlier tax). - For example, if the original purchase was $1.00 and the original - tax was $0.10, a credit of $0.50 of the original purchase (half) - would also have a tax credit of $0.05 (also half). + shipping_address (InvoiceAddress): The shipping address of the credited + subscription. + subtotal_amount (str): Subtotal of the credit note, which is the sum of all + line items before discounts or taxes. Note that this is a positive amount + representing the credit back to the customer. + discount_amount (str): Total discount applied to the credit note. Note that + this is a positive amount representing the discount amount being credited + back to the customer (i.e. a credit on an earlier discount). For example, + if the original purchase was $1.00 and the original discount was $0.10, a + credit of $0.50 of the original purchase (half) would have a discount + credit of $0.05 (also half). + tax_amount (str): Total tax of the credit note. Note that this is a positive + amount representing a previously taxex amount being credited back to the + customer (i.e. a credit of an earlier tax). For example, if the original + purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of + the original purchase (half) would also have a tax credit of $0.05 (also + half). total_amount (str): The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' - applied_amount (str): The amount of the credit note that has already - been applied to invoices. - remaining_amount (str): The amount of the credit note remaining to be - applied to invoices, which is `total_amount - applied_amount`. + applied_amount (str): The amount of the credit note that has already been + applied to invoices. + remaining_amount (str): The amount of the credit note remaining to be applied + to invoices, which is `total_amount - applied_amount`. line_items (List[CreditNoteLineItem]): Line items on the credit note. discounts (List[InvoiceDiscount]): The model property of type List[InvoiceDiscount]. taxes (List[InvoiceTax]): The model property of type List[InvoiceTax]. applications (List[CreditNoteApplication]): The model property of type List[CreditNoteApplication]. - refunds (List[InvoiceRefund]): The model property of type - List[InvoiceRefund]. - origin_invoices (List[OriginInvoice]): An array of origin invoices for - the credit note. Learn more about [Origin Invoice from our - docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Cr - edit-Notes-Proration#origin-invoices) - additional_properties (Dict[str, object]): The additional properties - for the model. + refunds (List[InvoiceRefund]): The model property of type List[InvoiceRefund]. + origin_invoices (List[OriginInvoice]): An array of origin invoices for the + credit note. Learn more about [Origin Invoice from our + docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-No + tes-Proration#origin-invoices) + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "site_id": 'site_id', - "customer_id": 'customer_id', - "subscription_id": 'subscription_id', - "number": 'number', - "sequence_number": 'sequence_number', - "issue_date": 'issue_date', - "applied_date": 'applied_date', - "status": 'status', - "currency": 'currency', - "memo": 'memo', - "seller": 'seller', - "customer": 'customer', - "billing_address": 'billing_address', - "shipping_address": 'shipping_address', - "subtotal_amount": 'subtotal_amount', - "discount_amount": 'discount_amount', - "tax_amount": 'tax_amount', - "total_amount": 'total_amount', - "applied_amount": 'applied_amount', - "remaining_amount": 'remaining_amount', - "line_items": 'line_items', - "discounts": 'discounts', - "taxes": 'taxes', - "applications": 'applications', - "refunds": 'refunds', - "origin_invoices": 'origin_invoices' + "uid": "uid", + "site_id": "site_id", + "customer_id": "customer_id", + "subscription_id": "subscription_id", + "number": "number", + "sequence_number": "sequence_number", + "issue_date": "issue_date", + "applied_date": "applied_date", + "status": "status", + "currency": "currency", + "memo": "memo", + "seller": "seller", + "customer": "customer", + "billing_address": "billing_address", + "shipping_address": "shipping_address", + "subtotal_amount": "subtotal_amount", + "discount_amount": "discount_amount", + "tax_amount": "tax_amount", + "total_amount": "total_amount", + "applied_amount": "applied_amount", + "remaining_amount": "remaining_amount", + "line_items": "line_items", + "discounts": "discounts", + "taxes": "taxes", + "applications": "applications", + "refunds": "refunds", + "origin_invoices": "origin_invoices", } _optionals = [ - 'uid', - 'site_id', - 'customer_id', - 'subscription_id', - 'number', - 'sequence_number', - 'issue_date', - 'applied_date', - 'status', - 'currency', - 'memo', - 'seller', - 'customer', - 'billing_address', - 'shipping_address', - 'subtotal_amount', - 'discount_amount', - 'tax_amount', - 'total_amount', - 'applied_amount', - 'remaining_amount', - 'line_items', - 'discounts', - 'taxes', - 'applications', - 'refunds', - 'origin_invoices', + "uid", + "site_id", + "customer_id", + "subscription_id", + "number", + "sequence_number", + "issue_date", + "applied_date", + "status", + "currency", + "memo", + "seller", + "customer", + "billing_address", + "shipping_address", + "subtotal_amount", + "discount_amount", + "tax_amount", + "total_amount", + "applied_amount", + "remaining_amount", + "line_items", + "discounts", + "taxes", + "applications", + "refunds", + "origin_invoices", ] - def __init__(self, - uid=APIHelper.SKIP, - site_id=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - number=APIHelper.SKIP, - sequence_number=APIHelper.SKIP, - issue_date=APIHelper.SKIP, - applied_date=APIHelper.SKIP, - status=APIHelper.SKIP, - currency=APIHelper.SKIP, - memo=APIHelper.SKIP, - seller=APIHelper.SKIP, - customer=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - shipping_address=APIHelper.SKIP, - subtotal_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - total_amount=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - remaining_amount=APIHelper.SKIP, - line_items=APIHelper.SKIP, - discounts=APIHelper.SKIP, - taxes=APIHelper.SKIP, - applications=APIHelper.SKIP, - refunds=APIHelper.SKIP, - origin_invoices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreditNote class""" - + def __init__( + self, + uid=APIHelper.SKIP, + site_id=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + number=APIHelper.SKIP, + sequence_number=APIHelper.SKIP, + issue_date=APIHelper.SKIP, + applied_date=APIHelper.SKIP, + status=APIHelper.SKIP, + currency=APIHelper.SKIP, + memo=APIHelper.SKIP, + seller=APIHelper.SKIP, + customer=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + subtotal_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + total_amount=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + remaining_amount=APIHelper.SKIP, + line_items=APIHelper.SKIP, + discounts=APIHelper.SKIP, + taxes=APIHelper.SKIP, + applications=APIHelper.SKIP, + refunds=APIHelper.SKIP, + origin_invoices=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreditNote instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if number is not APIHelper.SKIP: - self.number = number + self.number = number if sequence_number is not APIHelper.SKIP: - self.sequence_number = sequence_number + self.sequence_number = sequence_number if issue_date is not APIHelper.SKIP: - self.issue_date = issue_date + self.issue_date = issue_date if applied_date is not APIHelper.SKIP: - self.applied_date = applied_date + self.applied_date = applied_date if status is not APIHelper.SKIP: - self.status = status + self.status = status if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if seller is not APIHelper.SKIP: - self.seller = seller + self.seller = seller if customer is not APIHelper.SKIP: - self.customer = customer + self.customer = customer if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if shipping_address is not APIHelper.SKIP: - self.shipping_address = shipping_address + self.shipping_address = shipping_address if subtotal_amount is not APIHelper.SKIP: - self.subtotal_amount = subtotal_amount + self.subtotal_amount = subtotal_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if total_amount is not APIHelper.SKIP: - self.total_amount = total_amount + self.total_amount = total_amount if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount if remaining_amount is not APIHelper.SKIP: - self.remaining_amount = remaining_amount + self.remaining_amount = remaining_amount if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if discounts is not APIHelper.SKIP: - self.discounts = discounts + self.discounts = discounts if taxes is not APIHelper.SKIP: - self.taxes = taxes + self.taxes = taxes if applications is not APIHelper.SKIP: - self.applications = applications + self.applications = applications if refunds is not APIHelper.SKIP: - self.refunds = refunds + self.refunds = refunds if origin_invoices is not APIHelper.SKIP: - self.origin_invoices = origin_invoices + self.origin_invoices = origin_invoices # Add additional model properties to the instance if additional_properties is None: @@ -256,7 +268,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -267,64 +279,149 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - number = dictionary.get("number") if dictionary.get("number") else APIHelper.SKIP - sequence_number = dictionary.get("sequence_number") if dictionary.get("sequence_number") else APIHelper.SKIP - issue_date = dateutil.parser.parse(dictionary.get('issue_date')).date() if dictionary.get('issue_date') else APIHelper.SKIP - applied_date = dateutil.parser.parse(dictionary.get('applied_date')).date() if dictionary.get('applied_date') else APIHelper.SKIP - status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - seller = InvoiceSeller.from_dictionary(dictionary.get('seller')) if 'seller' in dictionary.keys() else APIHelper.SKIP - customer = InvoiceCustomer.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP - billing_address = InvoiceAddress.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP - shipping_address = InvoiceAddress.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP - subtotal_amount = dictionary.get("subtotal_amount") if dictionary.get("subtotal_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP - remaining_amount = dictionary.get("remaining_amount") if dictionary.get("remaining_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else APIHelper.SKIP + sequence_number =\ + dictionary.get("sequence_number")\ + if dictionary.get("sequence_number")\ + else APIHelper.SKIP + issue_date = dateutil.parser.parse( + dictionary.get("issue_date")).date()\ + if dictionary.get("issue_date") else APIHelper.SKIP + applied_date = dateutil.parser.parse( + dictionary.get("applied_date")).date()\ + if dictionary.get("applied_date") else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + seller =\ + InvoiceSeller.from_dictionary( + dictionary.get("seller"))\ + if "seller" in dictionary.keys()\ + else APIHelper.SKIP + customer =\ + InvoiceCustomer.from_dictionary( + dictionary.get("customer"))\ + if "customer" in dictionary.keys()\ + else APIHelper.SKIP + billing_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("billing_address"))\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + shipping_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("shipping_address"))\ + if "shipping_address" in dictionary.keys()\ + else APIHelper.SKIP + subtotal_amount =\ + dictionary.get("subtotal_amount")\ + if dictionary.get("subtotal_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + remaining_amount =\ + dictionary.get("remaining_amount")\ + if dictionary.get("remaining_amount")\ + else APIHelper.SKIP line_items = None - if dictionary.get('line_items') is not None: - line_items = [CreditNoteLineItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + CreditNoteLineItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP discounts = None - if dictionary.get('discounts') is not None: - discounts = [InvoiceDiscount.from_dictionary(x) for x in dictionary.get('discounts')] + if dictionary.get("discounts") is not None: + discounts = [ + InvoiceDiscount.from_dictionary(x) + for x in dictionary.get("discounts") + ] else: discounts = APIHelper.SKIP taxes = None - if dictionary.get('taxes') is not None: - taxes = [InvoiceTax.from_dictionary(x) for x in dictionary.get('taxes')] + if dictionary.get("taxes") is not None: + taxes = [ + InvoiceTax.from_dictionary(x) + for x in dictionary.get("taxes") + ] else: taxes = APIHelper.SKIP applications = None - if dictionary.get('applications') is not None: - applications = [CreditNoteApplication.from_dictionary(x) for x in dictionary.get('applications')] + if dictionary.get("applications") is not None: + applications = [ + CreditNoteApplication.from_dictionary(x) + for x in dictionary.get("applications") + ] else: applications = APIHelper.SKIP refunds = None - if dictionary.get('refunds') is not None: - refunds = [InvoiceRefund.from_dictionary(x) for x in dictionary.get('refunds')] + if dictionary.get("refunds") is not None: + refunds = [ + InvoiceRefund.from_dictionary(x) + for x in dictionary.get("refunds") + ] else: refunds = APIHelper.SKIP origin_invoices = None - if dictionary.get('origin_invoices') is not None: - origin_invoices = [OriginInvoice.from_dictionary(x) for x in dictionary.get('origin_invoices')] + if dictionary.get("origin_invoices") is not None: + origin_invoices = [ + OriginInvoice.from_dictionary(x) + for x in dictionary.get("origin_invoices") + ] else: origin_invoices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, site_id, @@ -357,7 +454,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -368,7 +465,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -378,63 +474,343 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'number={(self.number if hasattr(self, "number") else None)!r}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!r}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!r}, ' - f'applied_date={(self.applied_date if hasattr(self, "applied_date") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!r}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'remaining_amount={(self.remaining_amount if hasattr(self, "remaining_amount") else None)!r}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!r}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r}, ' - f'applications={(self.applications if hasattr(self, "applications") else None)!r}, ' - f'refunds={(self.refunds if hasattr(self, "refunds") else None)!r}, ' - f'origin_invoices={(self.origin_invoices if hasattr(self, "origin_invoices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _applied_date=( + self.applied_date + if hasattr(self, "applied_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _remaining_amount=( + self.remaining_amount + if hasattr(self, "remaining_amount") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _applications=( + self.applications + if hasattr(self, "applications") + else None + ) + _refunds=( + self.refunds + if hasattr(self, "refunds") + else None + ) + _origin_invoices=( + self.origin_invoices + if hasattr(self, "origin_invoices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"site_id={_site_id!r}, " + f"customer_id={_customer_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"number={_number!r}, " + f"sequence_number={_sequence_number!r}, " + f"issue_date={_issue_date!r}, " + f"applied_date={_applied_date!r}, " + f"status={_status!r}, " + f"currency={_currency!r}, " + f"memo={_memo!r}, " + f"seller={_seller!r}, " + f"customer={_customer!r}, " + f"billing_address={_billing_address!r}, " + f"shipping_address={_shipping_address!r}, " + f"subtotal_amount={_subtotal_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"total_amount={_total_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"remaining_amount={_remaining_amount!r}, " + f"line_items={_line_items!r}, " + f"discounts={_discounts!r}, " + f"taxes={_taxes!r}, " + f"applications={_applications!r}, " + f"refunds={_refunds!r}, " + f"origin_invoices={_origin_invoices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'number={(self.number if hasattr(self, "number") else None)!s}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!s}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!s}, ' - f'applied_date={(self.applied_date if hasattr(self, "applied_date") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!s}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'remaining_amount={(self.remaining_amount if hasattr(self, "remaining_amount") else None)!s}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!s}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s}, ' - f'applications={(self.applications if hasattr(self, "applications") else None)!s}, ' - f'refunds={(self.refunds if hasattr(self, "refunds") else None)!s}, ' - f'origin_invoices={(self.origin_invoices if hasattr(self, "origin_invoices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _applied_date=( + self.applied_date + if hasattr(self, "applied_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _remaining_amount=( + self.remaining_amount + if hasattr(self, "remaining_amount") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _applications=( + self.applications + if hasattr(self, "applications") + else None + ) + _refunds=( + self.refunds + if hasattr(self, "refunds") + else None + ) + _origin_invoices=( + self.origin_invoices + if hasattr(self, "origin_invoices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"site_id={_site_id!s}, " + f"customer_id={_customer_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"number={_number!s}, " + f"sequence_number={_sequence_number!s}, " + f"issue_date={_issue_date!s}, " + f"applied_date={_applied_date!s}, " + f"status={_status!s}, " + f"currency={_currency!s}, " + f"memo={_memo!s}, " + f"seller={_seller!s}, " + f"customer={_customer!s}, " + f"billing_address={_billing_address!s}, " + f"shipping_address={_shipping_address!s}, " + f"subtotal_amount={_subtotal_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"total_amount={_total_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"remaining_amount={_remaining_amount!s}, " + f"line_items={_line_items!s}, " + f"discounts={_discounts!s}, " + f"taxes={_taxes!s}, " + f"applications={_applications!s}, " + f"refunds={_refunds!s}, " + f"origin_invoices={_origin_invoices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_note_application.py b/advancedbilling/models/credit_note_application.py index 918557de..a2ee0af1 100644 --- a/advancedbilling/models/credit_note_application.py +++ b/advancedbilling/models/credit_note_application.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CreditNoteApplication(object): - """Implementation of the 'Credit Note Application' model. Attributes: @@ -19,48 +17,51 @@ class CreditNoteApplication(object): invoice_uid (str): The model property of type str. memo (str): The model property of type str. applied_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "transaction_time": 'transaction_time', - "invoice_uid": 'invoice_uid', - "memo": 'memo', - "applied_amount": 'applied_amount' + "uid": "uid", + "transaction_time": "transaction_time", + "invoice_uid": "invoice_uid", + "memo": "memo", + "applied_amount": "applied_amount", } _optionals = [ - 'uid', - 'transaction_time', - 'invoice_uid', - 'memo', - 'applied_amount', + "uid", + "transaction_time", + "invoice_uid", + "memo", + "applied_amount", ] - def __init__(self, - uid=APIHelper.SKIP, - transaction_time=APIHelper.SKIP, - invoice_uid=APIHelper.SKIP, - memo=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreditNoteApplication class""" - + def __init__( + self, + uid=APIHelper.SKIP, + transaction_time=APIHelper.SKIP, + invoice_uid=APIHelper.SKIP, + memo=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreditNoteApplication instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if transaction_time is not APIHelper.SKIP: - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None if invoice_uid is not APIHelper.SKIP: - self.invoice_uid = invoice_uid + self.invoice_uid = invoice_uid if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount # Add additional model properties to the instance if additional_properties is None: @@ -70,7 +71,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -81,18 +82,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else APIHelper.SKIP - invoice_uid = dictionary.get("invoice_uid") if dictionary.get("invoice_uid") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else APIHelper.SKIP + invoice_uid =\ + dictionary.get("invoice_uid")\ + if dictionary.get("invoice_uid")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, transaction_time, @@ -103,7 +120,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -114,7 +131,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -124,19 +140,79 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!r}, ' - f'invoice_uid={(self.invoice_uid if hasattr(self, "invoice_uid") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _invoice_uid=( + self.invoice_uid + if hasattr(self, "invoice_uid") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"transaction_time={_transaction_time!r}, " + f"invoice_uid={_invoice_uid!r}, " + f"memo={_memo!r}, " + f"applied_amount={_applied_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!s}, ' - f'invoice_uid={(self.invoice_uid if hasattr(self, "invoice_uid") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _invoice_uid=( + self.invoice_uid + if hasattr(self, "invoice_uid") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"transaction_time={_transaction_time!s}, " + f"invoice_uid={_invoice_uid!s}, " + f"memo={_memo!s}, " + f"applied_amount={_applied_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_note_line_item.py b/advancedbilling/models/credit_note_line_item.py index 99308a05..77cf400d 100644 --- a/advancedbilling/models/credit_note_line_item.py +++ b/advancedbilling/models/credit_note_line_item.py @@ -1,18 +1,16 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class CreditNoteLineItem(object): - """Implementation of the 'Credit Note Line Item' model. Attributes: @@ -20,172 +18,170 @@ class CreditNoteLineItem(object): cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. title (str): A short descriptor for the credit given by this line. - description (str): Detailed description for the credit given by this - line. May include proration details in plain text. Note: this - string may contain line breaks that are hints for the best display - format on the credit note. - quantity (str): The quantity or count of units credited by the line - item. This is a decimal number represented as a string. (See - "About Decimal Numbers".) - unit_price (str): The price per unit for the line item. When tiered - pricing was used (i.e. not every unit was actually priced at the - same price) this will be the blended average cost per unit and the - `tiered_unit_price` field will be set to `true`. - subtotal_amount (str): The line subtotal, generally calculated as - `quantity * unit_price`. This is the canonical amount of record - for the line - when rounding differences are in play, - `subtotal_amount` takes precedence over the value derived from - `quantity * unit_price` (which may not have the proper precision - to exactly equal this amount). - discount_amount (str): The approximate discount of just this line. - The value is approximated in cases where rounding errors make it - difficult to apportion exactly a total discount among many lines. - Several lines may have been summed prior to applying the discount - to arrive at `discount_amount` for the invoice - backing that out - to the discount on a single line may introduce rounding or - precision errors. + description (str): Detailed description for the credit given by this line. + May include proration details in plain text. Note: this string may + contain line breaks that are hints for the best display format on the + credit note. + quantity (str): The quantity or count of units credited by the line item. + This is a decimal number represented as a string. (See "About Decimal + Numbers".) + unit_price (str): The price per unit for the line item. When tiered pricing + was used (i.e. not every unit was actually priced at the same price) this + will be the blended average cost per unit and the `tiered_unit_price` + field will be set to `true`. + subtotal_amount (str): The line subtotal, generally calculated as `quantity * + unit_price`. This is the canonical amount of record for the line - when + rounding differences are in play, `subtotal_amount` takes precedence over + the value derived from `quantity * unit_price` (which may not have the + proper precision to exactly equal this amount). + discount_amount (str): The approximate discount of just this line. The value + is approximated in cases where rounding errors make it difficult to + apportion exactly a total discount among many lines. Several lines may + have been summed prior to applying the discount to arrive at + `discount_amount` for the invoice - backing that out to the discount on a + single line may introduce rounding or precision errors. tax_amount (str): The approximate tax of just this line. The value is approximated in cases where rounding errors make it difficult to - apportion exactly a total tax among many lines. Several lines may - have been summed prior to applying the tax rate to arrive at - `tax_amount` for the invoice - backing that out to the tax on a - single line may introduce rounding or precision errors. - total_amount (str): The non-canonical total amount for the line. + apportion exactly a total tax among many lines. Several lines may have + been summed prior to applying the tax rate to arrive at `tax_amount` for + the invoice - backing that out to the tax on a single line may introduce + rounding or precision errors. + total_amount (str): The non-canonical total amount for the line. `subtotal_amount` is the canonical amount for a line. The invoice - `total_amount` is derived from the sum of the line - `subtotal_amount`s and discounts or taxes applied thereafter. - Therefore, due to rounding or precision errors, the sum of line - `total_amount`s may not equal the invoice `total_amount`. - tiered_unit_price (bool): When `true`, indicates that the actual - pricing scheme for the line was tiered, so the `unit_price` shown - is the blended average for all units. - period_range_start (date): Start date for the period credited by this - line. The format is `"YYYY-MM-DD"`. - period_range_end (date): End date for the period credited by this - line. The format is `"YYYY-MM-DD"`. - product_id (int): The ID of the product being credited. This may be - set even for component credits, so true product-only - (non-component) credits will also have a nil `component_id`. + `total_amount` is derived from the sum of the line `subtotal_amount`s and + discounts or taxes applied thereafter. Therefore, due to rounding or + precision errors, the sum of line `total_amount`s may not equal the + invoice `total_amount`. + tiered_unit_price (bool): When `true`, indicates that the actual pricing + scheme for the line was tiered, so the `unit_price` shown is the blended + average for all units. + period_range_start (date): Start date for the period credited by this line. + The format is `"YYYY-MM-DD"`. + period_range_end (date): End date for the period credited by this line. The + format is `"YYYY-MM-DD"`. + product_id (int): The ID of the product being credited. This may be set even + for component credits, so true product-only (non-component) credits will + also have a nil `component_id`. product_version (int): The version of the product being credited. - component_id (int): The ID of the component being credited. Will be - `nil` for non-component credits. - price_point_id (int): The price point ID of the component being - credited. Will be `nil` for non-component credits. + component_id (int): The ID of the component being credited. Will be `nil` for + non-component credits. + price_point_id (int): The price point ID of the component being credited. + Will be `nil` for non-component credits. billing_schedule_item_id (int): The model property of type int. custom_item (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "title": 'title', - "description": 'description', - "quantity": 'quantity', - "unit_price": 'unit_price', - "subtotal_amount": 'subtotal_amount', - "discount_amount": 'discount_amount', - "tax_amount": 'tax_amount', - "total_amount": 'total_amount', - "tiered_unit_price": 'tiered_unit_price', - "period_range_start": 'period_range_start', - "period_range_end": 'period_range_end', - "product_id": 'product_id', - "product_version": 'product_version', - "component_id": 'component_id', - "price_point_id": 'price_point_id', - "billing_schedule_item_id": 'billing_schedule_item_id', - "custom_item": 'custom_item' + "uid": "uid", + "title": "title", + "description": "description", + "quantity": "quantity", + "unit_price": "unit_price", + "subtotal_amount": "subtotal_amount", + "discount_amount": "discount_amount", + "tax_amount": "tax_amount", + "total_amount": "total_amount", + "tiered_unit_price": "tiered_unit_price", + "period_range_start": "period_range_start", + "period_range_end": "period_range_end", + "product_id": "product_id", + "product_version": "product_version", + "component_id": "component_id", + "price_point_id": "price_point_id", + "billing_schedule_item_id": "billing_schedule_item_id", + "custom_item": "custom_item", } _optionals = [ - 'uid', - 'title', - 'description', - 'quantity', - 'unit_price', - 'subtotal_amount', - 'discount_amount', - 'tax_amount', - 'total_amount', - 'tiered_unit_price', - 'period_range_start', - 'period_range_end', - 'product_id', - 'product_version', - 'component_id', - 'price_point_id', - 'billing_schedule_item_id', - 'custom_item', + "uid", + "title", + "description", + "quantity", + "unit_price", + "subtotal_amount", + "discount_amount", + "tax_amount", + "total_amount", + "tiered_unit_price", + "period_range_start", + "period_range_end", + "product_id", + "product_version", + "component_id", + "price_point_id", + "billing_schedule_item_id", + "custom_item", ] _nullables = [ - 'component_id', - 'price_point_id', - 'billing_schedule_item_id', + "component_id", + "price_point_id", + "billing_schedule_item_id", ] - def __init__(self, - uid=APIHelper.SKIP, - title=APIHelper.SKIP, - description=APIHelper.SKIP, - quantity=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - subtotal_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - total_amount=APIHelper.SKIP, - tiered_unit_price=APIHelper.SKIP, - period_range_start=APIHelper.SKIP, - period_range_end=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_version=APIHelper.SKIP, - component_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - billing_schedule_item_id=APIHelper.SKIP, - custom_item=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CreditNoteLineItem class""" - + def __init__( + self, + uid=APIHelper.SKIP, + title=APIHelper.SKIP, + description=APIHelper.SKIP, + quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + subtotal_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + total_amount=APIHelper.SKIP, + tiered_unit_price=APIHelper.SKIP, + period_range_start=APIHelper.SKIP, + period_range_end=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_version=APIHelper.SKIP, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + billing_schedule_item_id=APIHelper.SKIP, + custom_item=APIHelper.SKIP, + additional_properties=None): + """Initialize a CreditNoteLineItem instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if title is not APIHelper.SKIP: - self.title = title + self.title = title if description is not APIHelper.SKIP: - self.description = description + self.description = description if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if subtotal_amount is not APIHelper.SKIP: - self.subtotal_amount = subtotal_amount + self.subtotal_amount = subtotal_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if total_amount is not APIHelper.SKIP: - self.total_amount = total_amount + self.total_amount = total_amount if tiered_unit_price is not APIHelper.SKIP: - self.tiered_unit_price = tiered_unit_price + self.tiered_unit_price = tiered_unit_price if period_range_start is not APIHelper.SKIP: - self.period_range_start = period_range_start + self.period_range_start = period_range_start if period_range_end is not APIHelper.SKIP: - self.period_range_end = period_range_end + self.period_range_end = period_range_end if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_version is not APIHelper.SKIP: - self.product_version = product_version + self.product_version = product_version if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if billing_schedule_item_id is not APIHelper.SKIP: - self.billing_schedule_item_id = billing_schedule_item_id + self.billing_schedule_item_id = billing_schedule_item_id if custom_item is not APIHelper.SKIP: - self.custom_item = custom_item + self.custom_item = custom_item # Add additional model properties to the instance if additional_properties is None: @@ -195,7 +191,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -206,31 +202,85 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - unit_price = dictionary.get("unit_price") if dictionary.get("unit_price") else APIHelper.SKIP - subtotal_amount = dictionary.get("subtotal_amount") if dictionary.get("subtotal_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else APIHelper.SKIP - tiered_unit_price = dictionary.get("tiered_unit_price") if "tiered_unit_price" in dictionary.keys() else APIHelper.SKIP - period_range_start = dateutil.parser.parse(dictionary.get('period_range_start')).date() if dictionary.get('period_range_start') else APIHelper.SKIP - period_range_end = dateutil.parser.parse(dictionary.get('period_range_end')).date() if dictionary.get('period_range_end') else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_version = dictionary.get("product_version") if dictionary.get("product_version") else APIHelper.SKIP - component_id = dictionary.get("component_id") if "component_id" in dictionary.keys() else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if "price_point_id" in dictionary.keys() else APIHelper.SKIP - billing_schedule_item_id = dictionary.get("billing_schedule_item_id") if "billing_schedule_item_id" in dictionary.keys() else APIHelper.SKIP - custom_item = dictionary.get("custom_item") if "custom_item" in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + unit_price =\ + dictionary.get("unit_price")\ + if dictionary.get("unit_price")\ + else APIHelper.SKIP + subtotal_amount =\ + dictionary.get("subtotal_amount")\ + if dictionary.get("subtotal_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else APIHelper.SKIP + tiered_unit_price =\ + dictionary.get("tiered_unit_price")\ + if "tiered_unit_price" in dictionary.keys()\ + else APIHelper.SKIP + period_range_start = dateutil.parser.parse( + dictionary.get("period_range_start")).date()\ + if dictionary.get("period_range_start") else APIHelper.SKIP + period_range_end = dateutil.parser.parse( + dictionary.get("period_range_end")).date()\ + if dictionary.get("period_range_end") else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_version =\ + dictionary.get("product_version")\ + if dictionary.get("product_version")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if "component_id" in dictionary.keys()\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if "price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + billing_schedule_item_id =\ + dictionary.get("billing_schedule_item_id")\ + if "billing_schedule_item_id" in dictionary.keys()\ + else APIHelper.SKIP + custom_item =\ + dictionary.get("custom_item")\ + if "custom_item" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, title, @@ -254,7 +304,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -265,7 +315,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -275,45 +324,235 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!r}, ' - f'tiered_unit_price={(self.tiered_unit_price if hasattr(self, "tiered_unit_price") else None)!r}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!r}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_version={(self.product_version if hasattr(self, "product_version") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'billing_schedule_item_id={(self.billing_schedule_item_id if hasattr(self, "billing_schedule_item_id") else None)!r}, ' - f'custom_item={(self.custom_item if hasattr(self, "custom_item") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _tiered_unit_price=( + self.tiered_unit_price + if hasattr(self, "tiered_unit_price") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_version=( + self.product_version + if hasattr(self, "product_version") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule_item_id=( + self.billing_schedule_item_id + if hasattr(self, "billing_schedule_item_id") + else None + ) + _custom_item=( + self.custom_item + if hasattr(self, "custom_item") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"title={_title!r}, " + f"description={_description!r}, " + f"quantity={_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"subtotal_amount={_subtotal_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"total_amount={_total_amount!r}, " + f"tiered_unit_price={_tiered_unit_price!r}, " + f"period_range_start={_period_range_start!r}, " + f"period_range_end={_period_range_end!r}, " + f"product_id={_product_id!r}, " + f"product_version={_product_version!r}, " + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"billing_schedule_item_id={_billing_schedule_item_id!r}, " + f"custom_item={_custom_item!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!s}, ' - f'tiered_unit_price={(self.tiered_unit_price if hasattr(self, "tiered_unit_price") else None)!s}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!s}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_version={(self.product_version if hasattr(self, "product_version") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'billing_schedule_item_id={(self.billing_schedule_item_id if hasattr(self, "billing_schedule_item_id") else None)!s}, ' - f'custom_item={(self.custom_item if hasattr(self, "custom_item") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _tiered_unit_price=( + self.tiered_unit_price + if hasattr(self, "tiered_unit_price") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_version=( + self.product_version + if hasattr(self, "product_version") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule_item_id=( + self.billing_schedule_item_id + if hasattr(self, "billing_schedule_item_id") + else None + ) + _custom_item=( + self.custom_item + if hasattr(self, "custom_item") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"title={_title!s}, " + f"description={_description!s}, " + f"quantity={_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"subtotal_amount={_subtotal_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"total_amount={_total_amount!s}, " + f"tiered_unit_price={_tiered_unit_price!s}, " + f"period_range_start={_period_range_start!s}, " + f"period_range_end={_period_range_end!s}, " + f"product_id={_product_id!s}, " + f"product_version={_product_version!s}, " + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"billing_schedule_item_id={_billing_schedule_item_id!s}, " + f"custom_item={_custom_item!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_note_status.py b/advancedbilling/models/credit_note_status.py index a5cb89d9..6426cd37 100644 --- a/advancedbilling/models/credit_note_status.py +++ b/advancedbilling/models/credit_note_status.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CreditNoteStatus(object): - """Implementation of the 'Credit Note Status' enum. Current status of the credit note. @@ -17,18 +14,19 @@ class CreditNoteStatus(object): Attributes: OPEN: The enum member of type str. APPLIED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['open', 'applied'] - OPEN = 'open' - APPLIED = 'applied' + _all_values = ["open", "applied"] + OPEN = "open" + + APPLIED = "applied" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -38,9 +36,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/credit_scheme.py b/advancedbilling/models/credit_scheme.py index b545d775..54355bf1 100644 --- a/advancedbilling/models/credit_scheme.py +++ b/advancedbilling/models/credit_scheme.py @@ -1,33 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CreditScheme(object): - """Implementation of the 'Credit Scheme' enum. Attributes: NONE: The enum member of type str. CREDIT: The enum member of type str. REFUND: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - NONE = 'none' - CREDIT = 'credit' + NONE = "none" + + CREDIT = "credit" - REFUND = 'refund' + REFUND = "refund" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/credit_scheme_request.py b/advancedbilling/models/credit_scheme_request.py index f8709095..c6c60f91 100644 --- a/advancedbilling/models/credit_scheme_request.py +++ b/advancedbilling/models/credit_scheme_request.py @@ -1,36 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class CreditSchemeRequest(object): - """Implementation of the 'Credit Scheme Request' model. Attributes: credit_scheme (CreditScheme): The model property of type CreditScheme. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "credit_scheme": 'credit_scheme' + "credit_scheme": "credit_scheme", } - def __init__(self, - credit_scheme=None, - additional_properties=None): - """Constructor for the CreditSchemeRequest class""" - + def __init__( + self, + credit_scheme=None, + additional_properties=None): + """Initialize a CreditSchemeRequest instance.""" # Initialize members of the class - self.credit_scheme = credit_scheme + self.credit_scheme = credit_scheme # Add additional model properties to the instance if additional_properties is None: @@ -40,7 +36,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -51,24 +47,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - credit_scheme = dictionary.get("credit_scheme") if dictionary.get("credit_scheme") else None + credit_scheme =\ + dictionary.get("credit_scheme")\ + if dictionary.get("credit_scheme")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(credit_scheme, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'credit_scheme={self.credit_scheme!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _credit_scheme=self.credit_scheme + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_scheme={_credit_scheme!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'credit_scheme={self.credit_scheme!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _credit_scheme=self.credit_scheme + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_scheme={_credit_scheme!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/credit_type.py b/advancedbilling/models/credit_type.py index fa9169f9..72e098dc 100644 --- a/advancedbilling/models/credit_type.py +++ b/advancedbilling/models/credit_type.py @@ -1,39 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CreditType(object): - """Implementation of the 'Credit Type' enum. - The type of credit to be created when upgrading/downgrading. Defaults to - the component and then site setting if one is not provided. - Available values: `full`, `prorated`, `none`. + The type of credit to be created when upgrading/downgrading. Defaults to the + component and then site setting if one is not provided. Attributes: FULL: The enum member of type str. PRORATED: The enum member of type str. NONE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['full', 'prorated', 'none'] - FULL = 'full' - PRORATED = 'prorated' + _all_values = ["full", "prorated", "none"] + FULL = "full" - NONE = 'none' + PRORATED = "prorated" + + NONE = "none" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -43,9 +40,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/currency_overage_prices.py b/advancedbilling/models/currency_overage_prices.py new file mode 100644 index 00000000..ae0da393 --- /dev/null +++ b/advancedbilling/models/currency_overage_prices.py @@ -0,0 +1,710 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.component_currency_price import ( + ComponentCurrencyPrice, +) +from advancedbilling.models.component_price import ( + ComponentPrice, +) + + +class CurrencyOveragePrices(object): + """Implementation of the 'Currency Overage Prices' model. + + Extends a component price point with currency overage prices. + + Attributes: + id (int): The model property of type int. + mtype (PricePointType): Price point type. We expose the following types: 1. + **default**: a price point that is marked as a default price for a + certain product. 2. **custom**: a custom price point. 3. **catalog**: a + price point that is **not** marked as a default price for a certain + product and is **not** a custom one. + default (bool): Note: Refer to type attribute instead + name (str): The model property of type str. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. + component_id (int): The model property of type int. + handle (str): The model property of type str. + archived_at (datetime): The model property of type datetime. + created_at (datetime): The model property of type datetime. + updated_at (datetime): The model property of type datetime. + prices (List[ComponentPrice]): The model property of type + List[ComponentPrice]. + use_site_exchange_rate (bool): Whether to use the site level exchange rate or + define your own prices for each currency if you have multiple currencies + defined on the site. Defaults to true during creation. + subscription_id (int): (only used for Custom Pricing - ie. when the price + point's type is `custom`) The id of the subscription that the custom + price point is for. + tax_included (bool): The model property of type bool. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only + available for sites with Multifrequency enabled. + currency_prices (List[ComponentCurrencyPrice]): An array of currency pricing + data is available when multiple currencies are defined for the site. It + varies based on the use_site_exchange_rate setting for the price point. + This parameter is present only in the response of read endpoints, after + including the appropriate query parameter. The clone endpoint always + returns currency prices if they are present. + overage_prices (List[ComponentPrice]): Applicable only to prepaid usage + components. An array of overage price brackets. + overage_pricing_scheme (PricingScheme): Applicable only to prepaid usage + components. Pricing scheme for overage pricing. + renew_prepaid_allocation (bool): Applicable only to prepaid usage components. + Boolean which controls whether or not the allocated quantity should be + renewed at the beginning of each period. + rollover_prepaid_remainder (bool): Applicable only to prepaid usage + components. Boolean which controls whether or not remaining units should + be rolled over to the next period. + expiration_interval (int): Applicable only to prepaid usage components where + rollover_prepaid_remainder is true. The number of + `expiration_interval_unit`s after which rollover amounts should expire. + expiration_interval_unit (ExpirationIntervalUnit): Applicable only to prepaid + usage components where rollover_prepaid_remainder is true. A string + representing the expiration interval unit for this component, either + month or day. + currency_overage_prices (List[ComponentCurrencyPrice]): Applicable only to + prepaid usage components. An array of currency pricing data for overage + prices. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": "id", + "mtype": "type", + "default": "default", + "name": "name", + "pricing_scheme": "pricing_scheme", + "component_id": "component_id", + "handle": "handle", + "archived_at": "archived_at", + "created_at": "created_at", + "updated_at": "updated_at", + "prices": "prices", + "use_site_exchange_rate": "use_site_exchange_rate", + "subscription_id": "subscription_id", + "tax_included": "tax_included", + "interval": "interval", + "interval_unit": "interval_unit", + "currency_prices": "currency_prices", + "overage_prices": "overage_prices", + "overage_pricing_scheme": "overage_pricing_scheme", + "renew_prepaid_allocation": "renew_prepaid_allocation", + "rollover_prepaid_remainder": "rollover_prepaid_remainder", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + "currency_overage_prices": "currency_overage_prices", + } + + _optionals = [ + "id", + "mtype", + "default", + "name", + "pricing_scheme", + "component_id", + "handle", + "archived_at", + "created_at", + "updated_at", + "prices", + "use_site_exchange_rate", + "subscription_id", + "tax_included", + "interval", + "interval_unit", + "currency_prices", + "overage_prices", + "overage_pricing_scheme", + "renew_prepaid_allocation", + "rollover_prepaid_remainder", + "expiration_interval", + "expiration_interval_unit", + "currency_overage_prices", + ] + + _nullables = [ + "handle", + "archived_at", + "interval", + "interval_unit", + "expiration_interval", + "expiration_interval_unit", + ] + + def __init__( + self, + id=APIHelper.SKIP, + mtype=APIHelper.SKIP, + default=APIHelper.SKIP, + name=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + component_id=APIHelper.SKIP, + handle=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + prices=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + tax_included=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + currency_prices=APIHelper.SKIP, + overage_prices=APIHelper.SKIP, + overage_pricing_scheme=APIHelper.SKIP, + renew_prepaid_allocation=APIHelper.SKIP, + rollover_prepaid_remainder=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + currency_overage_prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a CurrencyOveragePrices instance.""" + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if mtype is not APIHelper.SKIP: + self.mtype = mtype + if default is not APIHelper.SKIP: + self.default = default + if name is not APIHelper.SKIP: + self.name = name + if pricing_scheme is not APIHelper.SKIP: + self.pricing_scheme = pricing_scheme + if component_id is not APIHelper.SKIP: + self.component_id = component_id + if handle is not APIHelper.SKIP: + self.handle = handle + if archived_at is not APIHelper.SKIP: + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None + if created_at is not APIHelper.SKIP: + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None + if updated_at is not APIHelper.SKIP: + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None + if prices is not APIHelper.SKIP: + self.prices = prices + if use_site_exchange_rate is not APIHelper.SKIP: + self.use_site_exchange_rate = use_site_exchange_rate + if subscription_id is not APIHelper.SKIP: + self.subscription_id = subscription_id + if tax_included is not APIHelper.SKIP: + self.tax_included = tax_included + if interval is not APIHelper.SKIP: + self.interval = interval + if interval_unit is not APIHelper.SKIP: + self.interval_unit = interval_unit + if currency_prices is not APIHelper.SKIP: + self.currency_prices = currency_prices + if overage_prices is not APIHelper.SKIP: + self.overage_prices = overage_prices + if overage_pricing_scheme is not APIHelper.SKIP: + self.overage_pricing_scheme = overage_pricing_scheme + if renew_prepaid_allocation is not APIHelper.SKIP: + self.renew_prepaid_allocation = renew_prepaid_allocation + if rollover_prepaid_remainder is not APIHelper.SKIP: + self.rollover_prepaid_remainder = rollover_prepaid_remainder + if expiration_interval is not APIHelper.SKIP: + self.expiration_interval = expiration_interval + if expiration_interval_unit is not APIHelper.SKIP: + self.expiration_interval_unit = expiration_interval_unit + if currency_overage_prices is not APIHelper.SKIP: + self.currency_overage_prices = currency_overage_prices + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else APIHelper.SKIP + default =\ + dictionary.get("default")\ + if "default" in dictionary.keys()\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if "handle" in dictionary.keys()\ + else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + + else: + archived_at = APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + prices = None + if dictionary.get("prices") is not None: + prices = [ + ComponentPrice.from_dictionary(x) + for x in dictionary.get("prices") + ] + else: + prices = APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if "interval" in dictionary.keys()\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + currency_prices = None + if dictionary.get("currency_prices") is not None: + currency_prices = [ + ComponentCurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] + else: + currency_prices = APIHelper.SKIP + overage_prices = None + if dictionary.get("overage_prices") is not None: + overage_prices = [ + ComponentPrice.from_dictionary(x) + for x in dictionary.get("overage_prices") + ] + else: + overage_prices = APIHelper.SKIP + overage_pricing_scheme =\ + dictionary.get("overage_pricing_scheme")\ + if dictionary.get("overage_pricing_scheme")\ + else APIHelper.SKIP + renew_prepaid_allocation =\ + dictionary.get("renew_prepaid_allocation")\ + if "renew_prepaid_allocation" in dictionary.keys()\ + else APIHelper.SKIP + rollover_prepaid_remainder =\ + dictionary.get("rollover_prepaid_remainder")\ + if "rollover_prepaid_remainder" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if "expiration_interval" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + currency_overage_prices = None + if dictionary.get("currency_overage_prices") is not None: + currency_overage_prices = [ + ComponentCurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_overage_prices") + ] + else: + currency_overage_prices = APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(id, + mtype, + default, + name, + pricing_scheme, + component_id, + handle, + archived_at, + created_at, + updated_at, + prices, + use_site_exchange_rate, + subscription_id, + tax_included, + interval, + interval_unit, + currency_prices, + overage_prices, + overage_pricing_scheme, + renew_prepaid_allocation, + rollover_prepaid_remainder, + expiration_interval, + expiration_interval_unit, + currency_overage_prices, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _default=( + self.default + if hasattr(self, "default") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _overage_prices=( + self.overage_prices + if hasattr(self, "overage_prices") + else None + ) + _overage_pricing_scheme=( + self.overage_pricing_scheme + if hasattr(self, "overage_pricing_scheme") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _currency_overage_prices=( + self.currency_overage_prices + if hasattr(self, "currency_overage_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"mtype={_mtype!r}, " + f"default={_default!r}, " + f"name={_name!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"component_id={_component_id!r}, " + f"handle={_handle!r}, " + f"archived_at={_archived_at!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"prices={_prices!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"subscription_id={_subscription_id!r}, " + f"tax_included={_tax_included!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"currency_prices={_currency_prices!r}, " + f"overage_prices={_overage_prices!r}, " + f"overage_pricing_scheme={_overage_pricing_scheme!r}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!r}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"currency_overage_prices={_currency_overage_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _default=( + self.default + if hasattr(self, "default") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _overage_prices=( + self.overage_prices + if hasattr(self, "overage_prices") + else None + ) + _overage_pricing_scheme=( + self.overage_pricing_scheme + if hasattr(self, "overage_pricing_scheme") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _currency_overage_prices=( + self.currency_overage_prices + if hasattr(self, "currency_overage_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"mtype={_mtype!s}, " + f"default={_default!s}, " + f"name={_name!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"component_id={_component_id!s}, " + f"handle={_handle!s}, " + f"archived_at={_archived_at!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"prices={_prices!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"subscription_id={_subscription_id!s}, " + f"tax_included={_tax_included!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"currency_prices={_currency_prices!s}, " + f"overage_prices={_overage_prices!s}, " + f"overage_pricing_scheme={_overage_pricing_scheme!s}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!s}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"currency_overage_prices={_currency_overage_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/currency_price.py b/advancedbilling/models/currency_price.py index f1562ebb..ef8dfcc2 100644 --- a/advancedbilling/models/currency_price.py +++ b/advancedbilling/models/currency_price.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CurrencyPrice(object): - """Implementation of the 'Currency Price' model. Attributes: @@ -22,63 +20,63 @@ class CurrencyPrice(object): price_point_id (int): The model property of type int. product_price_point_id (int): The model property of type int. role (CurrencyPriceRole): Role for the price. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "currency": 'currency', - "price": 'price', - "formatted_price": 'formatted_price', - "price_id": 'price_id', - "price_point_id": 'price_point_id', - "product_price_point_id": 'product_price_point_id', - "role": 'role' + "id": "id", + "currency": "currency", + "price": "price", + "formatted_price": "formatted_price", + "price_id": "price_id", + "price_point_id": "price_point_id", + "product_price_point_id": "product_price_point_id", + "role": "role", } _optionals = [ - 'id', - 'currency', - 'price', - 'formatted_price', - 'price_id', - 'price_point_id', - 'product_price_point_id', - 'role', + "id", + "currency", + "price", + "formatted_price", + "price_id", + "price_point_id", + "product_price_point_id", + "role", ] - def __init__(self, - id=APIHelper.SKIP, - currency=APIHelper.SKIP, - price=APIHelper.SKIP, - formatted_price=APIHelper.SKIP, - price_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - role=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CurrencyPrice class""" - + def __init__( + self, + id=APIHelper.SKIP, + currency=APIHelper.SKIP, + price=APIHelper.SKIP, + formatted_price=APIHelper.SKIP, + price_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + role=APIHelper.SKIP, + additional_properties=None): + """Initialize a CurrencyPrice instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if price is not APIHelper.SKIP: - self.price = price + self.price = price if formatted_price is not APIHelper.SKIP: - self.formatted_price = formatted_price + self.formatted_price = formatted_price if price_id is not APIHelper.SKIP: - self.price_id = price_id + self.price_id = price_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if role is not APIHelper.SKIP: - self.role = role + self.role = role # Add additional model properties to the instance if additional_properties is None: @@ -88,7 +86,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -99,21 +97,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - price = dictionary.get("price") if dictionary.get("price") else APIHelper.SKIP - formatted_price = dictionary.get("formatted_price") if dictionary.get("formatted_price") else APIHelper.SKIP - price_id = dictionary.get("price_id") if dictionary.get("price_id") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - role = dictionary.get("role") if dictionary.get("role") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + price =\ + dictionary.get("price")\ + if dictionary.get("price")\ + else APIHelper.SKIP + formatted_price =\ + dictionary.get("formatted_price")\ + if dictionary.get("formatted_price")\ + else APIHelper.SKIP + price_id =\ + dictionary.get("price_id")\ + if dictionary.get("price_id")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, currency, @@ -126,25 +150,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'price={(self.price if hasattr(self, "price") else None)!r}, ' - f'formatted_price={(self.formatted_price if hasattr(self, "formatted_price") else None)!r}, ' - f'price_id={(self.price_id if hasattr(self, "price_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'role={(self.role if hasattr(self, "role") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _formatted_price=( + self.formatted_price + if hasattr(self, "formatted_price") + else None + ) + _price_id=( + self.price_id + if hasattr(self, "price_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"currency={_currency!r}, " + f"price={_price!r}, " + f"formatted_price={_formatted_price!r}, " + f"price_id={_price_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"role={_role!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'price={(self.price if hasattr(self, "price") else None)!s}, ' - f'formatted_price={(self.formatted_price if hasattr(self, "formatted_price") else None)!s}, ' - f'price_id={(self.price_id if hasattr(self, "price_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'role={(self.role if hasattr(self, "role") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _formatted_price=( + self.formatted_price + if hasattr(self, "formatted_price") + else None + ) + _price_id=( + self.price_id + if hasattr(self, "price_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"currency={_currency!s}, " + f"price={_price!s}, " + f"formatted_price={_formatted_price!s}, " + f"price_id={_price_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"role={_role!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/currency_price_role.py b/advancedbilling/models/currency_price_role.py index 8a9efb36..a0a0c4a5 100644 --- a/advancedbilling/models/currency_price_role.py +++ b/advancedbilling/models/currency_price_role.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CurrencyPriceRole(object): - """Implementation of the 'Currency Price Role' enum. Role for the price. @@ -18,18 +15,20 @@ class CurrencyPriceRole(object): BASELINE: The enum member of type str. TRIAL: The enum member of type str. INITIAL: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - BASELINE = 'baseline' - TRIAL = 'trial' + BASELINE = "baseline" + + TRIAL = "trial" - INITIAL = 'initial' + INITIAL = "initial" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/currency_prices_response.py b/advancedbilling/models/currency_prices_response.py index c20eaa2c..8bdcf990 100644 --- a/advancedbilling/models/currency_prices_response.py +++ b/advancedbilling/models/currency_prices_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.currency_price import CurrencyPrice +# ruff: noqa: E501 +from advancedbilling.models.currency_price import ( + CurrencyPrice, +) -class CurrencyPricesResponse(object): +class CurrencyPricesResponse(object): """Implementation of the 'Currency Prices Response' model. Attributes: currency_prices (List[CurrencyPrice]): The model property of type List[CurrencyPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency_prices": 'currency_prices' + "currency_prices": "currency_prices", } - def __init__(self, - currency_prices=None, - additional_properties=None): - """Constructor for the CurrencyPricesResponse class""" - + def __init__( + self, + currency_prices=None, + additional_properties=None): + """Initialize a CurrencyPricesResponse instance.""" # Initialize members of the class - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [CurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + CurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency_prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/custom_field_owner.py b/advancedbilling/models/custom_field_owner.py index 7bbfba7b..50b23108 100644 --- a/advancedbilling/models/custom_field_owner.py +++ b/advancedbilling/models/custom_field_owner.py @@ -1,32 +1,30 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class CustomFieldOwner(object): - """Implementation of the 'Custom Field Owner' enum. Attributes: CUSTOMER: The enum member of type str. SUBSCRIPTION: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['Customer', 'Subscription'] - CUSTOMER = 'Customer' - SUBSCRIPTION = 'Subscription' + _all_values = ["Customer", "Subscription"] + CUSTOMER = "Customer" + + SUBSCRIPTION = "Subscription" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -36,9 +34,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/custom_field_value_change.py b/advancedbilling/models/custom_field_value_change.py index bbc55eec..0e8405a3 100644 --- a/advancedbilling/models/custom_field_value_change.py +++ b/advancedbilling/models/custom_field_value_change.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CustomFieldValueChange(object): - """Implementation of the 'Custom Field Value Change' model. Attributes: @@ -21,46 +19,46 @@ class CustomFieldValueChange(object): new_value (str): The model property of type str. resource_type (str): The model property of type str. resource_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "event_type": 'event_type', - "metafield_name": 'metafield_name', - "metafield_id": 'metafield_id', - "old_value": 'old_value', - "new_value": 'new_value', - "resource_type": 'resource_type', - "resource_id": 'resource_id' + "event_type": "event_type", + "metafield_name": "metafield_name", + "metafield_id": "metafield_id", + "old_value": "old_value", + "new_value": "new_value", + "resource_type": "resource_type", + "resource_id": "resource_id", } _nullables = [ - 'old_value', - 'new_value', + "old_value", + "new_value", ] - def __init__(self, - event_type=None, - metafield_name=None, - metafield_id=None, - old_value=None, - new_value=None, - resource_type=None, - resource_id=None, - additional_properties=None): - """Constructor for the CustomFieldValueChange class""" - + def __init__( + self, + event_type=None, + metafield_name=None, + metafield_id=None, + old_value=None, + new_value=None, + resource_type=None, + resource_id=None, + additional_properties=None): + """Initialize a CustomFieldValueChange instance.""" # Initialize members of the class - self.event_type = event_type - self.metafield_name = metafield_name - self.metafield_id = metafield_id - self.old_value = old_value - self.new_value = new_value - self.resource_type = resource_type - self.resource_id = resource_id + self.event_type = event_type + self.metafield_name = metafield_name + self.metafield_id = metafield_id + self.old_value = old_value + self.new_value = new_value + self.resource_type = resource_type + self.resource_id = resource_id # Add additional model properties to the instance if additional_properties is None: @@ -70,7 +68,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -81,20 +79,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - event_type = dictionary.get("event_type") if dictionary.get("event_type") else None - metafield_name = dictionary.get("metafield_name") if dictionary.get("metafield_name") else None - metafield_id = dictionary.get("metafield_id") if dictionary.get("metafield_id") else None - old_value = dictionary.get("old_value") if dictionary.get("old_value") else None - new_value = dictionary.get("new_value") if dictionary.get("new_value") else None - resource_type = dictionary.get("resource_type") if dictionary.get("resource_type") else None - resource_id = dictionary.get("resource_id") if dictionary.get("resource_id") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else None + metafield_name =\ + dictionary.get("metafield_name")\ + if dictionary.get("metafield_name")\ + else None + metafield_id =\ + dictionary.get("metafield_id")\ + if dictionary.get("metafield_id")\ + else None + old_value =\ + dictionary.get("old_value")\ + if dictionary.get("old_value")\ + else None + new_value =\ + dictionary.get("new_value")\ + if dictionary.get("new_value")\ + else None + resource_type =\ + dictionary.get("resource_type")\ + if dictionary.get("resource_type")\ + else None + resource_id =\ + dictionary.get("resource_id")\ + if dictionary.get("resource_id")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(event_type, metafield_name, @@ -107,7 +128,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -118,63 +139,156 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.metafield_name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.metafield_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.old_value, - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.new_value, - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.resource_type, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.resource_id, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.metafield_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.metafield_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.old_value, + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.new_value, + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.resource_type, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.resource_id, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('metafield_name'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('metafield_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('old_value'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('new_value'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('resource_type'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('resource_id'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("metafield_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("metafield_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("old_value"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_value"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("resource_type"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("resource_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'event_type={self.event_type!r}, ' - f'metafield_name={self.metafield_name!r}, ' - f'metafield_id={self.metafield_id!r}, ' - f'old_value={self.old_value!r}, ' - f'new_value={self.new_value!r}, ' - f'resource_type={self.resource_type!r}, ' - f'resource_id={self.resource_id!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _event_type=self.event_type + _metafield_name=self.metafield_name + _metafield_id=self.metafield_id + _old_value=self.old_value + _new_value=self.new_value + _resource_type=self.resource_type + _resource_id=self.resource_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event_type={_event_type!r}, " + f"metafield_name={_metafield_name!r}, " + f"metafield_id={_metafield_id!r}, " + f"old_value={_old_value!r}, " + f"new_value={_new_value!r}, " + f"resource_type={_resource_type!r}, " + f"resource_id={_resource_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'event_type={self.event_type!s}, ' - f'metafield_name={self.metafield_name!s}, ' - f'metafield_id={self.metafield_id!s}, ' - f'old_value={self.old_value!s}, ' - f'new_value={self.new_value!s}, ' - f'resource_type={self.resource_type!s}, ' - f'resource_id={self.resource_id!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _event_type=self.event_type + _metafield_name=self.metafield_name + _metafield_id=self.metafield_id + _old_value=self.old_value + _new_value=self.new_value + _resource_type=self.resource_type + _resource_id=self.resource_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event_type={_event_type!s}, " + f"metafield_name={_metafield_name!s}, " + f"metafield_id={_metafield_id!s}, " + f"old_value={_old_value!s}, " + f"new_value={_new_value!s}, " + f"resource_type={_resource_type!s}, " + f"resource_id={_resource_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer.py b/advancedbilling/models/customer.py index af05ff1a..362d9829 100644 --- a/advancedbilling/models/customer.py +++ b/advancedbilling/models/customer.py @@ -1,40 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Customer(object): - """Implementation of the 'Customer' model. Attributes: first_name (str): The first name of the customer last_name (str): The last name of the customer email (str): The email address of the customer - cc_emails (str): A comma-separated list of emails that should be cc’d - on all customer communications (i.e. “joe@example.com, - sue@example.com”) - organization (str): The organization of the customer. If no value, - `null` or empty string is provided, `organization` will be - populated with the customer's first and last name, separated with - a space. - reference (str): The unique identifier used within your own - application for this customer + cc_emails (str): A comma-separated list of emails that should be cc’d on all + customer communications (i.e. “joe@example.com, sue@example.com”) + organization (str): The organization of the customer. If no value, `null` or + empty string is provided, `organization` will be populated with the + customer's first and last name, separated with a space. + reference (str): The unique identifier used within your own application for + this customer id (int): The customer ID in Chargify - created_at (datetime): The timestamp in which the customer object was - created in Chargify - updated_at (datetime): The timestamp in which the customer object was - last edited - address (str): The customer’s shipping street address (i.e. “123 Main - St.”) - address_2 (str): Second line of the customer’s shipping address i.e. - “Apt. 100” + created_at (datetime): The timestamp in which the customer object was created + in Chargify + updated_at (datetime): The timestamp in which the customer object was last + edited + address (str): The customer’s shipping street address (i.e. “123 Main St.”) + address_2 (str): Second line of the customer’s shipping address i.e. “Apt. + 100” city (str): The customer’s shipping address city (i.e. “Boston”) state (str): The customer’s shipping address state (i.e. “MA”) state_name (str): The customer's full name of state @@ -42,222 +37,236 @@ class Customer(object): country (str): The customer shipping address country country_name (str): The customer's full name of country phone (str): The phone number of the customer - verified (bool): Is the customer verified to use ACH as a payment - method. - portal_customer_created_at (datetime): The timestamp of when the - Billing Portal entry was created at for the customer - portal_invite_last_sent_at (datetime): The timestamp of when the - Billing Portal invite was last sent at - portal_invite_last_accepted_at (datetime): The timestamp of when the - Billing Portal invite was last accepted - tax_exempt (bool): The tax exempt status for the customer. Acceptable - values are true or 1 for true and false or 0 for false. - vat_number (str): The VAT business identification number for the - customer. This number is used to determine VAT tax opt out rules. - It is not validated when added or updated on a customer record. - Instead, it is validated via VIES before calculating taxes. Only - valid business identification numbers will allow for VAT opt out. - parent_id (int): The parent ID in Chargify if applicable. Parent is - another Customer object. + verified (bool): Is the customer verified to use ACH as a payment method. + portal_customer_created_at (datetime): The timestamp of when the Billing + Portal entry was created at for the customer + portal_invite_last_sent_at (datetime): The timestamp of when the Billing + Portal invite was last sent at + portal_invite_last_accepted_at (datetime): The timestamp of when the Billing + Portal invite was last accepted + tax_exempt (bool): The tax exempt status for the customer. Acceptable values + are true or 1 for true and false or 0 for false. + vat_number (str): The VAT business identification number for the customer. + This number is used to determine VAT tax opt out rules. It is not + validated when added or updated on a customer record. Instead, it is + validated via VIES before calculating taxes. Only valid business + identification numbers will allow for VAT opt out. + parent_id (int): The parent ID in Chargify if applicable. Parent is another + Customer object. locale (str): The locale for the customer to identify language-region default_subscription_group_uid (str): The model property of type str. salesforce_id (str): The Salesforce ID for the customer tax_exempt_reason (str): The Tax Exemption Reason Code for the customer - default_auto_renewal_profile_id (int): The default auto-renewal - profile ID for the customer - additional_properties (Dict[str, object]): The additional properties - for the model. + default_auto_renewal_profile_id (int): The default auto-renewal profile ID + for the customer + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "email": 'email', - "cc_emails": 'cc_emails', - "organization": 'organization', - "reference": 'reference', - "id": 'id', - "created_at": 'created_at', - "updated_at": 'updated_at', - "address": 'address', - "address_2": 'address_2', - "city": 'city', - "state": 'state', - "state_name": 'state_name', - "zip": 'zip', - "country": 'country', - "country_name": 'country_name', - "phone": 'phone', - "verified": 'verified', - "portal_customer_created_at": 'portal_customer_created_at', - "portal_invite_last_sent_at": 'portal_invite_last_sent_at', - "portal_invite_last_accepted_at": 'portal_invite_last_accepted_at', - "tax_exempt": 'tax_exempt', - "vat_number": 'vat_number', - "parent_id": 'parent_id', - "locale": 'locale', - "default_subscription_group_uid": 'default_subscription_group_uid', - "salesforce_id": 'salesforce_id', - "tax_exempt_reason": 'tax_exempt_reason', - "default_auto_renewal_profile_id": 'default_auto_renewal_profile_id' + "first_name": "first_name", + "last_name": "last_name", + "email": "email", + "cc_emails": "cc_emails", + "organization": "organization", + "reference": "reference", + "id": "id", + "created_at": "created_at", + "updated_at": "updated_at", + "address": "address", + "address_2": "address_2", + "city": "city", + "state": "state", + "state_name": "state_name", + "zip": "zip", + "country": "country", + "country_name": "country_name", + "phone": "phone", + "verified": "verified", + "portal_customer_created_at": "portal_customer_created_at", + "portal_invite_last_sent_at": "portal_invite_last_sent_at", + "portal_invite_last_accepted_at": "portal_invite_last_accepted_at", + "tax_exempt": "tax_exempt", + "vat_number": "vat_number", + "parent_id": "parent_id", + "locale": "locale", + "default_subscription_group_uid": "default_subscription_group_uid", + "salesforce_id": "salesforce_id", + "tax_exempt_reason": "tax_exempt_reason", + "default_auto_renewal_profile_id": "default_auto_renewal_profile_id", } _optionals = [ - 'first_name', - 'last_name', - 'email', - 'cc_emails', - 'organization', - 'reference', - 'id', - 'created_at', - 'updated_at', - 'address', - 'address_2', - 'city', - 'state', - 'state_name', - 'zip', - 'country', - 'country_name', - 'phone', - 'verified', - 'portal_customer_created_at', - 'portal_invite_last_sent_at', - 'portal_invite_last_accepted_at', - 'tax_exempt', - 'vat_number', - 'parent_id', - 'locale', - 'default_subscription_group_uid', - 'salesforce_id', - 'tax_exempt_reason', - 'default_auto_renewal_profile_id', + "first_name", + "last_name", + "email", + "cc_emails", + "organization", + "reference", + "id", + "created_at", + "updated_at", + "address", + "address_2", + "city", + "state", + "state_name", + "zip", + "country", + "country_name", + "phone", + "verified", + "portal_customer_created_at", + "portal_invite_last_sent_at", + "portal_invite_last_accepted_at", + "tax_exempt", + "vat_number", + "parent_id", + "locale", + "default_subscription_group_uid", + "salesforce_id", + "tax_exempt_reason", + "default_auto_renewal_profile_id", ] _nullables = [ - 'cc_emails', - 'organization', - 'reference', - 'address', - 'address_2', - 'city', - 'state', - 'state_name', - 'zip', - 'country', - 'country_name', - 'phone', - 'verified', - 'portal_customer_created_at', - 'portal_invite_last_sent_at', - 'portal_invite_last_accepted_at', - 'vat_number', - 'parent_id', - 'locale', - 'default_subscription_group_uid', - 'salesforce_id', - 'tax_exempt_reason', - 'default_auto_renewal_profile_id', + "cc_emails", + "organization", + "reference", + "address", + "address_2", + "city", + "state", + "state_name", + "zip", + "country", + "country_name", + "phone", + "verified", + "portal_customer_created_at", + "portal_invite_last_sent_at", + "portal_invite_last_accepted_at", + "vat_number", + "parent_id", + "locale", + "default_subscription_group_uid", + "salesforce_id", + "tax_exempt_reason", + "default_auto_renewal_profile_id", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - email=APIHelper.SKIP, - cc_emails=APIHelper.SKIP, - organization=APIHelper.SKIP, - reference=APIHelper.SKIP, - id=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - address=APIHelper.SKIP, - address_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - state_name=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - country_name=APIHelper.SKIP, - phone=APIHelper.SKIP, - verified=APIHelper.SKIP, - portal_customer_created_at=APIHelper.SKIP, - portal_invite_last_sent_at=APIHelper.SKIP, - portal_invite_last_accepted_at=APIHelper.SKIP, - tax_exempt=APIHelper.SKIP, - vat_number=APIHelper.SKIP, - parent_id=APIHelper.SKIP, - locale=APIHelper.SKIP, - default_subscription_group_uid=APIHelper.SKIP, - salesforce_id=APIHelper.SKIP, - tax_exempt_reason=APIHelper.SKIP, - default_auto_renewal_profile_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Customer class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + email=APIHelper.SKIP, + cc_emails=APIHelper.SKIP, + organization=APIHelper.SKIP, + reference=APIHelper.SKIP, + id=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + address=APIHelper.SKIP, + address_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + state_name=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + country_name=APIHelper.SKIP, + phone=APIHelper.SKIP, + verified=APIHelper.SKIP, + portal_customer_created_at=APIHelper.SKIP, + portal_invite_last_sent_at=APIHelper.SKIP, + portal_invite_last_accepted_at=APIHelper.SKIP, + tax_exempt=APIHelper.SKIP, + vat_number=APIHelper.SKIP, + parent_id=APIHelper.SKIP, + locale=APIHelper.SKIP, + default_subscription_group_uid=APIHelper.SKIP, + salesforce_id=APIHelper.SKIP, + tax_exempt_reason=APIHelper.SKIP, + default_auto_renewal_profile_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a Customer instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if email is not APIHelper.SKIP: - self.email = email + self.email = email if cc_emails is not APIHelper.SKIP: - self.cc_emails = cc_emails + self.cc_emails = cc_emails if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if id is not APIHelper.SKIP: - self.id = id + self.id = id if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if address is not APIHelper.SKIP: - self.address = address + self.address = address if address_2 is not APIHelper.SKIP: - self.address_2 = address_2 + self.address_2 = address_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if state_name is not APIHelper.SKIP: - self.state_name = state_name + self.state_name = state_name if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country if country_name is not APIHelper.SKIP: - self.country_name = country_name + self.country_name = country_name if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone if verified is not APIHelper.SKIP: - self.verified = verified + self.verified = verified if portal_customer_created_at is not APIHelper.SKIP: - self.portal_customer_created_at = APIHelper.apply_datetime_converter(portal_customer_created_at, APIHelper.RFC3339DateTime) if portal_customer_created_at else None + self.portal_customer_created_at =\ + APIHelper.apply_datetime_converter( + portal_customer_created_at, APIHelper.RFC3339DateTime)\ + if portal_customer_created_at else None if portal_invite_last_sent_at is not APIHelper.SKIP: - self.portal_invite_last_sent_at = APIHelper.apply_datetime_converter(portal_invite_last_sent_at, APIHelper.RFC3339DateTime) if portal_invite_last_sent_at else None + self.portal_invite_last_sent_at =\ + APIHelper.apply_datetime_converter( + portal_invite_last_sent_at, APIHelper.RFC3339DateTime)\ + if portal_invite_last_sent_at else None if portal_invite_last_accepted_at is not APIHelper.SKIP: - self.portal_invite_last_accepted_at = APIHelper.apply_datetime_converter(portal_invite_last_accepted_at, APIHelper.RFC3339DateTime) if portal_invite_last_accepted_at else None + self.portal_invite_last_accepted_at =\ + APIHelper.apply_datetime_converter( + portal_invite_last_accepted_at, APIHelper.RFC3339DateTime)\ + if portal_invite_last_accepted_at else None if tax_exempt is not APIHelper.SKIP: - self.tax_exempt = tax_exempt + self.tax_exempt = tax_exempt if vat_number is not APIHelper.SKIP: - self.vat_number = vat_number + self.vat_number = vat_number if parent_id is not APIHelper.SKIP: - self.parent_id = parent_id + self.parent_id = parent_id if locale is not APIHelper.SKIP: - self.locale = locale + self.locale = locale if default_subscription_group_uid is not APIHelper.SKIP: - self.default_subscription_group_uid = default_subscription_group_uid + self.default_subscription_group_uid = default_subscription_group_uid if salesforce_id is not APIHelper.SKIP: - self.salesforce_id = salesforce_id + self.salesforce_id = salesforce_id if tax_exempt_reason is not APIHelper.SKIP: - self.tax_exempt_reason = tax_exempt_reason + self.tax_exempt_reason = tax_exempt_reason if default_auto_renewal_profile_id is not APIHelper.SKIP: - self.default_auto_renewal_profile_id = default_auto_renewal_profile_id + self.default_auto_renewal_profile_id = default_auto_renewal_profile_id # Add additional model properties to the instance if additional_properties is None: @@ -267,7 +276,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -278,52 +287,142 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP - cc_emails = dictionary.get("cc_emails") if "cc_emails" in dictionary.keys() else APIHelper.SKIP - organization = dictionary.get("organization") if "organization" in dictionary.keys() else APIHelper.SKIP - reference = dictionary.get("reference") if "reference" in dictionary.keys() else APIHelper.SKIP - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - address = dictionary.get("address") if "address" in dictionary.keys() else APIHelper.SKIP - address_2 = dictionary.get("address_2") if "address_2" in dictionary.keys() else APIHelper.SKIP - city = dictionary.get("city") if "city" in dictionary.keys() else APIHelper.SKIP - state = dictionary.get("state") if "state" in dictionary.keys() else APIHelper.SKIP - state_name = dictionary.get("state_name") if "state_name" in dictionary.keys() else APIHelper.SKIP - zip = dictionary.get("zip") if "zip" in dictionary.keys() else APIHelper.SKIP - country = dictionary.get("country") if "country" in dictionary.keys() else APIHelper.SKIP - country_name = dictionary.get("country_name") if "country_name" in dictionary.keys() else APIHelper.SKIP - phone = dictionary.get("phone") if "phone" in dictionary.keys() else APIHelper.SKIP - verified = dictionary.get("verified") if "verified" in dictionary.keys() else APIHelper.SKIP - if 'portal_customer_created_at' in dictionary.keys(): - portal_customer_created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("portal_customer_created_at")).datetime if dictionary.get("portal_customer_created_at") else None + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + cc_emails =\ + dictionary.get("cc_emails")\ + if "cc_emails" in dictionary.keys()\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if "organization" in dictionary.keys()\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if "reference" in dictionary.keys()\ + else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + address =\ + dictionary.get("address")\ + if "address" in dictionary.keys()\ + else APIHelper.SKIP + address_2 =\ + dictionary.get("address_2")\ + if "address_2" in dictionary.keys()\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if "city" in dictionary.keys()\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if "state" in dictionary.keys()\ + else APIHelper.SKIP + state_name =\ + dictionary.get("state_name")\ + if "state_name" in dictionary.keys()\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if "zip" in dictionary.keys()\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if "country" in dictionary.keys()\ + else APIHelper.SKIP + country_name =\ + dictionary.get("country_name")\ + if "country_name" in dictionary.keys()\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if "phone" in dictionary.keys()\ + else APIHelper.SKIP + verified =\ + dictionary.get("verified")\ + if "verified" in dictionary.keys()\ + else APIHelper.SKIP + if "portal_customer_created_at" in dictionary.keys(): + portal_customer_created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("portal_customer_created_at")).datetime\ + if dictionary.get("portal_customer_created_at") else None + else: portal_customer_created_at = APIHelper.SKIP - if 'portal_invite_last_sent_at' in dictionary.keys(): - portal_invite_last_sent_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("portal_invite_last_sent_at")).datetime if dictionary.get("portal_invite_last_sent_at") else None + if "portal_invite_last_sent_at" in dictionary.keys(): + portal_invite_last_sent_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("portal_invite_last_sent_at")).datetime\ + if dictionary.get("portal_invite_last_sent_at") else None + else: portal_invite_last_sent_at = APIHelper.SKIP - if 'portal_invite_last_accepted_at' in dictionary.keys(): - portal_invite_last_accepted_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("portal_invite_last_accepted_at")).datetime if dictionary.get("portal_invite_last_accepted_at") else None + if "portal_invite_last_accepted_at" in dictionary.keys(): + portal_invite_last_accepted_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("portal_invite_last_accepted_at")).datetime\ + if dictionary.get("portal_invite_last_accepted_at") else None + else: portal_invite_last_accepted_at = APIHelper.SKIP - tax_exempt = dictionary.get("tax_exempt") if "tax_exempt" in dictionary.keys() else APIHelper.SKIP - vat_number = dictionary.get("vat_number") if "vat_number" in dictionary.keys() else APIHelper.SKIP - parent_id = dictionary.get("parent_id") if "parent_id" in dictionary.keys() else APIHelper.SKIP - locale = dictionary.get("locale") if "locale" in dictionary.keys() else APIHelper.SKIP - default_subscription_group_uid = dictionary.get("default_subscription_group_uid") if "default_subscription_group_uid" in dictionary.keys() else APIHelper.SKIP - salesforce_id = dictionary.get("salesforce_id") if "salesforce_id" in dictionary.keys() else APIHelper.SKIP - tax_exempt_reason = dictionary.get("tax_exempt_reason") if "tax_exempt_reason" in dictionary.keys() else APIHelper.SKIP - default_auto_renewal_profile_id = dictionary.get("default_auto_renewal_profile_id") if "default_auto_renewal_profile_id" in dictionary.keys() else APIHelper.SKIP + tax_exempt =\ + dictionary.get("tax_exempt")\ + if "tax_exempt" in dictionary.keys()\ + else APIHelper.SKIP + vat_number =\ + dictionary.get("vat_number")\ + if "vat_number" in dictionary.keys()\ + else APIHelper.SKIP + parent_id =\ + dictionary.get("parent_id")\ + if "parent_id" in dictionary.keys()\ + else APIHelper.SKIP + locale =\ + dictionary.get("locale")\ + if "locale" in dictionary.keys()\ + else APIHelper.SKIP + default_subscription_group_uid =\ + dictionary.get("default_subscription_group_uid")\ + if "default_subscription_group_uid" in dictionary.keys()\ + else APIHelper.SKIP + salesforce_id =\ + dictionary.get("salesforce_id")\ + if "salesforce_id" in dictionary.keys()\ + else APIHelper.SKIP + tax_exempt_reason =\ + dictionary.get("tax_exempt_reason")\ + if "tax_exempt_reason" in dictionary.keys()\ + else APIHelper.SKIP + default_auto_renewal_profile_id =\ + dictionary.get("default_auto_renewal_profile_id")\ + if "default_auto_renewal_profile_id" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -359,7 +458,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -370,7 +469,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -380,69 +478,379 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'state_name={(self.state_name if hasattr(self, "state_name") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'country_name={(self.country_name if hasattr(self, "country_name") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!r}, ' - f'portal_customer_created_at={(self.portal_customer_created_at if hasattr(self, "portal_customer_created_at") else None)!r}, ' - f'portal_invite_last_sent_at={(self.portal_invite_last_sent_at if hasattr(self, "portal_invite_last_sent_at") else None)!r}, ' - f'portal_invite_last_accepted_at={(self.portal_invite_last_accepted_at if hasattr(self, "portal_invite_last_accepted_at") else None)!r}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!r}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!r}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!r}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' - f'default_subscription_group_uid={(self.default_subscription_group_uid if hasattr(self, "default_subscription_group_uid") else None)!r}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!r}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!r}, ' - f'default_auto_renewal_profile_id={(self.default_auto_renewal_profile_id if hasattr(self, "default_auto_renewal_profile_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _state_name=( + self.state_name + if hasattr(self, "state_name") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _country_name=( + self.country_name + if hasattr(self, "country_name") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _portal_customer_created_at=( + self.portal_customer_created_at + if hasattr(self, "portal_customer_created_at") + else None + ) + _portal_invite_last_sent_at=( + self.portal_invite_last_sent_at + if hasattr(self, "portal_invite_last_sent_at") + else None + ) + _portal_invite_last_accepted_at=( + self.portal_invite_last_accepted_at + if hasattr(self, "portal_invite_last_accepted_at") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _default_subscription_group_uid=( + self.default_subscription_group_uid + if hasattr(self, "default_subscription_group_uid") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _default_auto_renewal_profile_id=( + self.default_auto_renewal_profile_id + if hasattr(self, "default_auto_renewal_profile_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"email={_email!r}, " + f"cc_emails={_cc_emails!r}, " + f"organization={_organization!r}, " + f"reference={_reference!r}, " + f"id={_id!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"address={_address!r}, " + f"address_2={_address_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"state_name={_state_name!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"country_name={_country_name!r}, " + f"phone={_phone!r}, " + f"verified={_verified!r}, " + f"portal_customer_created_at={_portal_customer_created_at!r}, " + f"portal_invite_last_sent_at={_portal_invite_last_sent_at!r}, " + f"portal_invite_last_accepted_at={_portal_invite_last_accepted_at!r}, " + f"tax_exempt={_tax_exempt!r}, " + f"vat_number={_vat_number!r}, " + f"parent_id={_parent_id!r}, " + f"locale={_locale!r}, " + f"default_subscription_group_uid={_default_subscription_group_uid!r}, " + f"salesforce_id={_salesforce_id!r}, " + f"tax_exempt_reason={_tax_exempt_reason!r}, " + f"default_auto_renewal_profile_id={_default_auto_renewal_profile_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'state_name={(self.state_name if hasattr(self, "state_name") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'country_name={(self.country_name if hasattr(self, "country_name") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!s}, ' - f'portal_customer_created_at={(self.portal_customer_created_at if hasattr(self, "portal_customer_created_at") else None)!s}, ' - f'portal_invite_last_sent_at={(self.portal_invite_last_sent_at if hasattr(self, "portal_invite_last_sent_at") else None)!s}, ' - f'portal_invite_last_accepted_at={(self.portal_invite_last_accepted_at if hasattr(self, "portal_invite_last_accepted_at") else None)!s}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!s}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!s}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!s}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' - f'default_subscription_group_uid={(self.default_subscription_group_uid if hasattr(self, "default_subscription_group_uid") else None)!s}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!s}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!s}, ' - f'default_auto_renewal_profile_id={(self.default_auto_renewal_profile_id if hasattr(self, "default_auto_renewal_profile_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _state_name=( + self.state_name + if hasattr(self, "state_name") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _country_name=( + self.country_name + if hasattr(self, "country_name") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _portal_customer_created_at=( + self.portal_customer_created_at + if hasattr(self, "portal_customer_created_at") + else None + ) + _portal_invite_last_sent_at=( + self.portal_invite_last_sent_at + if hasattr(self, "portal_invite_last_sent_at") + else None + ) + _portal_invite_last_accepted_at=( + self.portal_invite_last_accepted_at + if hasattr(self, "portal_invite_last_accepted_at") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _default_subscription_group_uid=( + self.default_subscription_group_uid + if hasattr(self, "default_subscription_group_uid") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _default_auto_renewal_profile_id=( + self.default_auto_renewal_profile_id + if hasattr(self, "default_auto_renewal_profile_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"email={_email!s}, " + f"cc_emails={_cc_emails!s}, " + f"organization={_organization!s}, " + f"reference={_reference!s}, " + f"id={_id!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"address={_address!s}, " + f"address_2={_address_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"state_name={_state_name!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"country_name={_country_name!s}, " + f"phone={_phone!s}, " + f"verified={_verified!s}, " + f"portal_customer_created_at={_portal_customer_created_at!s}, " + f"portal_invite_last_sent_at={_portal_invite_last_sent_at!s}, " + f"portal_invite_last_accepted_at={_portal_invite_last_accepted_at!s}, " + f"tax_exempt={_tax_exempt!s}, " + f"vat_number={_vat_number!s}, " + f"parent_id={_parent_id!s}, " + f"locale={_locale!s}, " + f"default_subscription_group_uid={_default_subscription_group_uid!s}, " + f"salesforce_id={_salesforce_id!s}, " + f"tax_exempt_reason={_tax_exempt_reason!s}, " + f"default_auto_renewal_profile_id={_default_auto_renewal_profile_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer_attributes.py b/advancedbilling/models/customer_attributes.py index 8edbc948..aa1679fc 100644 --- a/advancedbilling/models/customer_attributes.py +++ b/advancedbilling/models/customer_attributes.py @@ -1,191 +1,184 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CustomerAttributes(object): - """Implementation of the 'Customer Attributes' model. Attributes: - first_name (str): The first name of the customer. Required when - creating a customer via attributes. - last_name (str): The last name of the customer. Required when creating - a customer via attributes. - email (str): The email address of the customer. Required when creating - a customer via attributes. + first_name (str): The first name of the customer. Required when creating a + customer via attributes. + last_name (str): The last name of the customer. Required when creating a + customer via attributes. + email (str): The email address of the customer. Required when creating a + customer via attributes. cc_emails (str): A list of emails that should be cc’d on all customer communications. Optional. organization (str): The organization/company of the customer. Optional. - reference (str): A customer “reference”, or unique identifier from - your app, stored in Chargify. Can be used so that you may - reference your customer’s within Chargify using the same unique - value you use in your application. Optional. - address (str): (Optional) The customer’s shipping street address (i.e. - “123 Main St.”). - address_2 (str): (Optional) Second line of the customer’s shipping - address i.e. “Apt. 100” - city (str): (Optional) The customer’s shipping address city (i.e. - “Boston”). - state (str): (Optional) The customer’s shipping address state (i.e. - “MA”). This must conform to the - [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes - ) in order to be valid for tax locale purposes. - zip (str): (Optional) The customer’s shipping address zip code (i.e. - “12345”). - country (str): (Optional) The customer shipping address country, - required in [ISO_3166-1 - alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format - (i.e. “US”). + reference (str): A customer “reference”, or unique identifier from your app, + stored in Chargify. Can be used so that you may reference your customer’s + within Chargify using the same unique value you use in your application. + Optional. + address (str): (Optional) The customer’s shipping street address (i.e. “123 + Main St.”). + address_2 (str): (Optional) Second line of the customer’s shipping address + i.e. “Apt. 100” + city (str): (Optional) The customer’s shipping address city (i.e. “Boston”). + state (str): (Optional) The customer’s shipping address state (i.e. “MA”). + This must conform to the + [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in + order to be valid for tax locale purposes. + zip (str): (Optional) The customer’s shipping address zip code (i.e. “12345”). + country (str): (Optional) The customer shipping address country, required in + [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + format (i.e. “US”). phone (str): (Optional) The phone number of the customer. verified (bool): The model property of type bool. tax_exempt (bool): (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. - vat_number (str): (Optional) Supplying the VAT number allows EU - customer’s to opt-out of the Value Added Tax assuming the merchant - address and customer billing address are not within the same EU - country. It’s important to omit the country code from the VAT - number upon entry. Otherwise, taxes will be assessed upon the - purchase. - metafields (Dict[str, str]): (Optional) A set of key/value pairs - representing custom fields and their values. Metafields will be - created “on-the-fly” in your site for a given key, if they have - not been created yet. - parent_id (int): The parent ID in Chargify if applicable. Parent is - another Customer object. + vat_number (str): (Optional) Supplying the VAT number allows EU customer’s to + opt-out of the Value Added Tax assuming the merchant address and customer + billing address are not within the same EU country. It’s important to + omit the country code from the VAT number upon entry. Otherwise, taxes + will be assessed upon the purchase. + metafields (Dict[str, str]): (Optional) A set of key/value pairs representing + custom fields and their values. Metafields will be created “on-the-fly” + in your site for a given key, if they have not been created yet. + parent_id (int): The parent ID in Chargify if applicable. Parent is another + Customer object. salesforce_id (str): (Optional) The Salesforce ID of the customer. - default_auto_renewal_profile_id (int): (Optional) The default - auto-renewal profile ID for the customer - additional_properties (Dict[str, object]): The additional properties - for the model. + default_auto_renewal_profile_id (int): (Optional) The default auto-renewal + profile ID for the customer + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "email": 'email', - "cc_emails": 'cc_emails', - "organization": 'organization', - "reference": 'reference', - "address": 'address', - "address_2": 'address_2', - "city": 'city', - "state": 'state', - "zip": 'zip', - "country": 'country', - "phone": 'phone', - "verified": 'verified', - "tax_exempt": 'tax_exempt', - "vat_number": 'vat_number', - "metafields": 'metafields', - "parent_id": 'parent_id', - "salesforce_id": 'salesforce_id', - "default_auto_renewal_profile_id": 'default_auto_renewal_profile_id' + "first_name": "first_name", + "last_name": "last_name", + "email": "email", + "cc_emails": "cc_emails", + "organization": "organization", + "reference": "reference", + "address": "address", + "address_2": "address_2", + "city": "city", + "state": "state", + "zip": "zip", + "country": "country", + "phone": "phone", + "verified": "verified", + "tax_exempt": "tax_exempt", + "vat_number": "vat_number", + "metafields": "metafields", + "parent_id": "parent_id", + "salesforce_id": "salesforce_id", + "default_auto_renewal_profile_id": "default_auto_renewal_profile_id", } _optionals = [ - 'first_name', - 'last_name', - 'email', - 'cc_emails', - 'organization', - 'reference', - 'address', - 'address_2', - 'city', - 'state', - 'zip', - 'country', - 'phone', - 'verified', - 'tax_exempt', - 'vat_number', - 'metafields', - 'parent_id', - 'salesforce_id', - 'default_auto_renewal_profile_id', + "first_name", + "last_name", + "email", + "cc_emails", + "organization", + "reference", + "address", + "address_2", + "city", + "state", + "zip", + "country", + "phone", + "verified", + "tax_exempt", + "vat_number", + "metafields", + "parent_id", + "salesforce_id", + "default_auto_renewal_profile_id", ] _nullables = [ - 'address_2', - 'parent_id', - 'salesforce_id', - 'default_auto_renewal_profile_id', + "address_2", + "parent_id", + "salesforce_id", + "default_auto_renewal_profile_id", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - email=APIHelper.SKIP, - cc_emails=APIHelper.SKIP, - organization=APIHelper.SKIP, - reference=APIHelper.SKIP, - address=APIHelper.SKIP, - address_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - phone=APIHelper.SKIP, - verified=APIHelper.SKIP, - tax_exempt=APIHelper.SKIP, - vat_number=APIHelper.SKIP, - metafields=APIHelper.SKIP, - parent_id=APIHelper.SKIP, - salesforce_id=APIHelper.SKIP, - default_auto_renewal_profile_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CustomerAttributes class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + email=APIHelper.SKIP, + cc_emails=APIHelper.SKIP, + organization=APIHelper.SKIP, + reference=APIHelper.SKIP, + address=APIHelper.SKIP, + address_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + phone=APIHelper.SKIP, + verified=APIHelper.SKIP, + tax_exempt=APIHelper.SKIP, + vat_number=APIHelper.SKIP, + metafields=APIHelper.SKIP, + parent_id=APIHelper.SKIP, + salesforce_id=APIHelper.SKIP, + default_auto_renewal_profile_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a CustomerAttributes instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if email is not APIHelper.SKIP: - self.email = email + self.email = email if cc_emails is not APIHelper.SKIP: - self.cc_emails = cc_emails + self.cc_emails = cc_emails if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if address is not APIHelper.SKIP: - self.address = address + self.address = address if address_2 is not APIHelper.SKIP: - self.address_2 = address_2 + self.address_2 = address_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone if verified is not APIHelper.SKIP: - self.verified = verified + self.verified = verified if tax_exempt is not APIHelper.SKIP: - self.tax_exempt = tax_exempt + self.tax_exempt = tax_exempt if vat_number is not APIHelper.SKIP: - self.vat_number = vat_number + self.vat_number = vat_number if metafields is not APIHelper.SKIP: - self.metafields = metafields + self.metafields = metafields if parent_id is not APIHelper.SKIP: - self.parent_id = parent_id + self.parent_id = parent_id if salesforce_id is not APIHelper.SKIP: - self.salesforce_id = salesforce_id + self.salesforce_id = salesforce_id if default_auto_renewal_profile_id is not APIHelper.SKIP: - self.default_auto_renewal_profile_id = default_auto_renewal_profile_id + self.default_auto_renewal_profile_id = default_auto_renewal_profile_id # Add additional model properties to the instance if additional_properties is None: @@ -195,7 +188,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -206,33 +199,95 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP - cc_emails = dictionary.get("cc_emails") if dictionary.get("cc_emails") else APIHelper.SKIP - organization = dictionary.get("organization") if dictionary.get("organization") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP - address = dictionary.get("address") if dictionary.get("address") else APIHelper.SKIP - address_2 = dictionary.get("address_2") if "address_2" in dictionary.keys() else APIHelper.SKIP - city = dictionary.get("city") if dictionary.get("city") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - zip = dictionary.get("zip") if dictionary.get("zip") else APIHelper.SKIP - country = dictionary.get("country") if dictionary.get("country") else APIHelper.SKIP - phone = dictionary.get("phone") if dictionary.get("phone") else APIHelper.SKIP - verified = dictionary.get("verified") if "verified" in dictionary.keys() else APIHelper.SKIP - tax_exempt = dictionary.get("tax_exempt") if "tax_exempt" in dictionary.keys() else APIHelper.SKIP - vat_number = dictionary.get("vat_number") if dictionary.get("vat_number") else APIHelper.SKIP - metafields = dictionary.get("metafields") if dictionary.get("metafields") else APIHelper.SKIP - parent_id = dictionary.get("parent_id") if "parent_id" in dictionary.keys() else APIHelper.SKIP - salesforce_id = dictionary.get("salesforce_id") if "salesforce_id" in dictionary.keys() else APIHelper.SKIP - default_auto_renewal_profile_id = dictionary.get("default_auto_renewal_profile_id") if "default_auto_renewal_profile_id" in dictionary.keys() else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + cc_emails =\ + dictionary.get("cc_emails")\ + if dictionary.get("cc_emails")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if dictionary.get("organization")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + address =\ + dictionary.get("address")\ + if dictionary.get("address")\ + else APIHelper.SKIP + address_2 =\ + dictionary.get("address_2")\ + if "address_2" in dictionary.keys()\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if dictionary.get("city")\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if dictionary.get("zip")\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if dictionary.get("country")\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if dictionary.get("phone")\ + else APIHelper.SKIP + verified =\ + dictionary.get("verified")\ + if "verified" in dictionary.keys()\ + else APIHelper.SKIP + tax_exempt =\ + dictionary.get("tax_exempt")\ + if "tax_exempt" in dictionary.keys()\ + else APIHelper.SKIP + vat_number =\ + dictionary.get("vat_number")\ + if dictionary.get("vat_number")\ + else APIHelper.SKIP + metafields =\ + dictionary.get("metafields")\ + if dictionary.get("metafields")\ + else APIHelper.SKIP + parent_id =\ + dictionary.get("parent_id")\ + if "parent_id" in dictionary.keys()\ + else APIHelper.SKIP + salesforce_id =\ + dictionary.get("salesforce_id")\ + if "salesforce_id" in dictionary.keys()\ + else APIHelper.SKIP + default_auto_renewal_profile_id =\ + dictionary.get("default_auto_renewal_profile_id")\ + if "default_auto_renewal_profile_id" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -258,7 +313,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -269,7 +324,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -279,49 +333,259 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!r}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!r}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!r}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!r}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!r}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!r}, ' - f'default_auto_renewal_profile_id={(self.default_auto_renewal_profile_id if hasattr(self, "default_auto_renewal_profile_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _default_auto_renewal_profile_id=( + self.default_auto_renewal_profile_id + if hasattr(self, "default_auto_renewal_profile_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"email={_email!r}, " + f"cc_emails={_cc_emails!r}, " + f"organization={_organization!r}, " + f"reference={_reference!r}, " + f"address={_address!r}, " + f"address_2={_address_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"phone={_phone!r}, " + f"verified={_verified!r}, " + f"tax_exempt={_tax_exempt!r}, " + f"vat_number={_vat_number!r}, " + f"metafields={_metafields!r}, " + f"parent_id={_parent_id!r}, " + f"salesforce_id={_salesforce_id!r}, " + f"default_auto_renewal_profile_id={_default_auto_renewal_profile_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!s}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!s}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!s}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!s}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!s}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!s}, ' - f'default_auto_renewal_profile_id={(self.default_auto_renewal_profile_id if hasattr(self, "default_auto_renewal_profile_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _default_auto_renewal_profile_id=( + self.default_auto_renewal_profile_id + if hasattr(self, "default_auto_renewal_profile_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"email={_email!s}, " + f"cc_emails={_cc_emails!s}, " + f"organization={_organization!s}, " + f"reference={_reference!s}, " + f"address={_address!s}, " + f"address_2={_address_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"phone={_phone!s}, " + f"verified={_verified!s}, " + f"tax_exempt={_tax_exempt!s}, " + f"vat_number={_vat_number!s}, " + f"metafields={_metafields!s}, " + f"parent_id={_parent_id!s}, " + f"salesforce_id={_salesforce_id!s}, " + f"default_auto_renewal_profile_id={_default_auto_renewal_profile_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer_change.py b/advancedbilling/models/customer_change.py index ab6da423..202963bd 100644 --- a/advancedbilling/models/customer_change.py +++ b/advancedbilling/models/customer_change.py @@ -1,74 +1,75 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.address_change import AddressChange -from advancedbilling.models.customer_custom_fields_change import CustomerCustomFieldsChange -from advancedbilling.models.customer_payer_change import CustomerPayerChange +from advancedbilling.models.address_change import ( + AddressChange, +) +from advancedbilling.models.customer_custom_fields_change import ( + CustomerCustomFieldsChange, +) +from advancedbilling.models.customer_payer_change import ( + CustomerPayerChange, +) class CustomerChange(object): - """Implementation of the 'Customer Change' model. Attributes: - payer (CustomerPayerChange): The model property of type - CustomerPayerChange. - shipping_address (AddressChange): The model property of type - AddressChange. - billing_address (AddressChange): The model property of type - AddressChange. + payer (CustomerPayerChange): The model property of type CustomerPayerChange. + shipping_address (AddressChange): The model property of type AddressChange. + billing_address (AddressChange): The model property of type AddressChange. custom_fields (CustomerCustomFieldsChange): The model property of type CustomerCustomFieldsChange. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payer": 'payer', - "shipping_address": 'shipping_address', - "billing_address": 'billing_address', - "custom_fields": 'custom_fields' + "payer": "payer", + "shipping_address": "shipping_address", + "billing_address": "billing_address", + "custom_fields": "custom_fields", } _optionals = [ - 'payer', - 'shipping_address', - 'billing_address', - 'custom_fields', + "payer", + "shipping_address", + "billing_address", + "custom_fields", ] _nullables = [ - 'payer', - 'shipping_address', - 'billing_address', - 'custom_fields', + "payer", + "shipping_address", + "billing_address", + "custom_fields", ] - def __init__(self, - payer=APIHelper.SKIP, - shipping_address=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - custom_fields=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CustomerChange class""" - + def __init__( + self, + payer=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + custom_fields=APIHelper.SKIP, + additional_properties=None): + """Initialize a CustomerChange instance.""" # Initialize members of the class if payer is not APIHelper.SKIP: - self.payer = payer + self.payer = payer if shipping_address is not APIHelper.SKIP: - self.shipping_address = shipping_address + self.shipping_address = shipping_address if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if custom_fields is not APIHelper.SKIP: - self.custom_fields = custom_fields + self.custom_fields = custom_fields # Add additional model properties to the instance if additional_properties is None: @@ -78,7 +79,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -89,29 +90,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - if 'payer' in dictionary.keys(): - payer = CustomerPayerChange.from_dictionary(dictionary.get('payer')) if dictionary.get('payer') else None + if "payer" in dictionary.keys(): + payer =\ + CustomerPayerChange.from_dictionary( + dictionary.get("payer"))\ + if dictionary.get("payer") else None else: payer = APIHelper.SKIP - if 'shipping_address' in dictionary.keys(): - shipping_address = AddressChange.from_dictionary(dictionary.get('shipping_address')) if dictionary.get('shipping_address') else None + if "shipping_address" in dictionary.keys(): + shipping_address =\ + AddressChange.from_dictionary( + dictionary.get("shipping_address"))\ + if dictionary.get("shipping_address") else None else: shipping_address = APIHelper.SKIP - if 'billing_address' in dictionary.keys(): - billing_address = AddressChange.from_dictionary(dictionary.get('billing_address')) if dictionary.get('billing_address') else None + if "billing_address" in dictionary.keys(): + billing_address =\ + AddressChange.from_dictionary( + dictionary.get("billing_address"))\ + if dictionary.get("billing_address") else None else: billing_address = APIHelper.SKIP - if 'custom_fields' in dictionary.keys(): - custom_fields = CustomerCustomFieldsChange.from_dictionary(dictionary.get('custom_fields')) if dictionary.get('custom_fields') else None + if "custom_fields" in dictionary.keys(): + custom_fields =\ + CustomerCustomFieldsChange.from_dictionary( + dictionary.get("custom_fields"))\ + if dictionary.get("custom_fields") else None else: custom_fields = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payer, shipping_address, @@ -120,17 +135,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payer={(self.payer if hasattr(self, "payer") else None)!r}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'custom_fields={(self.custom_fields if hasattr(self, "custom_fields") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payer=( + self.payer + if hasattr(self, "payer") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _custom_fields=( + self.custom_fields + if hasattr(self, "custom_fields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payer={_payer!r}, " + f"shipping_address={_shipping_address!r}, " + f"billing_address={_billing_address!r}, " + f"custom_fields={_custom_fields!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payer={(self.payer if hasattr(self, "payer") else None)!s}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'custom_fields={(self.custom_fields if hasattr(self, "custom_fields") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payer=( + self.payer + if hasattr(self, "payer") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _custom_fields=( + self.custom_fields + if hasattr(self, "custom_fields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payer={_payer!s}, " + f"shipping_address={_shipping_address!s}, " + f"billing_address={_billing_address!s}, " + f"custom_fields={_custom_fields!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer_changes_preview_response.py b/advancedbilling/models/customer_changes_preview_response.py index 597f2794..5b7c8572 100644 --- a/advancedbilling/models/customer_changes_preview_response.py +++ b/advancedbilling/models/customer_changes_preview_response.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.customer_change import CustomerChange +# ruff: noqa: E501 +from advancedbilling.models.customer_change import ( + CustomerChange, +) -class CustomerChangesPreviewResponse(object): +class CustomerChangesPreviewResponse(object): """Implementation of the 'Customer Changes Preview Response' model. Attributes: changes (CustomerChange): The model property of type CustomerChange. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "changes": 'changes' + "changes": "changes", } - def __init__(self, - changes=None, - additional_properties=None): - """Constructor for the CustomerChangesPreviewResponse class""" - + def __init__( + self, + changes=None, + additional_properties=None): + """Initialize a CustomerChangesPreviewResponse instance.""" # Initialize members of the class - self.changes = changes + self.changes = changes # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - changes = CustomerChange.from_dictionary(dictionary.get('changes')) if dictionary.get('changes') else None + changes =\ + CustomerChange.from_dictionary( + dictionary.get("changes"))\ + if dictionary.get("changes") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(changes, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'changes={self.changes!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _changes=self.changes + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"changes={_changes!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'changes={self.changes!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _changes=self.changes + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"changes={_changes!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer_custom_fields_change.py b/advancedbilling/models/customer_custom_fields_change.py index 2ea18df9..e3d43846 100644 --- a/advancedbilling/models/customer_custom_fields_change.py +++ b/advancedbilling/models/customer_custom_fields_change.py @@ -1,16 +1,16 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.invoice_custom_field import InvoiceCustomField +# ruff: noqa: E501 +from advancedbilling.models.invoice_custom_field import ( + InvoiceCustomField, +) -class CustomerCustomFieldsChange(object): +class CustomerCustomFieldsChange(object): """Implementation of the 'Customer Custom Fields Change' model. Attributes: @@ -18,26 +18,26 @@ class CustomerCustomFieldsChange(object): List[InvoiceCustomField]. after (List[InvoiceCustomField]): The model property of type List[InvoiceCustomField]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "before": 'before', - "after": 'after' + "before": "before", + "after": "after", } - def __init__(self, - before=None, - after=None, - additional_properties=None): - """Constructor for the CustomerCustomFieldsChange class""" - + def __init__( + self, + before=None, + after=None, + additional_properties=None): + """Initialize a CustomerCustomFieldsChange instance.""" # Initialize members of the class - self.before = before - self.after = after + self.before = before + self.after = after # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,32 +58,54 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary before = None - if dictionary.get('before') is not None: - before = [InvoiceCustomField.from_dictionary(x) for x in dictionary.get('before')] + if dictionary.get("before") is not None: + before = [ + InvoiceCustomField.from_dictionary(x) + for x in dictionary.get("before") + ] after = None - if dictionary.get('after') is not None: - after = [InvoiceCustomField.from_dictionary(x) for x in dictionary.get('after')] + if dictionary.get("after") is not None: + after = [ + InvoiceCustomField.from_dictionary(x) + for x in dictionary.get("after") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(before, after, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'before={self.before!r}, ' - f'after={self.after!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _before=self.before + _after=self.after + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"before={_before!r}, " + f"after={_after!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'before={self.before!s}, ' - f'after={self.after!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _before=self.before + _after=self.after + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"before={_before!s}, " + f"after={_after!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer_error.py b/advancedbilling/models/customer_error.py index f084f6b3..ad787bbf 100644 --- a/advancedbilling/models/customer_error.py +++ b/advancedbilling/models/customer_error.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class CustomerError(object): - """Implementation of the 'Customer Error' model. Attributes: customer (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "customer": 'customer' + "customer": "customer", } _optionals = [ - 'customer', + "customer", ] - def __init__(self, - customer=APIHelper.SKIP, - additional_properties=None): - """Constructor for the CustomerError class""" - + def __init__( + self, + customer=APIHelper.SKIP, + additional_properties=None): + """Initialize a CustomerError instance.""" # Initialize members of the class if customer is not APIHelper.SKIP: - self.customer = customer + self.customer = customer # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,21 +55,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - customer = dictionary.get("customer") if dictionary.get("customer") else APIHelper.SKIP + customer =\ + dictionary.get("customer")\ + if dictionary.get("customer")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(customer, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -82,7 +85,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -92,11 +94,31 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer_payer_change.py b/advancedbilling/models/customer_payer_change.py index ffe66e04..94147aa3 100644 --- a/advancedbilling/models/customer_payer_change.py +++ b/advancedbilling/models/customer_payer_change.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.invoice_payer_change import InvoicePayerChange +# ruff: noqa: E501 +from advancedbilling.models.invoice_payer_change import ( + InvoicePayerChange, +) -class CustomerPayerChange(object): +class CustomerPayerChange(object): """Implementation of the 'Customer Payer Change' model. Attributes: - before (InvoicePayerChange): The model property of type - InvoicePayerChange. - after (InvoicePayerChange): The model property of type - InvoicePayerChange. - additional_properties (Dict[str, object]): The additional properties - for the model. + before (InvoicePayerChange): The model property of type InvoicePayerChange. + after (InvoicePayerChange): The model property of type InvoicePayerChange. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "before": 'before', - "after": 'after' + "before": "before", + "after": "after", } - def __init__(self, - before=None, - after=None, - additional_properties=None): - """Constructor for the CustomerPayerChange class""" - + def __init__( + self, + before=None, + after=None, + additional_properties=None): + """Initialize a CustomerPayerChange instance.""" # Initialize members of the class - self.before = before - self.after = after + self.before = before + self.after = after # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,28 +56,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - before = InvoicePayerChange.from_dictionary(dictionary.get('before')) if dictionary.get('before') else None - after = InvoicePayerChange.from_dictionary(dictionary.get('after')) if dictionary.get('after') else None + before =\ + InvoicePayerChange.from_dictionary( + dictionary.get("before"))\ + if dictionary.get("before") else None + after =\ + InvoicePayerChange.from_dictionary( + dictionary.get("after"))\ + if dictionary.get("after") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(before, after, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'before={self.before!r}, ' - f'after={self.after!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _before=self.before + _after=self.after + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"before={_before!r}, " + f"after={_after!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'before={self.before!s}, ' - f'after={self.after!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _before=self.before + _after=self.after + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"before={_before!s}, " + f"after={_after!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/customer_response.py b/advancedbilling/models/customer_response.py index 15a73b8c..6d423065 100644 --- a/advancedbilling/models/customer_response.py +++ b/advancedbilling/models/customer_response.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.customer import Customer +# ruff: noqa: E501 +from advancedbilling.models.customer import ( + Customer, +) -class CustomerResponse(object): +class CustomerResponse(object): """Implementation of the 'Customer Response' model. Attributes: customer (Customer): The model property of type Customer. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "customer": 'customer' + "customer": "customer", } - def __init__(self, - customer=None, - additional_properties=None): - """Constructor for the CustomerResponse class""" - + def __init__( + self, + customer=None, + additional_properties=None): + """Initialize a CustomerResponse instance.""" # Initialize members of the class - self.customer = customer + self.customer = customer # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - customer = Customer.from_dictionary(dictionary.get('customer')) if dictionary.get('customer') else None + customer =\ + Customer.from_dictionary( + dictionary.get("customer"))\ + if dictionary.get("customer") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(customer, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'customer={self.customer!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'customer={self.customer!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/debit_note.py b/advancedbilling/models/debit_note.py index 9491ba75..6f10fdb2 100644 --- a/advancedbilling/models/debit_note.py +++ b/advancedbilling/models/debit_note.py @@ -1,25 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.credit_note_line_item import CreditNoteLineItem -from advancedbilling.models.invoice_address import InvoiceAddress -from advancedbilling.models.invoice_customer import InvoiceCustomer -from advancedbilling.models.invoice_discount import InvoiceDiscount -from advancedbilling.models.invoice_refund import InvoiceRefund -from advancedbilling.models.invoice_seller import InvoiceSeller -from advancedbilling.models.invoice_tax import InvoiceTax +from advancedbilling.models.credit_note_line_item import ( + CreditNoteLineItem, +) +from advancedbilling.models.invoice_address import ( + InvoiceAddress, +) +from advancedbilling.models.invoice_customer import ( + InvoiceCustomer, +) +from advancedbilling.models.invoice_discount import ( + InvoiceDiscount, +) +from advancedbilling.models.invoice_refund import ( + InvoiceRefund, +) +from advancedbilling.models.invoice_seller import ( + InvoiceSeller, +) +from advancedbilling.models.invoice_tax import ( + InvoiceTax, +) class DebitNote(object): - """Implementation of the 'Debit Note' model. Attributes: @@ -28,39 +40,37 @@ class DebitNote(object): alphanumeric characters. site_id (int): ID of the site to which the debit note belongs. customer_id (int): ID of the customer to which the debit note belongs. - subscription_id (int): ID of the subscription that generated the debit - note. - number (int): A unique, identifier that appears on the debit note and - in places it is referenced. - sequence_number (int): A monotonically increasing number assigned to - debit notes as they are created. - origin_credit_note_uid (str): Unique identifier for the connected - credit note. It is generated automatically by Chargify and has the - prefix "cn_" followed by alphanumeric characters. While the UID - is long and not appropriate to show to customers, the number is - usually shorter and consumable by the customer and the merchant - alike. + subscription_id (int): ID of the subscription that generated the debit note. + number (int): A unique, identifier that appears on the debit note and in + places it is referenced. + sequence_number (int): A monotonically increasing number assigned to debit + notes as they are created. + origin_credit_note_uid (str): Unique identifier for the connected credit + note. It is generated automatically by Chargify and has the prefix "cn_" + followed by alphanumeric characters. While the UID is long and not + appropriate to show to customers, the number is usually shorter and + consumable by the customer and the merchant alike. origin_credit_note_number (str): A unique, identifying string of the connected credit note. - issue_date (date): Date the document was issued to the customer. This - is the date that the document was made available for payment. The - format is "YYYY-MM-DD". - applied_date (date): Debit notes are applied to invoices to offset - invoiced amounts - they adjust the amount due. This field is the - date the debit note document became fully applied to the invoice. - The format is "YYYY-MM-DD". + issue_date (date): Date the document was issued to the customer. This is the + date that the document was made available for payment. The format is + "YYYY-MM-DD". + applied_date (date): Debit notes are applied to invoices to offset invoiced + amounts - they adjust the amount due. This field is the date the debit + note document became fully applied to the invoice. The format is + "YYYY-MM-DD". due_date (date): Date the document is due for payment. The format is "YYYY-MM-DD". status (DebitNoteStatus): Current status of the debit note. - memo (str): The memo printed on debit note, which is a description of - the reason for the debit. + memo (str): The memo printed on debit note, which is a description of the + reason for the debit. role (DebitNoteRole): The role of the debit note. - currency (str): The ISO 4217 currency code (3 character string) - representing the currency of the credit note amount fields. - seller (InvoiceSeller): Information about the seller (merchant) listed - on the masthead of the debit note. - customer (InvoiceCustomer): Information about the customer who is - owner or recipient the debited subscription. + currency (str): The ISO 4217 currency code (3 character string) representing + the currency of the credit note amount fields. + seller (InvoiceSeller): Information about the seller (merchant) listed on the + masthead of the debit note. + customer (InvoiceCustomer): Information about the customer who is owner or + recipient the debited subscription. billing_address (InvoiceAddress): The billing address of the debited subscription. shipping_address (InvoiceAddress): The shipping address of the debited @@ -69,140 +79,139 @@ class DebitNote(object): discounts (List[InvoiceDiscount]): The model property of type List[InvoiceDiscount]. taxes (List[InvoiceTax]): The model property of type List[InvoiceTax]. - refunds (List[InvoiceRefund]): The model property of type - List[InvoiceRefund]. - additional_properties (Dict[str, object]): The additional properties - for the model. + refunds (List[InvoiceRefund]): The model property of type List[InvoiceRefund]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "site_id": 'site_id', - "customer_id": 'customer_id', - "subscription_id": 'subscription_id', - "number": 'number', - "sequence_number": 'sequence_number', - "origin_credit_note_uid": 'origin_credit_note_uid', - "origin_credit_note_number": 'origin_credit_note_number', - "issue_date": 'issue_date', - "applied_date": 'applied_date', - "due_date": 'due_date', - "status": 'status', - "memo": 'memo', - "role": 'role', - "currency": 'currency', - "seller": 'seller', - "customer": 'customer', - "billing_address": 'billing_address', - "shipping_address": 'shipping_address', - "line_items": 'line_items', - "discounts": 'discounts', - "taxes": 'taxes', - "refunds": 'refunds' + "uid": "uid", + "site_id": "site_id", + "customer_id": "customer_id", + "subscription_id": "subscription_id", + "number": "number", + "sequence_number": "sequence_number", + "origin_credit_note_uid": "origin_credit_note_uid", + "origin_credit_note_number": "origin_credit_note_number", + "issue_date": "issue_date", + "applied_date": "applied_date", + "due_date": "due_date", + "status": "status", + "memo": "memo", + "role": "role", + "currency": "currency", + "seller": "seller", + "customer": "customer", + "billing_address": "billing_address", + "shipping_address": "shipping_address", + "line_items": "line_items", + "discounts": "discounts", + "taxes": "taxes", + "refunds": "refunds", } _optionals = [ - 'uid', - 'site_id', - 'customer_id', - 'subscription_id', - 'number', - 'sequence_number', - 'origin_credit_note_uid', - 'origin_credit_note_number', - 'issue_date', - 'applied_date', - 'due_date', - 'status', - 'memo', - 'role', - 'currency', - 'seller', - 'customer', - 'billing_address', - 'shipping_address', - 'line_items', - 'discounts', - 'taxes', - 'refunds', + "uid", + "site_id", + "customer_id", + "subscription_id", + "number", + "sequence_number", + "origin_credit_note_uid", + "origin_credit_note_number", + "issue_date", + "applied_date", + "due_date", + "status", + "memo", + "role", + "currency", + "seller", + "customer", + "billing_address", + "shipping_address", + "line_items", + "discounts", + "taxes", + "refunds", ] - def __init__(self, - uid=APIHelper.SKIP, - site_id=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - number=APIHelper.SKIP, - sequence_number=APIHelper.SKIP, - origin_credit_note_uid=APIHelper.SKIP, - origin_credit_note_number=APIHelper.SKIP, - issue_date=APIHelper.SKIP, - applied_date=APIHelper.SKIP, - due_date=APIHelper.SKIP, - status=APIHelper.SKIP, - memo=APIHelper.SKIP, - role=APIHelper.SKIP, - currency=APIHelper.SKIP, - seller=APIHelper.SKIP, - customer=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - shipping_address=APIHelper.SKIP, - line_items=APIHelper.SKIP, - discounts=APIHelper.SKIP, - taxes=APIHelper.SKIP, - refunds=APIHelper.SKIP, - additional_properties=None): - """Constructor for the DebitNote class""" - + def __init__( + self, + uid=APIHelper.SKIP, + site_id=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + number=APIHelper.SKIP, + sequence_number=APIHelper.SKIP, + origin_credit_note_uid=APIHelper.SKIP, + origin_credit_note_number=APIHelper.SKIP, + issue_date=APIHelper.SKIP, + applied_date=APIHelper.SKIP, + due_date=APIHelper.SKIP, + status=APIHelper.SKIP, + memo=APIHelper.SKIP, + role=APIHelper.SKIP, + currency=APIHelper.SKIP, + seller=APIHelper.SKIP, + customer=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + line_items=APIHelper.SKIP, + discounts=APIHelper.SKIP, + taxes=APIHelper.SKIP, + refunds=APIHelper.SKIP, + additional_properties=None): + """Initialize a DebitNote instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if number is not APIHelper.SKIP: - self.number = number + self.number = number if sequence_number is not APIHelper.SKIP: - self.sequence_number = sequence_number + self.sequence_number = sequence_number if origin_credit_note_uid is not APIHelper.SKIP: - self.origin_credit_note_uid = origin_credit_note_uid + self.origin_credit_note_uid = origin_credit_note_uid if origin_credit_note_number is not APIHelper.SKIP: - self.origin_credit_note_number = origin_credit_note_number + self.origin_credit_note_number = origin_credit_note_number if issue_date is not APIHelper.SKIP: - self.issue_date = issue_date + self.issue_date = issue_date if applied_date is not APIHelper.SKIP: - self.applied_date = applied_date + self.applied_date = applied_date if due_date is not APIHelper.SKIP: - self.due_date = due_date + self.due_date = due_date if status is not APIHelper.SKIP: - self.status = status + self.status = status if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if role is not APIHelper.SKIP: - self.role = role + self.role = role if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if seller is not APIHelper.SKIP: - self.seller = seller + self.seller = seller if customer is not APIHelper.SKIP: - self.customer = customer + self.customer = customer if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if shipping_address is not APIHelper.SKIP: - self.shipping_address = shipping_address + self.shipping_address = shipping_address if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if discounts is not APIHelper.SKIP: - self.discounts = discounts + self.discounts = discounts if taxes is not APIHelper.SKIP: - self.taxes = taxes + self.taxes = taxes if refunds is not APIHelper.SKIP: - self.refunds = refunds + self.refunds = refunds # Add additional model properties to the instance if additional_properties is None: @@ -212,7 +221,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -223,52 +232,124 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - number = dictionary.get("number") if dictionary.get("number") else APIHelper.SKIP - sequence_number = dictionary.get("sequence_number") if dictionary.get("sequence_number") else APIHelper.SKIP - origin_credit_note_uid = dictionary.get("origin_credit_note_uid") if dictionary.get("origin_credit_note_uid") else APIHelper.SKIP - origin_credit_note_number = dictionary.get("origin_credit_note_number") if dictionary.get("origin_credit_note_number") else APIHelper.SKIP - issue_date = dateutil.parser.parse(dictionary.get('issue_date')).date() if dictionary.get('issue_date') else APIHelper.SKIP - applied_date = dateutil.parser.parse(dictionary.get('applied_date')).date() if dictionary.get('applied_date') else APIHelper.SKIP - due_date = dateutil.parser.parse(dictionary.get('due_date')).date() if dictionary.get('due_date') else APIHelper.SKIP - status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - role = dictionary.get("role") if dictionary.get("role") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - seller = InvoiceSeller.from_dictionary(dictionary.get('seller')) if 'seller' in dictionary.keys() else APIHelper.SKIP - customer = InvoiceCustomer.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP - billing_address = InvoiceAddress.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP - shipping_address = InvoiceAddress.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else APIHelper.SKIP + sequence_number =\ + dictionary.get("sequence_number")\ + if dictionary.get("sequence_number")\ + else APIHelper.SKIP + origin_credit_note_uid =\ + dictionary.get("origin_credit_note_uid")\ + if dictionary.get("origin_credit_note_uid")\ + else APIHelper.SKIP + origin_credit_note_number =\ + dictionary.get("origin_credit_note_number")\ + if dictionary.get("origin_credit_note_number")\ + else APIHelper.SKIP + issue_date = dateutil.parser.parse( + dictionary.get("issue_date")).date()\ + if dictionary.get("issue_date") else APIHelper.SKIP + applied_date = dateutil.parser.parse( + dictionary.get("applied_date")).date()\ + if dictionary.get("applied_date") else APIHelper.SKIP + due_date = dateutil.parser.parse( + dictionary.get("due_date")).date()\ + if dictionary.get("due_date") else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + seller =\ + InvoiceSeller.from_dictionary( + dictionary.get("seller"))\ + if "seller" in dictionary.keys()\ + else APIHelper.SKIP + customer =\ + InvoiceCustomer.from_dictionary( + dictionary.get("customer"))\ + if "customer" in dictionary.keys()\ + else APIHelper.SKIP + billing_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("billing_address"))\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + shipping_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("shipping_address"))\ + if "shipping_address" in dictionary.keys()\ + else APIHelper.SKIP line_items = None - if dictionary.get('line_items') is not None: - line_items = [CreditNoteLineItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + CreditNoteLineItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP discounts = None - if dictionary.get('discounts') is not None: - discounts = [InvoiceDiscount.from_dictionary(x) for x in dictionary.get('discounts')] + if dictionary.get("discounts") is not None: + discounts = [ + InvoiceDiscount.from_dictionary(x) + for x in dictionary.get("discounts") + ] else: discounts = APIHelper.SKIP taxes = None - if dictionary.get('taxes') is not None: - taxes = [InvoiceTax.from_dictionary(x) for x in dictionary.get('taxes')] + if dictionary.get("taxes") is not None: + taxes = [ + InvoiceTax.from_dictionary(x) + for x in dictionary.get("taxes") + ] else: taxes = APIHelper.SKIP refunds = None - if dictionary.get('refunds') is not None: - refunds = [InvoiceRefund.from_dictionary(x) for x in dictionary.get('refunds')] + if dictionary.get("refunds") is not None: + refunds = [ + InvoiceRefund.from_dictionary(x) + for x in dictionary.get("refunds") + ] else: refunds = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, site_id, @@ -297,7 +378,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -308,7 +389,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -318,55 +398,295 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'number={(self.number if hasattr(self, "number") else None)!r}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!r}, ' - f'origin_credit_note_uid={(self.origin_credit_note_uid if hasattr(self, "origin_credit_note_uid") else None)!r}, ' - f'origin_credit_note_number={(self.origin_credit_note_number if hasattr(self, "origin_credit_note_number") else None)!r}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!r}, ' - f'applied_date={(self.applied_date if hasattr(self, "applied_date") else None)!r}, ' - f'due_date={(self.due_date if hasattr(self, "due_date") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'role={(self.role if hasattr(self, "role") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!r}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!r}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r}, ' - f'refunds={(self.refunds if hasattr(self, "refunds") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _origin_credit_note_uid=( + self.origin_credit_note_uid + if hasattr(self, "origin_credit_note_uid") + else None + ) + _origin_credit_note_number=( + self.origin_credit_note_number + if hasattr(self, "origin_credit_note_number") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _applied_date=( + self.applied_date + if hasattr(self, "applied_date") + else None + ) + _due_date=( + self.due_date + if hasattr(self, "due_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _refunds=( + self.refunds + if hasattr(self, "refunds") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"site_id={_site_id!r}, " + f"customer_id={_customer_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"number={_number!r}, " + f"sequence_number={_sequence_number!r}, " + f"origin_credit_note_uid={_origin_credit_note_uid!r}, " + f"origin_credit_note_number={_origin_credit_note_number!r}, " + f"issue_date={_issue_date!r}, " + f"applied_date={_applied_date!r}, " + f"due_date={_due_date!r}, " + f"status={_status!r}, " + f"memo={_memo!r}, " + f"role={_role!r}, " + f"currency={_currency!r}, " + f"seller={_seller!r}, " + f"customer={_customer!r}, " + f"billing_address={_billing_address!r}, " + f"shipping_address={_shipping_address!r}, " + f"line_items={_line_items!r}, " + f"discounts={_discounts!r}, " + f"taxes={_taxes!r}, " + f"refunds={_refunds!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'number={(self.number if hasattr(self, "number") else None)!s}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!s}, ' - f'origin_credit_note_uid={(self.origin_credit_note_uid if hasattr(self, "origin_credit_note_uid") else None)!s}, ' - f'origin_credit_note_number={(self.origin_credit_note_number if hasattr(self, "origin_credit_note_number") else None)!s}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!s}, ' - f'applied_date={(self.applied_date if hasattr(self, "applied_date") else None)!s}, ' - f'due_date={(self.due_date if hasattr(self, "due_date") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'role={(self.role if hasattr(self, "role") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!s}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!s}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s}, ' - f'refunds={(self.refunds if hasattr(self, "refunds") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _origin_credit_note_uid=( + self.origin_credit_note_uid + if hasattr(self, "origin_credit_note_uid") + else None + ) + _origin_credit_note_number=( + self.origin_credit_note_number + if hasattr(self, "origin_credit_note_number") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _applied_date=( + self.applied_date + if hasattr(self, "applied_date") + else None + ) + _due_date=( + self.due_date + if hasattr(self, "due_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _refunds=( + self.refunds + if hasattr(self, "refunds") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"site_id={_site_id!s}, " + f"customer_id={_customer_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"number={_number!s}, " + f"sequence_number={_sequence_number!s}, " + f"origin_credit_note_uid={_origin_credit_note_uid!s}, " + f"origin_credit_note_number={_origin_credit_note_number!s}, " + f"issue_date={_issue_date!s}, " + f"applied_date={_applied_date!s}, " + f"due_date={_due_date!s}, " + f"status={_status!s}, " + f"memo={_memo!s}, " + f"role={_role!s}, " + f"currency={_currency!s}, " + f"seller={_seller!s}, " + f"customer={_customer!s}, " + f"billing_address={_billing_address!s}, " + f"shipping_address={_shipping_address!s}, " + f"line_items={_line_items!s}, " + f"discounts={_discounts!s}, " + f"taxes={_taxes!s}, " + f"refunds={_refunds!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/debit_note_role.py b/advancedbilling/models/debit_note_role.py index d2eeca5a..d7797dbe 100644 --- a/advancedbilling/models/debit_note_role.py +++ b/advancedbilling/models/debit_note_role.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class DebitNoteRole(object): - """Implementation of the 'Debit Note Role' enum. The role of the debit note. @@ -17,18 +14,19 @@ class DebitNoteRole(object): Attributes: CHARGEBACK: The enum member of type str. REFUND: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['chargeback', 'refund'] - CHARGEBACK = 'chargeback' - REFUND = 'refund' + _all_values = ["chargeback", "refund"] + CHARGEBACK = "chargeback" + + REFUND = "refund" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -38,9 +36,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/debit_note_status.py b/advancedbilling/models/debit_note_status.py index e5cc7ef5..3c849d13 100644 --- a/advancedbilling/models/debit_note_status.py +++ b/advancedbilling/models/debit_note_status.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class DebitNoteStatus(object): - """Implementation of the 'Debit Note Status' enum. Current status of the debit note. @@ -19,22 +16,23 @@ class DebitNoteStatus(object): APPLIED: The enum member of type str. BANISHED: The enum member of type str. PAID: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['open', 'applied', 'banished', 'paid'] - OPEN = 'open' - APPLIED = 'applied' + _all_values = ["open", "applied", "banished", "paid"] + OPEN = "open" - BANISHED = 'banished' + APPLIED = "applied" - PAID = 'paid' + BANISHED = "banished" + + PAID = "paid" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -44,9 +42,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/deduct_service_credit.py b/advancedbilling/models/deduct_service_credit.py index c8a95881..9bb8165b 100644 --- a/advancedbilling/models/deduct_service_credit.py +++ b/advancedbilling/models/deduct_service_credit.py @@ -1,46 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class DeductServiceCredit(object): - """Implementation of the 'Deduct Service Credit' model. Attributes: amount (str | float): The model property of type str | float. memo (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "memo": 'memo' + "amount": "amount", + "memo": "memo", } _optionals = [ - 'memo', + "memo", ] - def __init__(self, - amount=None, - memo=APIHelper.SKIP, - additional_properties=None): - """Constructor for the DeductServiceCredit class""" - + def __init__( + self, + amount=None, + memo=APIHelper.SKIP, + additional_properties=None): + """Initialize a DeductServiceCredit instance.""" # Initialize members of the class - self.amount = amount + self.amount = amount if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo # Add additional model properties to the instance if additional_properties is None: @@ -50,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -61,16 +59,29 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = APIHelper.deserialize_union_type(UnionTypeLookUp.get('DeductServiceCreditAmount'), dictionary.get('amount'), False) if dictionary.get('amount') is not None else None - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP + amount = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("DeductServiceCreditAmount"), + dictionary.get("amount"), + False)\ + if dictionary.get("amount") is not None\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, memo, @@ -78,7 +89,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -89,24 +100,50 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('DeductServiceCreditAmount').validate(dictionary.amount).is_valid + return (UnionTypeLookUp.get("DeductServiceCreditAmount") + .validate(dictionary.amount).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('DeductServiceCreditAmount').validate(dictionary.get('amount')).is_valid + return (UnionTypeLookUp.get("DeductServiceCreditAmount") + .validate(dictionary.get("amount")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=self.amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"memo={_memo!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=self.amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"memo={_memo!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/deduct_service_credit_request.py b/advancedbilling/models/deduct_service_credit_request.py index 35b99803..a3b93ca5 100644 --- a/advancedbilling/models/deduct_service_credit_request.py +++ b/advancedbilling/models/deduct_service_credit_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.deduct_service_credit import DeductServiceCredit +# ruff: noqa: E501 +from advancedbilling.models.deduct_service_credit import ( + DeductServiceCredit, +) -class DeductServiceCreditRequest(object): +class DeductServiceCreditRequest(object): """Implementation of the 'Deduct Service Credit Request' model. Attributes: deduction (DeductServiceCredit): The model property of type DeductServiceCredit. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "deduction": 'deduction' + "deduction": "deduction", } - def __init__(self, - deduction=None, - additional_properties=None): - """Constructor for the DeductServiceCreditRequest class""" - + def __init__( + self, + deduction=None, + additional_properties=None): + """Initialize a DeductServiceCreditRequest instance.""" # Initialize members of the class - self.deduction = deduction + self.deduction = deduction # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - deduction = DeductServiceCredit.from_dictionary(dictionary.get('deduction')) if dictionary.get('deduction') else None + deduction =\ + DeductServiceCredit.from_dictionary( + dictionary.get("deduction"))\ + if dictionary.get("deduction") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(deduction, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'deduction={self.deduction!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _deduction=self.deduction + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"deduction={_deduction!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'deduction={self.deduction!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _deduction=self.deduction + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"deduction={_deduction!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/delayed_cancellation_response.py b/advancedbilling/models/delayed_cancellation_response.py index 326ee3d6..36a43f2f 100644 --- a/advancedbilling/models/delayed_cancellation_response.py +++ b/advancedbilling/models/delayed_cancellation_response.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class DelayedCancellationResponse(object): - """Implementation of the 'Delayed Cancellation Response' model. Attributes: message (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "message": 'message' + "message": "message", } _optionals = [ - 'message', + "message", ] - def __init__(self, - message=APIHelper.SKIP, - additional_properties=None): - """Constructor for the DelayedCancellationResponse class""" - + def __init__( + self, + message=APIHelper.SKIP, + additional_properties=None): + """Initialize a DelayedCancellationResponse instance.""" # Initialize members of the class if message is not APIHelper.SKIP: - self.message = message + self.message = message # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - message = dictionary.get("message") if dictionary.get("message") else APIHelper.SKIP + message =\ + dictionary.get("message")\ + if dictionary.get("message")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(message, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'message={(self.message if hasattr(self, "message") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _message=( + self.message + if hasattr(self, "message") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"message={_message!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'message={(self.message if hasattr(self, "message") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _message=( + self.message + if hasattr(self, "message") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"message={_message!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/delete_subscription_group_response.py b/advancedbilling/models/delete_subscription_group_response.py index 11671401..c3b47042 100644 --- a/advancedbilling/models/delete_subscription_group_response.py +++ b/advancedbilling/models/delete_subscription_group_response.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class DeleteSubscriptionGroupResponse(object): - """Implementation of the 'Delete Subscription Group Response' model. Attributes: uid (str): The model property of type str. deleted (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "deleted": 'deleted' + "uid": "uid", + "deleted": "deleted", } _optionals = [ - 'uid', - 'deleted', + "uid", + "deleted", ] - def __init__(self, - uid=APIHelper.SKIP, - deleted=APIHelper.SKIP, - additional_properties=None): - """Constructor for the DeleteSubscriptionGroupResponse class""" - + def __init__( + self, + uid=APIHelper.SKIP, + deleted=APIHelper.SKIP, + additional_properties=None): + """Initialize a DeleteSubscriptionGroupResponse instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if deleted is not APIHelper.SKIP: - self.deleted = deleted + self.deleted = deleted # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - deleted = dictionary.get("deleted") if "deleted" in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + deleted =\ + dictionary.get("deleted")\ + if "deleted" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, deleted, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'deleted={(self.deleted if hasattr(self, "deleted") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _deleted=( + self.deleted + if hasattr(self, "deleted") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"deleted={_deleted!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'deleted={(self.deleted if hasattr(self, "deleted") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _deleted=( + self.deleted + if hasattr(self, "deleted") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"deleted={_deleted!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/deliver_proforma_invoice_request.py b/advancedbilling/models/deliver_proforma_invoice_request.py new file mode 100644 index 00000000..67c2475e --- /dev/null +++ b/advancedbilling/models/deliver_proforma_invoice_request.py @@ -0,0 +1,149 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class DeliverProformaInvoiceRequest(object): + """Implementation of the 'Deliver Proforma Invoice Request' model. + + Attributes: + recipient_emails (List[str]): The model property of type List[str]. + cc_recipient_emails (List[str]): The model property of type List[str]. + bcc_recipient_emails (List[str]): The model property of type List[str]. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "recipient_emails": "recipient_emails", + "cc_recipient_emails": "cc_recipient_emails", + "bcc_recipient_emails": "bcc_recipient_emails", + } + + _optionals = [ + "recipient_emails", + "cc_recipient_emails", + "bcc_recipient_emails", + ] + + def __init__( + self, + recipient_emails=APIHelper.SKIP, + cc_recipient_emails=APIHelper.SKIP, + bcc_recipient_emails=APIHelper.SKIP, + additional_properties=None): + """Initialize a DeliverProformaInvoiceRequest instance.""" + # Initialize members of the class + if recipient_emails is not APIHelper.SKIP: + self.recipient_emails = recipient_emails + if cc_recipient_emails is not APIHelper.SKIP: + self.cc_recipient_emails = cc_recipient_emails + if bcc_recipient_emails is not APIHelper.SKIP: + self.bcc_recipient_emails = bcc_recipient_emails + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + recipient_emails =\ + dictionary.get("recipient_emails")\ + if dictionary.get("recipient_emails")\ + else APIHelper.SKIP + cc_recipient_emails =\ + dictionary.get("cc_recipient_emails")\ + if dictionary.get("cc_recipient_emails")\ + else APIHelper.SKIP + bcc_recipient_emails =\ + dictionary.get("bcc_recipient_emails")\ + if dictionary.get("bcc_recipient_emails")\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(recipient_emails, + cc_recipient_emails, + bcc_recipient_emails, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _recipient_emails=( + self.recipient_emails + if hasattr(self, "recipient_emails") + else None + ) + _cc_recipient_emails=( + self.cc_recipient_emails + if hasattr(self, "cc_recipient_emails") + else None + ) + _bcc_recipient_emails=( + self.bcc_recipient_emails + if hasattr(self, "bcc_recipient_emails") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"recipient_emails={_recipient_emails!r}, " + f"cc_recipient_emails={_cc_recipient_emails!r}, " + f"bcc_recipient_emails={_bcc_recipient_emails!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _recipient_emails=( + self.recipient_emails + if hasattr(self, "recipient_emails") + else None + ) + _cc_recipient_emails=( + self.cc_recipient_emails + if hasattr(self, "cc_recipient_emails") + else None + ) + _bcc_recipient_emails=( + self.bcc_recipient_emails + if hasattr(self, "bcc_recipient_emails") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"recipient_emails={_recipient_emails!s}, " + f"cc_recipient_emails={_cc_recipient_emails!s}, " + f"bcc_recipient_emails={_bcc_recipient_emails!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/direction.py b/advancedbilling/models/direction.py index 447d5c5c..006a4eae 100644 --- a/advancedbilling/models/direction.py +++ b/advancedbilling/models/direction.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class Direction(object): - """Implementation of the 'direction' enum. Attributes: ASC: The enum member of type str. DESC: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - ASC = 'asc' - DESC = 'desc' + ASC = "asc" + + DESC = "desc" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/discount_type.py b/advancedbilling/models/discount_type.py index a30af6e8..74bf0e2c 100644 --- a/advancedbilling/models/discount_type.py +++ b/advancedbilling/models/discount_type.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class DiscountType(object): - """Implementation of the 'Discount Type' enum. Attributes: AMOUNT: The enum member of type str. PERCENT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - AMOUNT = 'amount' - PERCENT = 'percent' + AMOUNT = "amount" + + PERCENT = "percent" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/downgrade_credit_credit_type.py b/advancedbilling/models/downgrade_credit_credit_type.py new file mode 100644 index 00000000..d9e71972 --- /dev/null +++ b/advancedbilling/models/downgrade_credit_credit_type.py @@ -0,0 +1,69 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class DowngradeCreditCreditType(object): + """Implementation of the 'Downgrade Credit Credit Type' enum. + + The type of credit to be created when upgrading/downgrading. Defaults to the + component and then site setting if one is not provided. Values are: + `full` - A full price credit is added for the amount owed. + `prorated` - A prorated credit is added for the amount owed. + `none` - No charge is added. + + Attributes: + FULL: The enum member of type str. + PRORATED: The enum member of type str. + NONE: The enum member of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + _all_values = ["full", "prorated", "none"] + FULL = "full" + + PRORATED = "prorated" + + NONE = "none" + + @classmethod + def validate(cls, value): + """Validate value contains in enum + + Args: + value: the value to be validated + + Returns: + boolean : if value is valid enum values. + + """ + return value in cls._all_values + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/advancedbilling/models/dunner_data.py b/advancedbilling/models/dunner_data.py index 8ca201b5..31510348 100644 --- a/advancedbilling/models/dunner_data.py +++ b/advancedbilling/models/dunner_data.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class DunnerData(object): - """Implementation of the 'Dunner Data' model. Attributes: @@ -20,38 +18,44 @@ class DunnerData(object): created_at (datetime): The model property of type datetime. attempts (int): The model property of type int. last_attempted_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "state": 'state', - "subscription_id": 'subscription_id', - "revenue_at_risk_in_cents": 'revenue_at_risk_in_cents', - "created_at": 'created_at', - "attempts": 'attempts', - "last_attempted_at": 'last_attempted_at' + "state": "state", + "subscription_id": "subscription_id", + "revenue_at_risk_in_cents": "revenue_at_risk_in_cents", + "created_at": "created_at", + "attempts": "attempts", + "last_attempted_at": "last_attempted_at", } - def __init__(self, - state=None, - subscription_id=None, - revenue_at_risk_in_cents=None, - created_at=None, - attempts=None, - last_attempted_at=None, - additional_properties=None): - """Constructor for the DunnerData class""" - + def __init__( + self, + state=None, + subscription_id=None, + revenue_at_risk_in_cents=None, + created_at=None, + attempts=None, + last_attempted_at=None, + additional_properties=None): + """Initialize a DunnerData instance.""" # Initialize members of the class - self.state = state - self.subscription_id = subscription_id - self.revenue_at_risk_in_cents = revenue_at_risk_in_cents - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None - self.attempts = attempts - self.last_attempted_at = APIHelper.apply_datetime_converter(last_attempted_at, APIHelper.RFC3339DateTime) if last_attempted_at else None + self.state = state + self.subscription_id = subscription_id + self.revenue_at_risk_in_cents = revenue_at_risk_in_cents + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None + self.attempts = attempts + self.last_attempted_at =\ + APIHelper.apply_datetime_converter( + last_attempted_at, APIHelper.RFC3339DateTime)\ + if last_attempted_at else None # Add additional model properties to the instance if additional_properties is None: @@ -61,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -72,19 +76,37 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - state = dictionary.get("state") if dictionary.get("state") else None - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else None - revenue_at_risk_in_cents = dictionary.get("revenue_at_risk_in_cents") if dictionary.get("revenue_at_risk_in_cents") else None - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else None - attempts = dictionary.get("attempts") if dictionary.get("attempts") else None - last_attempted_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("last_attempted_at")).datetime if dictionary.get("last_attempted_at") else None + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else None + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else None + revenue_at_risk_in_cents =\ + dictionary.get("revenue_at_risk_in_cents")\ + if dictionary.get("revenue_at_risk_in_cents")\ + else None + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else None + attempts =\ + dictionary.get("attempts")\ + if dictionary.get("attempts")\ + else None + last_attempted_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("last_attempted_at")).datetime\ + if dictionary.get("last_attempted_at") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(state, subscription_id, @@ -96,7 +118,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -107,53 +129,134 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.state, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.subscription_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.revenue_at_risk_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.created_at, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.attempts, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.last_attempted_at, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) + return APIHelper.is_valid_type( + value=dictionary.state, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.subscription_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.revenue_at_risk_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.created_at, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.attempts, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.last_attempted_at, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('state'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('subscription_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('revenue_at_risk_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('created_at'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('attempts'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('last_attempted_at'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("state"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("subscription_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("revenue_at_risk_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("created_at"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("attempts"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("last_attempted_at"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'state={self.state!r}, ' - f'subscription_id={self.subscription_id!r}, ' - f'revenue_at_risk_in_cents={self.revenue_at_risk_in_cents!r}, ' - f'created_at={self.created_at!r}, ' - f'attempts={self.attempts!r}, ' - f'last_attempted_at={self.last_attempted_at!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _state=self.state + _subscription_id=self.subscription_id + _revenue_at_risk_in_cents=self.revenue_at_risk_in_cents + _created_at=self.created_at + _attempts=self.attempts + _last_attempted_at=self.last_attempted_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"state={_state!r}, " + f"subscription_id={_subscription_id!r}, " + f"revenue_at_risk_in_cents={_revenue_at_risk_in_cents!r}, " + f"created_at={_created_at!r}, " + f"attempts={_attempts!r}, " + f"last_attempted_at={_last_attempted_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'state={self.state!s}, ' - f'subscription_id={self.subscription_id!s}, ' - f'revenue_at_risk_in_cents={self.revenue_at_risk_in_cents!s}, ' - f'created_at={self.created_at!s}, ' - f'attempts={self.attempts!s}, ' - f'last_attempted_at={self.last_attempted_at!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _state=self.state + _subscription_id=self.subscription_id + _revenue_at_risk_in_cents=self.revenue_at_risk_in_cents + _created_at=self.created_at + _attempts=self.attempts + _last_attempted_at=self.last_attempted_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"state={_state!s}, " + f"subscription_id={_subscription_id!s}, " + f"revenue_at_risk_in_cents={_revenue_at_risk_in_cents!s}, " + f"created_at={_created_at!s}, " + f"attempts={_attempts!s}, " + f"last_attempted_at={_last_attempted_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/dunning_step_data.py b/advancedbilling/models/dunning_step_data.py index be81e614..6777d16f 100644 --- a/advancedbilling/models/dunning_step_data.py +++ b/advancedbilling/models/dunning_step_data.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class DunningStepData(object): - """Implementation of the 'Dunning Step Data' model. Attributes: @@ -22,59 +20,59 @@ class DunningStepData(object): send_bcc_email (bool): The model property of type bool. send_sms (bool): The model property of type bool. sms_body (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "day_threshold": 'day_threshold', - "action": 'action', - "send_email": 'send_email', - "send_bcc_email": 'send_bcc_email', - "send_sms": 'send_sms', - "email_body": 'email_body', - "email_subject": 'email_subject', - "sms_body": 'sms_body' + "day_threshold": "day_threshold", + "action": "action", + "send_email": "send_email", + "send_bcc_email": "send_bcc_email", + "send_sms": "send_sms", + "email_body": "email_body", + "email_subject": "email_subject", + "sms_body": "sms_body", } _optionals = [ - 'email_body', - 'email_subject', - 'sms_body', + "email_body", + "email_subject", + "sms_body", ] _nullables = [ - 'email_body', - 'email_subject', - 'sms_body', + "email_body", + "email_subject", + "sms_body", ] - def __init__(self, - day_threshold=None, - action=None, - send_email=None, - send_bcc_email=None, - send_sms=None, - email_body=APIHelper.SKIP, - email_subject=APIHelper.SKIP, - sms_body=APIHelper.SKIP, - additional_properties=None): - """Constructor for the DunningStepData class""" - + def __init__( + self, + day_threshold=None, + action=None, + send_email=None, + send_bcc_email=None, + send_sms=None, + email_body=APIHelper.SKIP, + email_subject=APIHelper.SKIP, + sms_body=APIHelper.SKIP, + additional_properties=None): + """Initialize a DunningStepData instance.""" # Initialize members of the class - self.day_threshold = day_threshold - self.action = action + self.day_threshold = day_threshold + self.action = action if email_body is not APIHelper.SKIP: - self.email_body = email_body + self.email_body = email_body if email_subject is not APIHelper.SKIP: - self.email_subject = email_subject - self.send_email = send_email - self.send_bcc_email = send_bcc_email - self.send_sms = send_sms + self.email_subject = email_subject + self.send_email = send_email + self.send_bcc_email = send_bcc_email + self.send_sms = send_sms if sms_body is not APIHelper.SKIP: - self.sms_body = sms_body + self.sms_body = sms_body # Add additional model properties to the instance if additional_properties is None: @@ -84,7 +82,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -95,21 +93,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - day_threshold = dictionary.get("day_threshold") if dictionary.get("day_threshold") else None - action = dictionary.get("action") if dictionary.get("action") else None - send_email = dictionary.get("send_email") if "send_email" in dictionary.keys() else None - send_bcc_email = dictionary.get("send_bcc_email") if "send_bcc_email" in dictionary.keys() else None - send_sms = dictionary.get("send_sms") if "send_sms" in dictionary.keys() else None - email_body = dictionary.get("email_body") if "email_body" in dictionary.keys() else APIHelper.SKIP - email_subject = dictionary.get("email_subject") if "email_subject" in dictionary.keys() else APIHelper.SKIP - sms_body = dictionary.get("sms_body") if "sms_body" in dictionary.keys() else APIHelper.SKIP + day_threshold =\ + dictionary.get("day_threshold")\ + if dictionary.get("day_threshold")\ + else None + action =\ + dictionary.get("action")\ + if dictionary.get("action")\ + else None + send_email =\ + dictionary.get("send_email")\ + if "send_email" in dictionary.keys()\ + else None + send_bcc_email =\ + dictionary.get("send_bcc_email")\ + if "send_bcc_email" in dictionary.keys()\ + else None + send_sms =\ + dictionary.get("send_sms")\ + if "send_sms" in dictionary.keys()\ + else None + email_body =\ + dictionary.get("email_body")\ + if "email_body" in dictionary.keys()\ + else APIHelper.SKIP + email_subject =\ + dictionary.get("email_subject")\ + if "email_subject" in dictionary.keys()\ + else APIHelper.SKIP + sms_body =\ + dictionary.get("sms_body")\ + if "sms_body" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(day_threshold, action, @@ -123,7 +147,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -134,53 +158,152 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.day_threshold, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.action, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.send_email, - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.send_bcc_email, - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.send_sms, - type_callable=lambda value: isinstance(value, bool)) + return APIHelper.is_valid_type( + value=dictionary.day_threshold, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.action, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.send_email, + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.send_bcc_email, + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.send_sms, + type_callable=lambda value: + isinstance( + value, + bool, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('day_threshold'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('action'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('send_email'), - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.get('send_bcc_email'), - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.get('send_sms'), - type_callable=lambda value: isinstance(value, bool)) + return APIHelper.is_valid_type( + value=dictionary.get("day_threshold"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("action"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("send_email"), + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("send_bcc_email"), + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("send_sms"), + type_callable=lambda value: + isinstance( + value, + bool, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'day_threshold={self.day_threshold!r}, ' - f'action={self.action!r}, ' - f'email_body={(self.email_body if hasattr(self, "email_body") else None)!r}, ' - f'email_subject={(self.email_subject if hasattr(self, "email_subject") else None)!r}, ' - f'send_email={self.send_email!r}, ' - f'send_bcc_email={self.send_bcc_email!r}, ' - f'send_sms={self.send_sms!r}, ' - f'sms_body={(self.sms_body if hasattr(self, "sms_body") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _day_threshold=self.day_threshold + _action=self.action + _email_body=( + self.email_body + if hasattr(self, "email_body") + else None + ) + _email_subject=( + self.email_subject + if hasattr(self, "email_subject") + else None + ) + _send_email=self.send_email + _send_bcc_email=self.send_bcc_email + _send_sms=self.send_sms + _sms_body=( + self.sms_body + if hasattr(self, "sms_body") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"day_threshold={_day_threshold!r}, " + f"action={_action!r}, " + f"email_body={_email_body!r}, " + f"email_subject={_email_subject!r}, " + f"send_email={_send_email!r}, " + f"send_bcc_email={_send_bcc_email!r}, " + f"send_sms={_send_sms!r}, " + f"sms_body={_sms_body!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'day_threshold={self.day_threshold!s}, ' - f'action={self.action!s}, ' - f'email_body={(self.email_body if hasattr(self, "email_body") else None)!s}, ' - f'email_subject={(self.email_subject if hasattr(self, "email_subject") else None)!s}, ' - f'send_email={self.send_email!s}, ' - f'send_bcc_email={self.send_bcc_email!s}, ' - f'send_sms={self.send_sms!s}, ' - f'sms_body={(self.sms_body if hasattr(self, "sms_body") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _day_threshold=self.day_threshold + _action=self.action + _email_body=( + self.email_body + if hasattr(self, "email_body") + else None + ) + _email_subject=( + self.email_subject + if hasattr(self, "email_subject") + else None + ) + _send_email=self.send_email + _send_bcc_email=self.send_bcc_email + _send_sms=self.send_sms + _sms_body=( + self.sms_body + if hasattr(self, "sms_body") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"day_threshold={_day_threshold!s}, " + f"action={_action!s}, " + f"email_body={_email_body!s}, " + f"email_subject={_email_subject!s}, " + f"send_email={_send_email!s}, " + f"send_bcc_email={_send_bcc_email!s}, " + f"send_sms={_send_sms!s}, " + f"sms_body={_sms_body!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/dunning_step_reached.py b/advancedbilling/models/dunning_step_reached.py index 189cf76a..c95f2c3c 100644 --- a/advancedbilling/models/dunning_step_reached.py +++ b/advancedbilling/models/dunning_step_reached.py @@ -1,49 +1,49 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.dunner_data import DunnerData -from advancedbilling.models.dunning_step_data import DunningStepData +from advancedbilling.models.dunner_data import ( + DunnerData, +) +from advancedbilling.models.dunning_step_data import ( + DunningStepData, +) class DunningStepReached(object): - """Implementation of the 'Dunning Step Reached' model. Attributes: dunner (DunnerData): The model property of type DunnerData. - current_step (DunningStepData): The model property of type - DunningStepData. - next_step (DunningStepData): The model property of type - DunningStepData. - additional_properties (Dict[str, object]): The additional properties - for the model. + current_step (DunningStepData): The model property of type DunningStepData. + next_step (DunningStepData): The model property of type DunningStepData. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "dunner": 'dunner', - "current_step": 'current_step', - "next_step": 'next_step' + "dunner": "dunner", + "current_step": "current_step", + "next_step": "next_step", } - def __init__(self, - dunner=None, - current_step=None, - next_step=None, - additional_properties=None): - """Constructor for the DunningStepReached class""" - + def __init__( + self, + dunner=None, + current_step=None, + next_step=None, + additional_properties=None): + """Initialize a DunningStepReached instance.""" # Initialize members of the class - self.dunner = dunner - self.current_step = current_step - self.next_step = next_step + self.dunner = dunner + self.current_step = current_step + self.next_step = next_step # Add additional model properties to the instance if additional_properties is None: @@ -53,7 +53,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -64,16 +64,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - dunner = DunnerData.from_dictionary(dictionary.get('dunner')) if dictionary.get('dunner') else None - current_step = DunningStepData.from_dictionary(dictionary.get('current_step')) if dictionary.get('current_step') else None - next_step = DunningStepData.from_dictionary(dictionary.get('next_step')) if dictionary.get('next_step') else None + dunner =\ + DunnerData.from_dictionary( + dictionary.get("dunner"))\ + if dictionary.get("dunner") else None + current_step =\ + DunningStepData.from_dictionary( + dictionary.get("current_step"))\ + if dictionary.get("current_step") else None + next_step =\ + DunningStepData.from_dictionary( + dictionary.get("next_step"))\ + if dictionary.get("next_step") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(dunner, current_step, @@ -82,7 +93,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -93,41 +104,68 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.dunner, - type_callable=lambda value: DunnerData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.current_step, - type_callable=lambda value: DunningStepData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.next_step, - type_callable=lambda value: DunningStepData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.dunner, + type_callable=lambda value: + DunnerData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.current_step, + type_callable=lambda value: + DunningStepData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.next_step, + type_callable=lambda value: + DunningStepData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('dunner'), - type_callable=lambda value: DunnerData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('current_step'), - type_callable=lambda value: DunningStepData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('next_step'), - type_callable=lambda value: DunningStepData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("dunner"), + type_callable=lambda value: + DunnerData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("current_step"), + type_callable=lambda value: + DunningStepData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("next_step"), + type_callable=lambda value: + DunningStepData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'dunner={self.dunner!r}, ' - f'current_step={self.current_step!r}, ' - f'next_step={self.next_step!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _dunner=self.dunner + _current_step=self.current_step + _next_step=self.next_step + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"dunner={_dunner!r}, " + f"current_step={_current_step!r}, " + f"next_step={_next_step!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'dunner={self.dunner!s}, ' - f'current_step={self.current_step!s}, ' - f'next_step={self.next_step!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _dunner=self.dunner + _current_step=self.current_step + _next_step=self.next_step + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"dunner={_dunner!s}, " + f"current_step={_current_step!s}, " + f"next_step={_next_step!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/ebb_component.py b/advancedbilling/models/ebb_component.py index dccfd7e0..fe8b5bf8 100644 --- a/advancedbilling/models/ebb_component.py +++ b/advancedbilling/models/ebb_component.py @@ -1,150 +1,146 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.component_price_point_item import ( + ComponentPricePointItem, +) from advancedbilling.models.price import Price class EBBComponent(object): - """Implementation of the 'EBB Component' model. Attributes: - name (str): A name for this component that is suitable for showing - customers and displaying on billing statements, ie. "Minutes". - unit_name (str): The name of the unit of measurement for the - component. It should be singular since it will be automatically - pluralized when necessary. i.e. “message”, which may then be shown - as “5 messages” on a subscription’s component line-item - description (str): A description for the component that will be - displayed to the user on the hosted signup page. - handle (str): A unique identifier for your use that can be used to - retrieve this component is subsequent requests. Must start with a - letter or number and may only contain lowercase letters, numbers, - or the characters '.', ':', '-', or '_'. - taxable (bool): Boolean flag describing whether a component is taxable - or not. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. - prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) - One or more price brackets. See [Price Bracket - Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-C - omponent-Pricing-Schemes#price-bracket-rules) for an overview of - how price brackets work for different pricing schemes. - price_points (List[ComponentPricePointItem]): The model property of - type List[ComponentPricePointItem]. - unit_price (str | float | None): The amount the customer will be - charged per unit when the pricing scheme is “per_unit”. The price - can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or - 0.00000065 - tax_code (str): A string representing the tax code related to the - component type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. - hide_date_range_on_invoice (bool): (Only available on Relationship - Invoicing sites) Boolean flag describing if the service date range - should show for the component on generated invoices. - event_based_billing_metric_id (int): The ID of an event based billing - metric that will be attached to this component. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component's - default price point would renew every 30 days. This property is - only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component's default price point, either month or day. - This property is only available for sites with Multifrequency - enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + name (str): A name for this component that is suitable for showing customers + and displaying on billing statements, ie. "Minutes". + unit_name (str): The name of the unit of measurement for the component. It + should be singular since it will be automatically pluralized when + necessary. i.e. “message”, which may then be shown as “5 messages” on a + subscription’s component line-item + description (str): A description for the component that will be displayed to + the user on the hosted signup page. + handle (str): A unique identifier for your use that can be used to retrieve + this component is subsequent requests. Must start with a letter or + number and may only contain lowercase letters, numbers, or the characters + '.', ':', '-', or '_'. + taxable (bool): Boolean flag describing whether a component is taxable or not. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. + prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) One or + more price brackets. See [Price Bracket + Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Componen + t-Pricing-Schemes#price-bracket-rules) for an overview of how price + brackets work for different pricing schemes. + price_points (List[ComponentPricePointItem]): The model property of type + List[ComponentPricePointItem]. + unit_price (str | float | None): The amount the customer will be charged per + unit when the pricing scheme is “per_unit”. The price can contain up to 8 + decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + tax_code (str): A string representing the tax code related to the component + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. + hide_date_range_on_invoice (bool): (Only available on Relationship Invoicing + sites) Boolean flag describing if the service date range should show for + the component on generated invoices. + event_based_billing_metric_id (int): The ID of an event based billing metric + that will be attached to this component. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component's default price point + would renew every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component's default price point, either month or day. This property + is only available for sites with Multifrequency enabled. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "unit_name": 'unit_name', - "pricing_scheme": 'pricing_scheme', - "event_based_billing_metric_id": 'event_based_billing_metric_id', - "description": 'description', - "handle": 'handle', - "taxable": 'taxable', - "prices": 'prices', - "price_points": 'price_points', - "unit_price": 'unit_price', - "tax_code": 'tax_code', - "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "interval": 'interval', - "interval_unit": 'interval_unit' + "name": "name", + "unit_name": "unit_name", + "pricing_scheme": "pricing_scheme", + "event_based_billing_metric_id": "event_based_billing_metric_id", + "description": "description", + "handle": "handle", + "taxable": "taxable", + "prices": "prices", + "price_points": "price_points", + "unit_price": "unit_price", + "tax_code": "tax_code", + "hide_date_range_on_invoice": "hide_date_range_on_invoice", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'description', - 'handle', - 'taxable', - 'prices', - 'price_points', - 'unit_price', - 'tax_code', - 'hide_date_range_on_invoice', - 'interval', - 'interval_unit', + "description", + "handle", + "taxable", + "prices", + "price_points", + "unit_price", + "tax_code", + "hide_date_range_on_invoice", + "interval", + "interval_unit", ] _nullables = [ - 'interval_unit', + "interval_unit", ] - def __init__(self, - name=None, - unit_name=None, - pricing_scheme=None, - event_based_billing_metric_id=None, - description=APIHelper.SKIP, - handle=APIHelper.SKIP, - taxable=APIHelper.SKIP, - prices=APIHelper.SKIP, - price_points=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - hide_date_range_on_invoice=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the EBBComponent class""" - + def __init__( + self, + name=None, + unit_name=None, + pricing_scheme=None, + event_based_billing_metric_id=None, + description=APIHelper.SKIP, + handle=APIHelper.SKIP, + taxable=APIHelper.SKIP, + prices=APIHelper.SKIP, + price_points=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + hide_date_range_on_invoice=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a EBBComponent instance.""" # Initialize members of the class - self.name = name - self.unit_name = unit_name + self.name = name + self.unit_name = unit_name if description is not APIHelper.SKIP: - self.description = description + self.description = description if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if taxable is not APIHelper.SKIP: - self.taxable = taxable - self.pricing_scheme = pricing_scheme + self.taxable = taxable + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices if price_points is not APIHelper.SKIP: - self.price_points = price_points + self.price_points = price_points if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if hide_date_range_on_invoice is not APIHelper.SKIP: - self.hide_date_range_on_invoice = hide_date_range_on_invoice - self.event_based_billing_metric_id = event_based_billing_metric_id + self.hide_date_range_on_invoice = hide_date_range_on_invoice + self.event_based_billing_metric_id = event_based_billing_metric_id if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -154,7 +150,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -165,36 +161,85 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - unit_name = dictionary.get("unit_name") if dictionary.get("unit_name") else None - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None - event_based_billing_metric_id = dictionary.get("event_based_billing_metric_id") if dictionary.get("event_based_billing_metric_id") else None - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + unit_name =\ + dictionary.get("unit_name")\ + if dictionary.get("unit_name")\ + else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None + event_based_billing_metric_id =\ + dictionary.get("event_based_billing_metric_id")\ + if dictionary.get("event_based_billing_metric_id")\ + else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP price_points = None - if dictionary.get('price_points') is not None: - price_points = [ComponentPricePointItem.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ComponentPricePointItem.from_dictionary(x) + for x in dictionary.get("price_points") + ] else: price_points = APIHelper.SKIP - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('EBBComponentUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP - hide_date_range_on_invoice = dictionary.get("hide_date_range_on_invoice") if "hide_date_range_on_invoice" in dictionary.keys() else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("EBBComponentUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + hide_date_range_on_invoice =\ + dictionary.get("hide_date_range_on_invoice")\ + if "hide_date_range_on_invoice" in dictionary.keys()\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, unit_name, @@ -213,37 +258,155 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'unit_name={self.unit_name!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!r}, ' - f'event_based_billing_metric_id={self.event_based_billing_metric_id!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _event_based_billing_metric_id=self.event_based_billing_metric_id + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"unit_name={_unit_name!r}, " + f"description={_description!r}, " + f"handle={_handle!r}, " + f"taxable={_taxable!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"price_points={_price_points!r}, " + f"unit_price={_unit_price!r}, " + f"tax_code={_tax_code!r}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!r}, " + f"event_based_billing_metric_id={_event_based_billing_metric_id!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'unit_name={self.unit_name!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!s}, ' - f'event_based_billing_metric_id={self.event_based_billing_metric_id!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _event_based_billing_metric_id=self.event_based_billing_metric_id + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"unit_name={_unit_name!s}, " + f"description={_description!s}, " + f"handle={_handle!s}, " + f"taxable={_taxable!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"price_points={_price_points!s}, " + f"unit_price={_unit_price!s}, " + f"tax_code={_tax_code!s}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!s}, " + f"event_based_billing_metric_id={_event_based_billing_metric_id!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/ebb_event.py b/advancedbilling/models/ebb_event.py index 47808fd3..26b3af7d 100644 --- a/advancedbilling/models/ebb_event.py +++ b/advancedbilling/models/ebb_event.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.chargify_ebb import ChargifyEBB +from advancedbilling.models.chargify_ebb import ( + ChargifyEBB, +) class EBBEvent(object): - """Implementation of the 'EBB Event' model. Attributes: chargify (ChargifyEBB): The model property of type ChargifyEBB. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify": 'chargify' + "chargify": "chargify", } _optionals = [ - 'chargify', + "chargify", ] - def __init__(self, - chargify=APIHelper.SKIP, - additional_properties=None): - """Constructor for the EBBEvent class""" - + def __init__( + self, + chargify=APIHelper.SKIP, + additional_properties=None): + """Initialize a EBBEvent instance.""" # Initialize members of the class if chargify is not APIHelper.SKIP: - self.chargify = chargify + self.chargify = chargify # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargify = ChargifyEBB.from_dictionary(dictionary.get('chargify')) if 'chargify' in dictionary.keys() else APIHelper.SKIP + chargify =\ + ChargifyEBB.from_dictionary( + dictionary.get("chargify"))\ + if "chargify" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify={(self.chargify if hasattr(self, "chargify") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify=( + self.chargify + if hasattr(self, "chargify") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify={_chargify!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify={(self.chargify if hasattr(self, "chargify") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify=( + self.chargify + if hasattr(self, "chargify") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify={_chargify!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/enable_webhooks_request.py b/advancedbilling/models/enable_webhooks_request.py index afcacbcb..82b56fe1 100644 --- a/advancedbilling/models/enable_webhooks_request.py +++ b/advancedbilling/models/enable_webhooks_request.py @@ -1,36 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class EnableWebhooksRequest(object): - """Implementation of the 'Enable Webhooks Request' model. Attributes: webhooks_enabled (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "webhooks_enabled": 'webhooks_enabled' + "webhooks_enabled": "webhooks_enabled", } - def __init__(self, - webhooks_enabled=None, - additional_properties=None): - """Constructor for the EnableWebhooksRequest class""" - + def __init__( + self, + webhooks_enabled=None, + additional_properties=None): + """Initialize a EnableWebhooksRequest instance.""" # Initialize members of the class - self.webhooks_enabled = webhooks_enabled + self.webhooks_enabled = webhooks_enabled # Add additional model properties to the instance if additional_properties is None: @@ -40,7 +36,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -51,24 +47,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - webhooks_enabled = dictionary.get("webhooks_enabled") if "webhooks_enabled" in dictionary.keys() else None + webhooks_enabled =\ + dictionary.get("webhooks_enabled")\ + if "webhooks_enabled" in dictionary.keys()\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(webhooks_enabled, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'webhooks_enabled={self.webhooks_enabled!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _webhooks_enabled=self.webhooks_enabled + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"webhooks_enabled={_webhooks_enabled!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'webhooks_enabled={self.webhooks_enabled!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _webhooks_enabled=self.webhooks_enabled + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"webhooks_enabled={_webhooks_enabled!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/enable_webhooks_response.py b/advancedbilling/models/enable_webhooks_response.py index c0ccdb12..f7cc2c39 100644 --- a/advancedbilling/models/enable_webhooks_response.py +++ b/advancedbilling/models/enable_webhooks_response.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class EnableWebhooksResponse(object): - """Implementation of the 'Enable Webhooks Response' model. Attributes: webhooks_enabled (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "webhooks_enabled": 'webhooks_enabled' + "webhooks_enabled": "webhooks_enabled", } _optionals = [ - 'webhooks_enabled', + "webhooks_enabled", ] - def __init__(self, - webhooks_enabled=APIHelper.SKIP, - additional_properties=None): - """Constructor for the EnableWebhooksResponse class""" - + def __init__( + self, + webhooks_enabled=APIHelper.SKIP, + additional_properties=None): + """Initialize a EnableWebhooksResponse instance.""" # Initialize members of the class if webhooks_enabled is not APIHelper.SKIP: - self.webhooks_enabled = webhooks_enabled + self.webhooks_enabled = webhooks_enabled # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - webhooks_enabled = dictionary.get("webhooks_enabled") if "webhooks_enabled" in dictionary.keys() else APIHelper.SKIP + webhooks_enabled =\ + dictionary.get("webhooks_enabled")\ + if "webhooks_enabled" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(webhooks_enabled, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'webhooks_enabled={(self.webhooks_enabled if hasattr(self, "webhooks_enabled") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _webhooks_enabled=( + self.webhooks_enabled + if hasattr(self, "webhooks_enabled") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"webhooks_enabled={_webhooks_enabled!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'webhooks_enabled={(self.webhooks_enabled if hasattr(self, "webhooks_enabled") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _webhooks_enabled=( + self.webhooks_enabled + if hasattr(self, "webhooks_enabled") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"webhooks_enabled={_webhooks_enabled!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/endpoint.py b/advancedbilling/models/endpoint.py index 792b949f..89605599 100644 --- a/advancedbilling/models/endpoint.py +++ b/advancedbilling/models/endpoint.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Endpoint(object): - """Implementation of the 'Endpoint' model. Attributes: @@ -18,50 +16,49 @@ class Endpoint(object): url (str): The model property of type str. site_id (int): The model property of type int. status (str): The model property of type str. - webhook_subscriptions (List[str]): The model property of type - List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + webhook_subscriptions (List[str]): The model property of type List[str]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "url": 'url', - "site_id": 'site_id', - "status": 'status', - "webhook_subscriptions": 'webhook_subscriptions' + "id": "id", + "url": "url", + "site_id": "site_id", + "status": "status", + "webhook_subscriptions": "webhook_subscriptions", } _optionals = [ - 'id', - 'url', - 'site_id', - 'status', - 'webhook_subscriptions', + "id", + "url", + "site_id", + "status", + "webhook_subscriptions", ] - def __init__(self, - id=APIHelper.SKIP, - url=APIHelper.SKIP, - site_id=APIHelper.SKIP, - status=APIHelper.SKIP, - webhook_subscriptions=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Endpoint class""" - + def __init__( + self, + id=APIHelper.SKIP, + url=APIHelper.SKIP, + site_id=APIHelper.SKIP, + status=APIHelper.SKIP, + webhook_subscriptions=APIHelper.SKIP, + additional_properties=None): + """Initialize a Endpoint instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if url is not APIHelper.SKIP: - self.url = url + self.url = url if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if status is not APIHelper.SKIP: - self.status = status + self.status = status if webhook_subscriptions is not APIHelper.SKIP: - self.webhook_subscriptions = webhook_subscriptions + self.webhook_subscriptions = webhook_subscriptions # Add additional model properties to the instance if additional_properties is None: @@ -71,7 +68,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -82,18 +79,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - url = dictionary.get("url") if dictionary.get("url") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP - webhook_subscriptions = dictionary.get("webhook_subscriptions") if dictionary.get("webhook_subscriptions") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + url =\ + dictionary.get("url")\ + if dictionary.get("url")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + webhook_subscriptions =\ + dictionary.get("webhook_subscriptions")\ + if dictionary.get("webhook_subscriptions")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, url, @@ -103,19 +117,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'url={(self.url if hasattr(self, "url") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'webhook_subscriptions={(self.webhook_subscriptions if hasattr(self, "webhook_subscriptions") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _url=( + self.url + if hasattr(self, "url") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _webhook_subscriptions=( + self.webhook_subscriptions + if hasattr(self, "webhook_subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"url={_url!r}, " + f"site_id={_site_id!r}, " + f"status={_status!r}, " + f"webhook_subscriptions={_webhook_subscriptions!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'url={(self.url if hasattr(self, "url") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'webhook_subscriptions={(self.webhook_subscriptions if hasattr(self, "webhook_subscriptions") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _url=( + self.url + if hasattr(self, "url") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _webhook_subscriptions=( + self.webhook_subscriptions + if hasattr(self, "webhook_subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"url={_url!s}, " + f"site_id={_site_id!s}, " + f"status={_status!s}, " + f"webhook_subscriptions={_webhook_subscriptions!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/endpoint_response.py b/advancedbilling/models/endpoint_response.py index 3f746af1..a1abc523 100644 --- a/advancedbilling/models/endpoint_response.py +++ b/advancedbilling/models/endpoint_response.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.endpoint import Endpoint +from advancedbilling.models.endpoint import ( + Endpoint, +) class EndpointResponse(object): - """Implementation of the 'Endpoint Response' model. Attributes: endpoint (Endpoint): The model property of type Endpoint. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "endpoint": 'endpoint' + "endpoint": "endpoint", } _optionals = [ - 'endpoint', + "endpoint", ] - def __init__(self, - endpoint=APIHelper.SKIP, - additional_properties=None): - """Constructor for the EndpointResponse class""" - + def __init__( + self, + endpoint=APIHelper.SKIP, + additional_properties=None): + """Initialize a EndpointResponse instance.""" # Initialize members of the class if endpoint is not APIHelper.SKIP: - self.endpoint = endpoint + self.endpoint = endpoint # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - endpoint = Endpoint.from_dictionary(dictionary.get('endpoint')) if 'endpoint' in dictionary.keys() else APIHelper.SKIP + endpoint =\ + Endpoint.from_dictionary( + dictionary.get("endpoint"))\ + if "endpoint" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(endpoint, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'endpoint={(self.endpoint if hasattr(self, "endpoint") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _endpoint=( + self.endpoint + if hasattr(self, "endpoint") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"endpoint={_endpoint!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'endpoint={(self.endpoint if hasattr(self, "endpoint") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _endpoint=( + self.endpoint + if hasattr(self, "endpoint") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"endpoint={_endpoint!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/errors.py b/advancedbilling/models/errors.py index 92115c92..2dbd80b0 100644 --- a/advancedbilling/models/errors.py +++ b/advancedbilling/models/errors.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Errors(object): - """Implementation of the 'Errors' model. Attributes: per_page (List[str]): The model property of type List[str]. price_point (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "per_page": 'per_page', - "price_point": 'price_point' + "per_page": "per_page", + "price_point": "price_point", } _optionals = [ - 'per_page', - 'price_point', + "per_page", + "price_point", ] - def __init__(self, - per_page=APIHelper.SKIP, - price_point=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Errors class""" - + def __init__( + self, + per_page=APIHelper.SKIP, + price_point=APIHelper.SKIP, + additional_properties=None): + """Initialize a Errors instance.""" # Initialize members of the class if per_page is not APIHelper.SKIP: - self.per_page = per_page + self.per_page = per_page if price_point is not APIHelper.SKIP: - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - per_page = dictionary.get("per_page") if dictionary.get("per_page") else APIHelper.SKIP - price_point = dictionary.get("price_point") if dictionary.get("price_point") else APIHelper.SKIP + per_page =\ + dictionary.get("per_page")\ + if dictionary.get("per_page")\ + else APIHelper.SKIP + price_point =\ + dictionary.get("price_point")\ + if dictionary.get("price_point")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(per_page, price_point, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!r}, ' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"per_page={_per_page!r}, " + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!s}, ' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"per_page={_per_page!s}, " + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/event.py b/advancedbilling/models/event.py index ab6c1d1e..b1860b88 100644 --- a/advancedbilling/models/event.py +++ b/advancedbilling/models/event.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.event_key import EventKey +from advancedbilling.models.event_key import ( + EventKey, +) class Event(object): - """Implementation of the 'Event' model. Attributes: @@ -21,35 +21,31 @@ class Event(object): subscription_id (int): The model property of type int. customer_id (int): The model property of type int. created_at (datetime): The model property of type datetime. - event_specific_data (SubscriptionProductChange | - SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | - ComponentAllocationChange | MeteredUsage | PrepaidUsage | - DunningStepReached | InvoiceIssued | PendingCancellationChange | - PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | - SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | - PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | - ItemPricePointChanged | CustomFieldValueChange | None): The schema - varies based on the event key. The key-to-event data mapping is as - follows: * `subscription_product_change` - - SubscriptionProductChange * `subscription_state_change` - - SubscriptionStateChange * `signup_success`, - `delayed_signup_creation_success`, `payment_success`, - `payment_failure`, `renewal_success`, `renewal_failure`, - `chargeback_lost`, `chargeback_accepted`, `chargeback_closed` - - PaymentRelatedEvents * `refund_success` - RefundSuccess * - `component_allocation_change` - ComponentAllocationChange * - `metered_usage` - MeteredUsage * `prepaid_usage` - PrepaidUsage * - `dunning_step_reached` - DunningStepReached * `invoice_issued` - - InvoiceIssued * `pending_cancellation_change` - - PendingCancellationChange * `prepaid_subscription_balance_changed` - - PrepaidSubscriptionBalanceChanged * - `subscription_group_signup_success` and - `subscription_group_signup_failure` - + event_specific_data (SubscriptionProductChange | SubscriptionStateChange | + PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | + MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | + PendingCancellationChange | PrepaidSubscriptionBalanceChanged | + ProformaInvoiceIssued | SubscriptionGroupSignupEventData | + CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | + PaymentCollectionMethodChanged | ItemPricePointChanged | + CustomFieldValueChange | None): The schema varies based on the event key. + The key-to-event data mapping is as follows: * + `subscription_product_change` - SubscriptionProductChange * + `subscription_state_change` - SubscriptionStateChange * `signup_success`, + `delayed_signup_creation_success`, `payment_success`, `payment_failure`, + `renewal_success`, `renewal_failure`, `chargeback_lost`, + `chargeback_accepted`, `chargeback_closed` - PaymentRelatedEvents * + `refund_success` - RefundSuccess * `component_allocation_change` - + ComponentAllocationChange * `metered_usage` - MeteredUsage * + `prepaid_usage` - PrepaidUsage * `dunning_step_reached` - + DunningStepReached * `invoice_issued` - InvoiceIssued * + `pending_cancellation_change` - PendingCancellationChange * + `prepaid_subscription_balance_changed` - + PrepaidSubscriptionBalanceChanged * `subscription_group_signup_success` + and `subscription_group_signup_failure` - SubscriptionGroupSignupEventData * `proforma_invoice_issued` - - ProformaInvoiceIssued * - `subscription_prepayment_account_balance_changed` - - PrepaymentAccountBalanceChanged * - `payment_collection_method_changed` - + ProformaInvoiceIssued * `subscription_prepayment_account_balance_changed` + - PrepaymentAccountBalanceChanged * `payment_collection_method_changed` - PaymentCollectionMethodChanged * `subscription_service_credit_account_balance_changed` - CreditAccountBalanceChanged * `item_price_point_changed` - @@ -58,13 +54,12 @@ class Event(object): `delayed_signup_creation_failure`, `billing_date_change`, `expiration_date_change`, `expiring_card`, `customer_update`, `customer_create`, `customer_delete`, `upgrade_downgrade_success`, - `upgrade_downgrade_failure`, `statement_closed`, - `statement_settled`, `subscription_card_update`, - `subscription_group_card_update`, + `upgrade_downgrade_failure`, `statement_closed`, `statement_settled`, + `subscription_card_update`, `subscription_group_card_update`, `subscription_bank_account_update`, `refund_failure`, - `upcoming_renewal_notice`, `trial_end_notice`, + `upcoming_renewal_notice`, `trial_end_notice`, `direct_debit_payment_paid_out`, `direct_debit_payment_rejected`, - `direct_debit_payment_pending`, `pending_payment_created`, + `direct_debit_payment_pending`, `pending_payment_created`, `pending_payment_failed`, `pending_payment_completed`, don't have event_specific_data defined, `renewal_success_recreated`, `renewal_failure_recreated`, `payment_success_recreated`, @@ -74,8 +69,7 @@ class Event(object): `subscription_group_paypal_account_update`, `subscription_customer_change`, `account_transaction_changed`, `go_cardless_payment_paid_out`, `go_cardless_payment_rejected`, - `go_cardless_payment_pending`, - `stripe_direct_debit_payment_paid_out`, + `go_cardless_payment_pending`, `stripe_direct_debit_payment_paid_out`, `stripe_direct_debit_payment_rejected`, `stripe_direct_debit_payment_pending`, `maxio_payments_direct_debit_payment_paid_out`, @@ -85,52 +79,54 @@ class Event(object): `subscription_removed_from_group`, `chargeback_opened`, `chargeback_lost`, `chargeback_accepted`, `chargeback_closed`, `chargeback_won`, `payment_collection_method_changed`, - `component_billing_date_changed`, - `subscription_term_renewal_scheduled`, + `component_billing_date_changed`, `subscription_term_renewal_scheduled`, `subscription_term_renewal_pending`, `subscription_term_renewal_activated`, `subscription_term_renewal_removed` they map to `null` instead. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "key": 'key', - "message": 'message', - "subscription_id": 'subscription_id', - "customer_id": 'customer_id', - "created_at": 'created_at', - "event_specific_data": 'event_specific_data' + "id": "id", + "key": "key", + "message": "message", + "subscription_id": "subscription_id", + "customer_id": "customer_id", + "created_at": "created_at", + "event_specific_data": "event_specific_data", } _nullables = [ - 'subscription_id', - 'customer_id', - 'event_specific_data', + "subscription_id", + "customer_id", + "event_specific_data", ] - def __init__(self, - id=None, - key=None, - message=None, - subscription_id=None, - customer_id=None, - created_at=None, - event_specific_data=None, - additional_properties=None): - """Constructor for the Event class""" - + def __init__( + self, + id=None, + key=None, + message=None, + subscription_id=None, + customer_id=None, + created_at=None, + event_specific_data=None, + additional_properties=None): + """Initialize a Event instance.""" # Initialize members of the class - self.id = id - self.key = key - self.message = message - self.subscription_id = subscription_id - self.customer_id = customer_id - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None - self.event_specific_data = event_specific_data + self.id = id + self.key = key + self.message = message + self.subscription_id = subscription_id + self.customer_id = customer_id + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None + self.event_specific_data = event_specific_data # Add additional model properties to the instance if additional_properties is None: @@ -140,7 +136,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -151,21 +147,48 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - key = dictionary.get("key") if dictionary.get("key") else None - message = dictionary.get("message") if dictionary.get("message") else None - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else None - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else None - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else None - event_specific_data = APIHelper.deserialize_union_type(UnionTypeLookUp.get('EventEventSpecificData'), dictionary.get('event_specific_data'), False) if dictionary.get('event_specific_data') is not None else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + key =\ + dictionary.get("key")\ + if dictionary.get("key")\ + else None + message =\ + dictionary.get("message")\ + if dictionary.get("message")\ + else None + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else None + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else None + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else None + event_specific_data = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("EventEventSpecificData"), + dictionary.get("event_specific_data"), + False)\ + if dictionary.get("event_specific_data") is not None\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, key, @@ -178,7 +201,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -189,62 +212,144 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.key, - type_callable=lambda value: EventKey.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.message, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.subscription_id, - type_callable=lambda value: isinstance(value, int), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.customer_id, - type_callable=lambda value: isinstance(value, int), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.created_at, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and UnionTypeLookUp.get('EventEventSpecificData').validate(dictionary.event_specific_data).is_valid + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.key, + type_callable=lambda value: + EventKey.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.message, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.subscription_id, + type_callable=lambda value: + isinstance( + value, + int, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.customer_id, + type_callable=lambda value: + isinstance( + value, + int, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.created_at, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and (UnionTypeLookUp.get("EventEventSpecificData") + .validate(dictionary.event_specific_data).is_valid) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('key'), - type_callable=lambda value: EventKey.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('message'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('subscription_id'), - type_callable=lambda value: isinstance(value, int), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('customer_id'), - type_callable=lambda value: isinstance(value, int), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('created_at'), - type_callable=lambda value: isinstance(value, str)) \ - and UnionTypeLookUp.get('EventEventSpecificData').validate(dictionary.get('event_specific_data')).is_valid + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("key"), + type_callable=lambda value: + EventKey.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("message"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("subscription_id"), + type_callable=lambda value: + isinstance( + value, + int, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("customer_id"), + type_callable=lambda value: + isinstance( + value, + int, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("created_at"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and (UnionTypeLookUp.get("EventEventSpecificData") + .validate(dictionary.get("event_specific_data")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'key={self.key!r}, ' - f'message={self.message!r}, ' - f'subscription_id={self.subscription_id!r}, ' - f'customer_id={self.customer_id!r}, ' - f'created_at={self.created_at!r}, ' - f'event_specific_data={self.event_specific_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _key=self.key + _message=self.message + _subscription_id=self.subscription_id + _customer_id=self.customer_id + _created_at=self.created_at + _event_specific_data=self.event_specific_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"key={_key!r}, " + f"message={_message!r}, " + f"subscription_id={_subscription_id!r}, " + f"customer_id={_customer_id!r}, " + f"created_at={_created_at!r}, " + f"event_specific_data={_event_specific_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'key={self.key!s}, ' - f'message={self.message!s}, ' - f'subscription_id={self.subscription_id!s}, ' - f'customer_id={self.customer_id!s}, ' - f'created_at={self.created_at!s}, ' - f'event_specific_data={self.event_specific_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _key=self.key + _message=self.message + _subscription_id=self.subscription_id + _customer_id=self.customer_id + _created_at=self.created_at + _event_specific_data=self.event_specific_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"key={_key!s}, " + f"message={_message!s}, " + f"subscription_id={_subscription_id!s}, " + f"customer_id={_customer_id!s}, " + f"created_at={_created_at!s}, " + f"event_specific_data={_event_specific_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/event_based_billing_segment_error.py b/advancedbilling/models/event_based_billing_segment_error.py index fd31e5df..5fbedb99 100644 --- a/advancedbilling/models/event_based_billing_segment_error.py +++ b/advancedbilling/models/event_based_billing_segment_error.py @@ -1,40 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class EventBasedBillingSegmentError(object): - """Implementation of the 'Event Based Billing Segment Error' model. Attributes: - segments (Dict[str, Any]): The key of the object would be a number (an - index in the request array) where the error occurred. In the value - object, the key represents the field and the value is an array - with error messages. In most cases, this object would contain just - one key. - additional_properties (Dict[str, object]): The additional properties - for the model. + segments (Dict[str, Any]): The key of the object would be a number (an index + in the request array) where the error occurred. In the value object, the + key represents the field and the value is an array with error messages. + In most cases, this object would contain just one key. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segments": 'segments' + "segments": "segments", } - def __init__(self, - segments=None, - additional_properties=None): - """Constructor for the EventBasedBillingSegmentError class""" - + def __init__( + self, + segments=None, + additional_properties=None): + """Initialize a EventBasedBillingSegmentError instance.""" # Initialize members of the class - self.segments = segments + self.segments = segments # Add additional model properties to the instance if additional_properties is None: @@ -44,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -55,24 +50,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - segments = dictionary.get("segments") if dictionary.get("segments") else None + segments =\ + dictionary.get("segments")\ + if dictionary.get("segments")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segments, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segments={self.segments!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segments=self.segments + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segments={self.segments!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segments=self.segments + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/event_key.py b/advancedbilling/models/event_key.py index 38bb640e..b1e60653 100644 --- a/advancedbilling/models/event_key.py +++ b/advancedbilling/models/event_key.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class EventKey(object): - """Implementation of the 'Event Key' enum. Attributes: @@ -56,10 +53,9 @@ class EventKey(object): PENDING_PAYMENT_FAILED: The enum member of type str. PENDING_PAYMENT_COMPLETED: The enum member of type str. PROFORMA_INVOICE_ISSUED: The enum member of type str. - SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED: The enum member of - type str. - SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED: The enum member - of type str. + SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED: The enum member of type str. + SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED: The enum member of type + str. CUSTOM_FIELD_VALUE_CHANGE: The enum member of type str. ITEM_PRICE_POINT_CHANGED: The enum member of type str. RENEWAL_SUCCESS_RECREATED: The enum member of type str. @@ -78,12 +74,9 @@ class EventKey(object): STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT: The enum member of type str. STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED: The enum member of type str. STRIPE_DIRECT_DEBIT_PAYMENT_PENDING: The enum member of type str. - MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT: The enum member of type - str. - MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED: The enum member of type - str. - MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING: The enum member of type - str. + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT: The enum member of type str. + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED: The enum member of type str. + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING: The enum member of type str. INVOICE_IN_COLLECTIONS_CANCELED: The enum member of type str. SUBSCRIPTION_ADDED_TO_GROUP: The enum member of type str. SUBSCRIPTION_REMOVED_FROM_GROUP: The enum member of type str. @@ -98,174 +91,212 @@ class EventKey(object): SUBSCRIPTION_TERM_RENEWAL_PENDING: The enum member of type str. SUBSCRIPTION_TERM_RENEWAL_ACTIVATED: The enum member of type str. SUBSCRIPTION_TERM_RENEWAL_REMOVED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['payment_success', 'payment_failure', 'signup_success', 'signup_failure', 'delayed_signup_creation_success', 'delayed_signup_creation_failure', 'billing_date_change', 'expiration_date_change', 'renewal_success', 'renewal_failure', 'subscription_state_change', 'subscription_product_change', 'pending_cancellation_change', 'expiring_card', 'customer_update', 'customer_create', 'customer_delete', 'component_allocation_change', 'metered_usage', 'prepaid_usage', 'upgrade_downgrade_success', 'upgrade_downgrade_failure', 'statement_closed', 'statement_settled', 'subscription_card_update', 'subscription_group_card_update', 'subscription_bank_account_update', 'refund_success', 'refund_failure', 'upcoming_renewal_notice', 'trial_end_notice', 'dunning_step_reached', 'invoice_issued', 'prepaid_subscription_balance_changed', 'subscription_group_signup_success', 'subscription_group_signup_failure', 'direct_debit_payment_paid_out', 'direct_debit_payment_rejected', 'direct_debit_payment_pending', 'pending_payment_created', 'pending_payment_failed', 'pending_payment_completed', 'proforma_invoice_issued', 'subscription_prepayment_account_balance_changed', 'subscription_service_credit_account_balance_changed', 'custom_field_value_change', 'item_price_point_changed', 'renewal_success_recreated', 'renewal_failure_recreated', 'payment_success_recreated', 'payment_failure_recreated', 'subscription_deletion', 'subscription_group_bank_account_update', 'subscription_paypal_account_update', 'subscription_group_paypal_account_update', 'subscription_customer_change', 'account_transaction_changed', 'go_cardless_payment_paid_out', 'go_cardless_payment_rejected', 'go_cardless_payment_pending', 'stripe_direct_debit_payment_paid_out', 'stripe_direct_debit_payment_rejected', 'stripe_direct_debit_payment_pending', 'maxio_payments_direct_debit_payment_paid_out', 'maxio_payments_direct_debit_payment_rejected', 'maxio_payments_direct_debit_payment_pending', 'invoice_in_collections_canceled', 'subscription_added_to_group', 'subscription_removed_from_group', 'chargeback_opened', 'chargeback_lost', 'chargeback_accepted', 'chargeback_closed', 'chargeback_won', 'payment_collection_method_changed', 'component_billing_date_changed', 'subscription_term_renewal_scheduled', 'subscription_term_renewal_pending', 'subscription_term_renewal_activated', 'subscription_term_renewal_removed'] - PAYMENT_SUCCESS = 'payment_success' - PAYMENT_FAILURE = 'payment_failure' + _all_values = ["payment_success", "payment_failure", "signup_success", + "signup_failure", "delayed_signup_creation_success", + "delayed_signup_creation_failure", "billing_date_change", + "expiration_date_change", "renewal_success", "renewal_failure", + "subscription_state_change", "subscription_product_change", + "pending_cancellation_change", "expiring_card", "customer_update", + "customer_create", "customer_delete", "component_allocation_change", + "metered_usage", "prepaid_usage", "upgrade_downgrade_success", + "upgrade_downgrade_failure", "statement_closed", "statement_settled", + "subscription_card_update", "subscription_group_card_update", + "subscription_bank_account_update", "refund_success", "refund_failure", + "upcoming_renewal_notice", "trial_end_notice", "dunning_step_reached", + "invoice_issued", "prepaid_subscription_balance_changed", + "subscription_group_signup_success", "subscription_group_signup_failure", + "direct_debit_payment_paid_out", "direct_debit_payment_rejected", + "direct_debit_payment_pending", "pending_payment_created", + "pending_payment_failed", "pending_payment_completed", + "proforma_invoice_issued", "subscription_prepayment_account_balance_changed", + "subscription_service_credit_account_balance_changed", + "custom_field_value_change", "item_price_point_changed", + "renewal_success_recreated", "renewal_failure_recreated", + "payment_success_recreated", "payment_failure_recreated", + "subscription_deletion", "subscription_group_bank_account_update", + "subscription_paypal_account_update", + "subscription_group_paypal_account_update", "subscription_customer_change", + "account_transaction_changed", "go_cardless_payment_paid_out", + "go_cardless_payment_rejected", "go_cardless_payment_pending", + "stripe_direct_debit_payment_paid_out", + "stripe_direct_debit_payment_rejected", "stripe_direct_debit_payment_pending", + "maxio_payments_direct_debit_payment_paid_out", + "maxio_payments_direct_debit_payment_rejected", + "maxio_payments_direct_debit_payment_pending", + "invoice_in_collections_canceled", "subscription_added_to_group", + "subscription_removed_from_group", "chargeback_opened", "chargeback_lost", + "chargeback_accepted", "chargeback_closed", "chargeback_won", + "payment_collection_method_changed", "component_billing_date_changed", + "subscription_term_renewal_scheduled", "subscription_term_renewal_pending", + "subscription_term_renewal_activated", "subscription_term_renewal_removed"] + PAYMENT_SUCCESS = "payment_success" - SIGNUP_SUCCESS = 'signup_success' + PAYMENT_FAILURE = "payment_failure" - SIGNUP_FAILURE = 'signup_failure' + SIGNUP_SUCCESS = "signup_success" - DELAYED_SIGNUP_CREATION_SUCCESS = 'delayed_signup_creation_success' + SIGNUP_FAILURE = "signup_failure" - DELAYED_SIGNUP_CREATION_FAILURE = 'delayed_signup_creation_failure' + DELAYED_SIGNUP_CREATION_SUCCESS = "delayed_signup_creation_success" - BILLING_DATE_CHANGE = 'billing_date_change' + DELAYED_SIGNUP_CREATION_FAILURE = "delayed_signup_creation_failure" - EXPIRATION_DATE_CHANGE = 'expiration_date_change' + BILLING_DATE_CHANGE = "billing_date_change" - RENEWAL_SUCCESS = 'renewal_success' + EXPIRATION_DATE_CHANGE = "expiration_date_change" - RENEWAL_FAILURE = 'renewal_failure' + RENEWAL_SUCCESS = "renewal_success" - SUBSCRIPTION_STATE_CHANGE = 'subscription_state_change' + RENEWAL_FAILURE = "renewal_failure" - SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change' + SUBSCRIPTION_STATE_CHANGE = "subscription_state_change" - PENDING_CANCELLATION_CHANGE = 'pending_cancellation_change' + SUBSCRIPTION_PRODUCT_CHANGE = "subscription_product_change" - EXPIRING_CARD = 'expiring_card' + PENDING_CANCELLATION_CHANGE = "pending_cancellation_change" - CUSTOMER_UPDATE = 'customer_update' + EXPIRING_CARD = "expiring_card" - CUSTOMER_CREATE = 'customer_create' + CUSTOMER_UPDATE = "customer_update" - CUSTOMER_DELETE = 'customer_delete' + CUSTOMER_CREATE = "customer_create" - COMPONENT_ALLOCATION_CHANGE = 'component_allocation_change' + CUSTOMER_DELETE = "customer_delete" - METERED_USAGE = 'metered_usage' + COMPONENT_ALLOCATION_CHANGE = "component_allocation_change" - PREPAID_USAGE = 'prepaid_usage' + METERED_USAGE = "metered_usage" - UPGRADE_DOWNGRADE_SUCCESS = 'upgrade_downgrade_success' + PREPAID_USAGE = "prepaid_usage" - UPGRADE_DOWNGRADE_FAILURE = 'upgrade_downgrade_failure' + UPGRADE_DOWNGRADE_SUCCESS = "upgrade_downgrade_success" - STATEMENT_CLOSED = 'statement_closed' + UPGRADE_DOWNGRADE_FAILURE = "upgrade_downgrade_failure" - STATEMENT_SETTLED = 'statement_settled' + STATEMENT_CLOSED = "statement_closed" - SUBSCRIPTION_CARD_UPDATE = 'subscription_card_update' + STATEMENT_SETTLED = "statement_settled" - SUBSCRIPTION_GROUP_CARD_UPDATE = 'subscription_group_card_update' + SUBSCRIPTION_CARD_UPDATE = "subscription_card_update" - SUBSCRIPTION_BANK_ACCOUNT_UPDATE = 'subscription_bank_account_update' + SUBSCRIPTION_GROUP_CARD_UPDATE = "subscription_group_card_update" - REFUND_SUCCESS = 'refund_success' + SUBSCRIPTION_BANK_ACCOUNT_UPDATE = "subscription_bank_account_update" - REFUND_FAILURE = 'refund_failure' + REFUND_SUCCESS = "refund_success" - UPCOMING_RENEWAL_NOTICE = 'upcoming_renewal_notice' + REFUND_FAILURE = "refund_failure" - TRIAL_END_NOTICE = 'trial_end_notice' + UPCOMING_RENEWAL_NOTICE = "upcoming_renewal_notice" - DUNNING_STEP_REACHED = 'dunning_step_reached' + TRIAL_END_NOTICE = "trial_end_notice" - INVOICE_ISSUED = 'invoice_issued' + DUNNING_STEP_REACHED = "dunning_step_reached" - PREPAID_SUBSCRIPTION_BALANCE_CHANGED = 'prepaid_subscription_balance_changed' + INVOICE_ISSUED = "invoice_issued" - SUBSCRIPTION_GROUP_SIGNUP_SUCCESS = 'subscription_group_signup_success' + PREPAID_SUBSCRIPTION_BALANCE_CHANGED = "prepaid_subscription_balance_changed" - SUBSCRIPTION_GROUP_SIGNUP_FAILURE = 'subscription_group_signup_failure' + SUBSCRIPTION_GROUP_SIGNUP_SUCCESS = "subscription_group_signup_success" - DIRECT_DEBIT_PAYMENT_PAID_OUT = 'direct_debit_payment_paid_out' + SUBSCRIPTION_GROUP_SIGNUP_FAILURE = "subscription_group_signup_failure" - DIRECT_DEBIT_PAYMENT_REJECTED = 'direct_debit_payment_rejected' + DIRECT_DEBIT_PAYMENT_PAID_OUT = "direct_debit_payment_paid_out" - DIRECT_DEBIT_PAYMENT_PENDING = 'direct_debit_payment_pending' + DIRECT_DEBIT_PAYMENT_REJECTED = "direct_debit_payment_rejected" - PENDING_PAYMENT_CREATED = 'pending_payment_created' + DIRECT_DEBIT_PAYMENT_PENDING = "direct_debit_payment_pending" - PENDING_PAYMENT_FAILED = 'pending_payment_failed' + PENDING_PAYMENT_CREATED = "pending_payment_created" - PENDING_PAYMENT_COMPLETED = 'pending_payment_completed' + PENDING_PAYMENT_FAILED = "pending_payment_failed" - PROFORMA_INVOICE_ISSUED = 'proforma_invoice_issued' + PENDING_PAYMENT_COMPLETED = "pending_payment_completed" - SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED = 'subscription_prepayment_account_balance_changed' + PROFORMA_INVOICE_ISSUED = "proforma_invoice_issued" - SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED = 'subscription_service_credit_account_balance_changed' + SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED = "subscription_prepayment_account_balance_changed" # noqa: E501 - CUSTOM_FIELD_VALUE_CHANGE = 'custom_field_value_change' + SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED = "subscription_service_credit_account_balance_changed" # noqa: E501 - ITEM_PRICE_POINT_CHANGED = 'item_price_point_changed' + CUSTOM_FIELD_VALUE_CHANGE = "custom_field_value_change" - RENEWAL_SUCCESS_RECREATED = 'renewal_success_recreated' + ITEM_PRICE_POINT_CHANGED = "item_price_point_changed" - RENEWAL_FAILURE_RECREATED = 'renewal_failure_recreated' + RENEWAL_SUCCESS_RECREATED = "renewal_success_recreated" - PAYMENT_SUCCESS_RECREATED = 'payment_success_recreated' + RENEWAL_FAILURE_RECREATED = "renewal_failure_recreated" - PAYMENT_FAILURE_RECREATED = 'payment_failure_recreated' + PAYMENT_SUCCESS_RECREATED = "payment_success_recreated" - SUBSCRIPTION_DELETION = 'subscription_deletion' + PAYMENT_FAILURE_RECREATED = "payment_failure_recreated" - SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE = 'subscription_group_bank_account_update' + SUBSCRIPTION_DELETION = "subscription_deletion" - SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE = 'subscription_paypal_account_update' + SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE = "subscription_group_bank_account_update" - SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE = 'subscription_group_paypal_account_update' + SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE = "subscription_paypal_account_update" - SUBSCRIPTION_CUSTOMER_CHANGE = 'subscription_customer_change' + SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE = "subscription_group_paypal_account_update" # noqa: E501 - ACCOUNT_TRANSACTION_CHANGED = 'account_transaction_changed' + SUBSCRIPTION_CUSTOMER_CHANGE = "subscription_customer_change" - GO_CARDLESS_PAYMENT_PAID_OUT = 'go_cardless_payment_paid_out' + ACCOUNT_TRANSACTION_CHANGED = "account_transaction_changed" - GO_CARDLESS_PAYMENT_REJECTED = 'go_cardless_payment_rejected' + GO_CARDLESS_PAYMENT_PAID_OUT = "go_cardless_payment_paid_out" - GO_CARDLESS_PAYMENT_PENDING = 'go_cardless_payment_pending' + GO_CARDLESS_PAYMENT_REJECTED = "go_cardless_payment_rejected" - STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT = 'stripe_direct_debit_payment_paid_out' + GO_CARDLESS_PAYMENT_PENDING = "go_cardless_payment_pending" - STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED = 'stripe_direct_debit_payment_rejected' + STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT = "stripe_direct_debit_payment_paid_out" - STRIPE_DIRECT_DEBIT_PAYMENT_PENDING = 'stripe_direct_debit_payment_pending' + STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED = "stripe_direct_debit_payment_rejected" - MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT = 'maxio_payments_direct_debit_payment_paid_out' + STRIPE_DIRECT_DEBIT_PAYMENT_PENDING = "stripe_direct_debit_payment_pending" - MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED = 'maxio_payments_direct_debit_payment_rejected' + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT = "maxio_payments_direct_debit_payment_paid_out" # noqa: E501 - MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING = 'maxio_payments_direct_debit_payment_pending' + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED = "maxio_payments_direct_debit_payment_rejected" # noqa: E501 - INVOICE_IN_COLLECTIONS_CANCELED = 'invoice_in_collections_canceled' + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING = "maxio_payments_direct_debit_payment_pending" # noqa: E501 - SUBSCRIPTION_ADDED_TO_GROUP = 'subscription_added_to_group' + INVOICE_IN_COLLECTIONS_CANCELED = "invoice_in_collections_canceled" - SUBSCRIPTION_REMOVED_FROM_GROUP = 'subscription_removed_from_group' + SUBSCRIPTION_ADDED_TO_GROUP = "subscription_added_to_group" - CHARGEBACK_OPENED = 'chargeback_opened' + SUBSCRIPTION_REMOVED_FROM_GROUP = "subscription_removed_from_group" - CHARGEBACK_LOST = 'chargeback_lost' + CHARGEBACK_OPENED = "chargeback_opened" - CHARGEBACK_ACCEPTED = 'chargeback_accepted' + CHARGEBACK_LOST = "chargeback_lost" - CHARGEBACK_CLOSED = 'chargeback_closed' + CHARGEBACK_ACCEPTED = "chargeback_accepted" - CHARGEBACK_WON = 'chargeback_won' + CHARGEBACK_CLOSED = "chargeback_closed" - PAYMENT_COLLECTION_METHOD_CHANGED = 'payment_collection_method_changed' + CHARGEBACK_WON = "chargeback_won" - COMPONENT_BILLING_DATE_CHANGED = 'component_billing_date_changed' + PAYMENT_COLLECTION_METHOD_CHANGED = "payment_collection_method_changed" - SUBSCRIPTION_TERM_RENEWAL_SCHEDULED = 'subscription_term_renewal_scheduled' + COMPONENT_BILLING_DATE_CHANGED = "component_billing_date_changed" - SUBSCRIPTION_TERM_RENEWAL_PENDING = 'subscription_term_renewal_pending' + SUBSCRIPTION_TERM_RENEWAL_SCHEDULED = "subscription_term_renewal_scheduled" - SUBSCRIPTION_TERM_RENEWAL_ACTIVATED = 'subscription_term_renewal_activated' + SUBSCRIPTION_TERM_RENEWAL_PENDING = "subscription_term_renewal_pending" - SUBSCRIPTION_TERM_RENEWAL_REMOVED = 'subscription_term_renewal_removed' + SUBSCRIPTION_TERM_RENEWAL_ACTIVATED = "subscription_term_renewal_activated" + + SUBSCRIPTION_TERM_RENEWAL_REMOVED = "subscription_term_renewal_removed" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -275,9 +306,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/event_response.py b/advancedbilling/models/event_response.py index 647d5950..cf452d2b 100644 --- a/advancedbilling/models/event_response.py +++ b/advancedbilling/models/event_response.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.models.event import Event class EventResponse(object): - """Implementation of the 'Event Response' model. Attributes: event (Event): The model property of type Event. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "event": 'event' + "event": "event", } - def __init__(self, - event=None, - additional_properties=None): - """Constructor for the EventResponse class""" - + def __init__( + self, + event=None, + additional_properties=None): + """Initialize a EventResponse instance.""" # Initialize members of the class - self.event = event + self.event = event # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +50,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - event = Event.from_dictionary(dictionary.get('event')) if dictionary.get('event') else None + event =\ + Event.from_dictionary( + dictionary.get("event"))\ + if dictionary.get("event") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(event, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'event={self.event!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _event=self.event + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event={_event!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'event={self.event!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _event=self.event + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event={_event!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/expiration_interval_unit.py b/advancedbilling/models/expiration_interval_unit.py index 3f3bf45b..58b5df9d 100644 --- a/advancedbilling/models/expiration_interval_unit.py +++ b/advancedbilling/models/expiration_interval_unit.py @@ -1,35 +1,33 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ExpirationIntervalUnit(object): - """Implementation of the 'Expiration Interval Unit' enum. Attributes: DAY: The enum member of type str. MONTH: The enum member of type str. NEVER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['day', 'month', 'never'] - DAY = 'day' - MONTH = 'month' + _all_values = ["day", "month", "never"] + DAY = "day" - NEVER = 'never' + MONTH = "month" + + NEVER = "never" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -39,9 +37,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/failed_payment_action.py b/advancedbilling/models/failed_payment_action.py index a25202f4..039349b4 100644 --- a/advancedbilling/models/failed_payment_action.py +++ b/advancedbilling/models/failed_payment_action.py @@ -1,47 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class FailedPaymentAction(object): - """Implementation of the 'Failed Payment Action' enum. Action taken when payment for an invoice fails: - - `leave_open_invoice` - prepayments and credits applied to invoice; - invoice status set to "open"; email sent to the customer for the issued - invoice (if setting applies); payment failure recorded in the invoice - history. This is the default option. - - `rollback_to_pending` - prepayments and credits not applied; invoice - remains in "pending" status; no email sent to the customer; payment - failure recorded in the invoice history. - - `initiate_dunning` - prepayments and credits applied to the invoice; - invoice status set to "open"; email sent to the customer for the issued - invoice (if setting applies); payment failure recorded in the invoice - history; subscription will most likely go into "past_due" or "canceled" - state (depending upon net terms and dunning settings). + - `leave_open_invoice` - prepayments and credits applied to invoice; invoice + status set to "open"; email sent to the customer for the issued invoice (if + setting applies); payment failure recorded in the invoice history. This is the + default option. + - `rollback_to_pending` - prepayments and credits not applied; invoice remains in + "pending" status; no email sent to the customer; payment failure recorded in the + invoice history. + - `initiate_dunning` - prepayments and credits applied to the invoice; invoice + status set to "open"; email sent to the customer for the issued invoice (if + setting applies); payment failure recorded in the invoice history; subscription + will most likely go into "past_due" or "canceled" state (depending upon net + terms and dunning settings). Attributes: LEAVE_OPEN_INVOICE: The enum member of type str. ROLLBACK_TO_PENDING: The enum member of type str. INITIATE_DUNNING: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - LEAVE_OPEN_INVOICE = 'leave_open_invoice' - ROLLBACK_TO_PENDING = 'rollback_to_pending' + LEAVE_OPEN_INVOICE = "leave_open_invoice" + + ROLLBACK_TO_PENDING = "rollback_to_pending" - INITIATE_DUNNING = 'initiate_dunning' + INITIATE_DUNNING = "initiate_dunning" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/failed_payment_event.py b/advancedbilling/models/failed_payment_event.py index a3791400..fbbd4497 100644 --- a/advancedbilling/models/failed_payment_event.py +++ b/advancedbilling/models/failed_payment_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.failed_payment_event_data import FailedPaymentEventData +from advancedbilling.models.failed_payment_event_data import ( + FailedPaymentEventData, +) from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) class FailedPaymentEvent(object): - """Implementation of the 'Failed Payment Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (FailedPaymentEventData): Example schema for an - `failed_payment` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (FailedPaymentEventData): Example schema for an `failed_payment` + event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='failed_payment', - event_data=None, - additional_properties=None): - """Constructor for the FailedPaymentEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="failed_payment", + event_data=None, + additional_properties=None): + """Initialize a FailedPaymentEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'failed_payment' - event_data = FailedPaymentEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "failed_payment" + event_data =\ + FailedPaymentEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: FailedPaymentEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + FailedPaymentEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: FailedPaymentEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + FailedPaymentEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/failed_payment_event_data.py b/advancedbilling/models/failed_payment_event_data.py index 172a7182..083fad0a 100644 --- a/advancedbilling/models/failed_payment_event_data.py +++ b/advancedbilling/models/failed_payment_event_data.py @@ -1,68 +1,66 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType +from advancedbilling.models.invoice_payment_method_type import ( + InvoicePaymentMethodType, +) class FailedPaymentEventData(object): - """Implementation of the 'Failed Payment Event Data' model. Example schema for an `failed_payment` event Attributes: - amount_in_cents (int): The monetary value of the payment, expressed in - cents. - applied_amount (int): The monetary value of the payment, expressed in - dollars. + amount_in_cents (int): The monetary value of the payment, expressed in cents. + applied_amount (int): The monetary value of the payment, expressed in dollars. memo (str): The memo passed when the payment was created. payment_method (InvoicePaymentMethodType): The model property of type InvoicePaymentMethodType. transaction_id (int): The transaction ID of the failed payment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount_in_cents": 'amount_in_cents', - "applied_amount": 'applied_amount', - "payment_method": 'payment_method', - "transaction_id": 'transaction_id', - "memo": 'memo' + "amount_in_cents": "amount_in_cents", + "applied_amount": "applied_amount", + "payment_method": "payment_method", + "transaction_id": "transaction_id", + "memo": "memo", } _optionals = [ - 'memo', + "memo", ] _nullables = [ - 'memo', + "memo", ] - def __init__(self, - amount_in_cents=None, - applied_amount=None, - payment_method=None, - transaction_id=None, - memo=APIHelper.SKIP, - additional_properties=None): - """Constructor for the FailedPaymentEventData class""" - + def __init__( + self, + amount_in_cents=None, + applied_amount=None, + payment_method=None, + transaction_id=None, + memo=APIHelper.SKIP, + additional_properties=None): + """Initialize a FailedPaymentEventData instance.""" # Initialize members of the class - self.amount_in_cents = amount_in_cents - self.applied_amount = applied_amount + self.amount_in_cents = amount_in_cents + self.applied_amount = applied_amount if memo is not APIHelper.SKIP: - self.memo = memo - self.payment_method = payment_method - self.transaction_id = transaction_id + self.memo = memo + self.payment_method = payment_method + self.transaction_id = transaction_id # Add additional model properties to the instance if additional_properties is None: @@ -72,7 +70,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -83,18 +81,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else None - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else None - payment_method = dictionary.get("payment_method") if dictionary.get("payment_method") else None - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else None - memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else None + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else None + payment_method =\ + dictionary.get("payment_method")\ + if dictionary.get("payment_method")\ + else None + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else None + memo =\ + dictionary.get("memo")\ + if "memo" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount_in_cents, applied_amount, @@ -105,7 +120,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -116,43 +131,104 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.amount_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.applied_amount, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.payment_method, - type_callable=lambda value: InvoicePaymentMethodType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.transaction_id, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.amount_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.applied_amount, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.payment_method, + type_callable=lambda value: + InvoicePaymentMethodType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.transaction_id, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('amount_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('applied_amount'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('payment_method'), - type_callable=lambda value: InvoicePaymentMethodType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('transaction_id'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("amount_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("applied_amount"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("payment_method"), + type_callable=lambda value: + InvoicePaymentMethodType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("transaction_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount_in_cents={self.amount_in_cents!r}, ' - f'applied_amount={self.applied_amount!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'payment_method={self.payment_method!r}, ' - f'transaction_id={self.transaction_id!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount_in_cents=self.amount_in_cents + _applied_amount=self.applied_amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _payment_method=self.payment_method + _transaction_id=self.transaction_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount_in_cents={_amount_in_cents!r}, " + f"applied_amount={_applied_amount!r}, " + f"memo={_memo!r}, " + f"payment_method={_payment_method!r}, " + f"transaction_id={_transaction_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount_in_cents={self.amount_in_cents!s}, ' - f'applied_amount={self.applied_amount!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'payment_method={self.payment_method!s}, ' - f'transaction_id={self.transaction_id!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount_in_cents=self.amount_in_cents + _applied_amount=self.applied_amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _payment_method=self.payment_method + _transaction_id=self.transaction_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount_in_cents={_amount_in_cents!s}, " + f"applied_amount={_applied_amount!s}, " + f"memo={_memo!s}, " + f"payment_method={_payment_method!s}, " + f"transaction_id={_transaction_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/first_charge_type.py b/advancedbilling/models/first_charge_type.py index 0fa8679a..5cfa70d1 100644 --- a/advancedbilling/models/first_charge_type.py +++ b/advancedbilling/models/first_charge_type.py @@ -1,35 +1,33 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class FirstChargeType(object): - """Implementation of the 'First Charge Type' enum. Attributes: PRORATED: The enum member of type str. IMMEDIATE: The enum member of type str. DELAYED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['prorated', 'immediate', 'delayed'] - PRORATED = 'prorated' - IMMEDIATE = 'immediate' + _all_values = ["prorated", "immediate", "delayed"] + PRORATED = "prorated" - DELAYED = 'delayed' + IMMEDIATE = "immediate" + + DELAYED = "delayed" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -39,9 +37,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/full_subscription_group_response.py b/advancedbilling/models/full_subscription_group_response.py index 6d5558ed..238e805a 100644 --- a/advancedbilling/models/full_subscription_group_response.py +++ b/advancedbilling/models/full_subscription_group_response.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_group_balances import SubscriptionGroupBalances -from advancedbilling.models.subscription_group_customer import SubscriptionGroupCustomer +from advancedbilling.models.subscription_group_balances import ( + SubscriptionGroupBalances, +) +from advancedbilling.models.subscription_group_customer import ( + SubscriptionGroupCustomer, +) class FullSubscriptionGroupResponse(object): - """Implementation of the 'Full Subscription Group Response' model. Attributes: @@ -23,154 +25,152 @@ class FullSubscriptionGroupResponse(object): subscription_ids (List[int]): The model property of type List[int]. primary_subscription_id (int): The model property of type int. next_assessment_at (datetime): The model property of type datetime. - state (SubscriptionState): The state of a subscription. * **Live - States** * `active` - A normal, active subscription. It is not - in a trial and is paid and up to date. * `assessing` - An - internal (transient) state that indicates a subscription is in the - middle of periodic assessment. Do not base any access decisions in - your app on this state, as it may not always be exposed. * - `pending` - An internal (transient) state that indicates a - subscription is in the creation process. Do not base any access - decisions in your app on this state, as it may not always be - exposed. * `trialing` - A subscription in trialing state has a - valid trial subscription. This type of subscription may transition - to active once payment is received when the trial has ended. - Otherwise, it may go to a Problem or End of Life state. * - `paused` - An internal state that indicates that your account with - Advanced Billing is in arrears. * **Problem States** * - `past_due` - Indicates that the most recent payment has failed, - and payment is past due for this subscription. If you have enabled - our automated dunning, this subscription will be in the dunning - process (additional status and callbacks from the dunning process - will be available in the future). If you are handling dunning and - payment updates yourself, you will want to use this state to - initiate a payment update from your customers. * - `soft_failure` - Indicates that normal assessment/processing of - the subscription has failed for a reason that cannot be fixed by - the Customer. For example, a Soft Fail may result from a timeout - at the gateway or incorrect credentials on your part. The - subscriptions should be retried automatically. An interface is - being built for you to review problems resulting from these events - to take manual action when needed. * `unpaid` - Indicates an - unpaid subscription. A subscription is marked unpaid if the retry - period expires and you have configured your - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) settings to have a Final Action of `mark the - subscription unpaid`. * **End of Life States** * `canceled` - - Indicates a canceled subscription. This may happen at your request - (via the API or the web interface) or due to the expiration of the - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) process without payment. See the - [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109 - 503629-Reactivating-and-Resuming) documentation for info on how to - restart a canceled subscription. While a subscription is - canceled, its period will not advance, it will not accrue any new - charges, and Advanced Billing will not attempt to collect the - overdue balance. * `expired` - Indicates a subscription that - has expired due to running its normal life cycle. Some products - may be configured to have an expiration period. An expired - subscription then is one that stayed active until it fulfilled its - full period. * `failed_to_create` - Indicates that signup has - failed. (You may see this state in a signup_failure webhook.) - * `on_hold` - Indicates that a subscription’s billing has been - temporarily stopped. While it is expected that the subscription - will resume and return to active status, this is still treated as - an “End of Life” state because the customer is not paying for - services during this time. * `suspended` - Indicates that a - prepaid subscription has used up all their prepayment balance. If - a prepayment is applied, it will return to an active state. * - `trial_ended` - A subscription in a trial_ended state is a - subscription that completed a no-obligation trial and did not have - a card on file at the expiration of the trial period. See [Product - Pricing – No Obligation - Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869- - Product-Editing) for more details. See [Subscription - States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853- - Subscription-States) for more info about subscription states and - state transitions. + state (SubscriptionState): The state of a subscription. * **Live States** + * `active` - A normal, active subscription. It is not in a trial and is + paid and up to date. * `assessing` - An internal (transient) state + that indicates a subscription is in the middle of periodic assessment. Do + not base any access decisions in your app on this state, as it may not + always be exposed. * `pending` - An internal (transient) state that + indicates a subscription is in the creation process. Do not base any + access decisions in your app on this state, as it may not always be + exposed. * `trialing` - A subscription in trialing state has a valid + trial subscription. This type of subscription may transition to active + once payment is received when the trial has ended. Otherwise, it may go + to a Problem or End of Life state. * `paused` - An internal state + that indicates that your account with Advanced Billing is in arrears. * + **Problem States** * `past_due` - Indicates that the most recent + payment has failed, and payment is past due for this subscription. If you + have enabled our automated dunning, this subscription will be in the + dunning process (additional status and callbacks from the dunning process + will be available in the future). If you are handling dunning and payment + updates yourself, you will want to use this state to initiate a payment + update from your customers. * `soft_failure` - Indicates that normal + assessment/processing of the subscription has failed for a reason that + cannot be fixed by the Customer. For example, a Soft Fail may result from + a timeout at the gateway or incorrect credentials on your part. The + subscriptions should be retried automatically. An interface is being + built for you to review problems resulting from these events to take + manual action when needed. * `unpaid` - Indicates an unpaid + subscription. A subscription is marked unpaid if the retry period expires + and you have configured your + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) settings to have a Final Action of `mark the subscription + unpaid`. * **End of Life States** * `canceled` - Indicates a canceled + subscription. This may happen at your request (via the API or the web + interface) or due to the expiration of the + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) process without payment. See the + [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629- + Reactivating-and-Resuming) documentation for info on how to restart a + canceled subscription. While a subscription is canceled, its period + will not advance, it will not accrue any new charges, and Advanced + Billing will not attempt to collect the overdue balance. * `expired` + - Indicates a subscription that has expired due to running its normal + life cycle. Some products may be configured to have an expiration period. + An expired subscription then is one that stayed active until it fulfilled + its full period. * `failed_to_create` - Indicates that signup has + failed. (You may see this state in a signup_failure webhook.) * + `on_hold` - Indicates that a subscription’s billing has been temporarily + stopped. While it is expected that the subscription will resume and + return to active status, this is still treated as an “End of Life” state + because the customer is not paying for services during this time. * + `suspended` - Indicates that a prepaid subscription has used up all their + prepayment balance. If a prepayment is applied, it will return to an + active state. * `trial_ended` - A subscription in a trial_ended state + is a subscription that completed a no-obligation trial and did not have a + card on file at the expiration of the trial period. See [Product Pricing + – No Obligation + Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product + -Editing) for more details. See [Subscription + States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri + ption-States) for more info about subscription states and state + transitions. cancel_at_end_of_period (bool): The model property of type bool. current_billing_amount_in_cents (int): The model property of type int. customer (SubscriptionGroupCustomer): The model property of type SubscriptionGroupCustomer. - account_balances (SubscriptionGroupBalances): The model property of - type SubscriptionGroupBalances. - additional_properties (Dict[str, object]): The additional properties - for the model. + account_balances (SubscriptionGroupBalances): The model property of type + SubscriptionGroupBalances. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "scheme": 'scheme', - "customer_id": 'customer_id', - "payment_profile_id": 'payment_profile_id', - "subscription_ids": 'subscription_ids', - "primary_subscription_id": 'primary_subscription_id', - "next_assessment_at": 'next_assessment_at', - "state": 'state', - "cancel_at_end_of_period": 'cancel_at_end_of_period', - "current_billing_amount_in_cents": 'current_billing_amount_in_cents', - "customer": 'customer', - "account_balances": 'account_balances' + "uid": "uid", + "scheme": "scheme", + "customer_id": "customer_id", + "payment_profile_id": "payment_profile_id", + "subscription_ids": "subscription_ids", + "primary_subscription_id": "primary_subscription_id", + "next_assessment_at": "next_assessment_at", + "state": "state", + "cancel_at_end_of_period": "cancel_at_end_of_period", + "current_billing_amount_in_cents": "current_billing_amount_in_cents", + "customer": "customer", + "account_balances": "account_balances", } _optionals = [ - 'uid', - 'scheme', - 'customer_id', - 'payment_profile_id', - 'subscription_ids', - 'primary_subscription_id', - 'next_assessment_at', - 'state', - 'cancel_at_end_of_period', - 'current_billing_amount_in_cents', - 'customer', - 'account_balances', + "uid", + "scheme", + "customer_id", + "payment_profile_id", + "subscription_ids", + "primary_subscription_id", + "next_assessment_at", + "state", + "cancel_at_end_of_period", + "current_billing_amount_in_cents", + "customer", + "account_balances", ] - def __init__(self, - uid=APIHelper.SKIP, - scheme=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - subscription_ids=APIHelper.SKIP, - primary_subscription_id=APIHelper.SKIP, - next_assessment_at=APIHelper.SKIP, - state=APIHelper.SKIP, - cancel_at_end_of_period=APIHelper.SKIP, - current_billing_amount_in_cents=APIHelper.SKIP, - customer=APIHelper.SKIP, - account_balances=APIHelper.SKIP, - additional_properties=None): - """Constructor for the FullSubscriptionGroupResponse class""" - + def __init__( + self, + uid=APIHelper.SKIP, + scheme=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + subscription_ids=APIHelper.SKIP, + primary_subscription_id=APIHelper.SKIP, + next_assessment_at=APIHelper.SKIP, + state=APIHelper.SKIP, + cancel_at_end_of_period=APIHelper.SKIP, + current_billing_amount_in_cents=APIHelper.SKIP, + customer=APIHelper.SKIP, + account_balances=APIHelper.SKIP, + additional_properties=None): + """Initialize a FullSubscriptionGroupResponse instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if scheme is not APIHelper.SKIP: - self.scheme = scheme + self.scheme = scheme if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if subscription_ids is not APIHelper.SKIP: - self.subscription_ids = subscription_ids + self.subscription_ids = subscription_ids if primary_subscription_id is not APIHelper.SKIP: - self.primary_subscription_id = primary_subscription_id + self.primary_subscription_id = primary_subscription_id if next_assessment_at is not APIHelper.SKIP: - self.next_assessment_at = APIHelper.apply_datetime_converter(next_assessment_at, APIHelper.RFC3339DateTime) if next_assessment_at else None + self.next_assessment_at =\ + APIHelper.apply_datetime_converter( + next_assessment_at, APIHelper.RFC3339DateTime)\ + if next_assessment_at else None if state is not APIHelper.SKIP: - self.state = state + self.state = state if cancel_at_end_of_period is not APIHelper.SKIP: - self.cancel_at_end_of_period = cancel_at_end_of_period + self.cancel_at_end_of_period = cancel_at_end_of_period if current_billing_amount_in_cents is not APIHelper.SKIP: - self.current_billing_amount_in_cents = current_billing_amount_in_cents + self.current_billing_amount_in_cents = current_billing_amount_in_cents if customer is not APIHelper.SKIP: - self.customer = customer + self.customer = customer if account_balances is not APIHelper.SKIP: - self.account_balances = account_balances + self.account_balances = account_balances # Add additional model properties to the instance if additional_properties is None: @@ -180,7 +180,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -191,25 +191,64 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - scheme = dictionary.get("scheme") if dictionary.get("scheme") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - subscription_ids = dictionary.get("subscription_ids") if dictionary.get("subscription_ids") else APIHelper.SKIP - primary_subscription_id = dictionary.get("primary_subscription_id") if dictionary.get("primary_subscription_id") else APIHelper.SKIP - next_assessment_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_assessment_at")).datetime if dictionary.get("next_assessment_at") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - cancel_at_end_of_period = dictionary.get("cancel_at_end_of_period") if "cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP - current_billing_amount_in_cents = dictionary.get("current_billing_amount_in_cents") if dictionary.get("current_billing_amount_in_cents") else APIHelper.SKIP - customer = SubscriptionGroupCustomer.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP - account_balances = SubscriptionGroupBalances.from_dictionary(dictionary.get('account_balances')) if 'account_balances' in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + scheme =\ + dictionary.get("scheme")\ + if dictionary.get("scheme")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + subscription_ids =\ + dictionary.get("subscription_ids")\ + if dictionary.get("subscription_ids")\ + else APIHelper.SKIP + primary_subscription_id =\ + dictionary.get("primary_subscription_id")\ + if dictionary.get("primary_subscription_id")\ + else APIHelper.SKIP + next_assessment_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_assessment_at")).datetime\ + if dictionary.get("next_assessment_at") else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + cancel_at_end_of_period =\ + dictionary.get("cancel_at_end_of_period")\ + if "cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP + current_billing_amount_in_cents =\ + dictionary.get("current_billing_amount_in_cents")\ + if dictionary.get("current_billing_amount_in_cents")\ + else APIHelper.SKIP + customer =\ + SubscriptionGroupCustomer.from_dictionary( + dictionary.get("customer"))\ + if "customer" in dictionary.keys()\ + else APIHelper.SKIP + account_balances =\ + SubscriptionGroupBalances.from_dictionary( + dictionary.get("account_balances"))\ + if "account_balances" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, scheme, @@ -226,33 +265,163 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!r}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!r}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!r}, ' - f'current_billing_amount_in_cents={(self.current_billing_amount_in_cents if hasattr(self, "current_billing_amount_in_cents") else None)!r}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' - f'account_balances={(self.account_balances if hasattr(self, "account_balances") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _current_billing_amount_in_cents=( + self.current_billing_amount_in_cents + if hasattr(self, "current_billing_amount_in_cents") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _account_balances=( + self.account_balances + if hasattr(self, "account_balances") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"scheme={_scheme!r}, " + f"customer_id={_customer_id!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"subscription_ids={_subscription_ids!r}, " + f"primary_subscription_id={_primary_subscription_id!r}, " + f"next_assessment_at={_next_assessment_at!r}, " + f"state={_state!r}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!r}, " + f"current_billing_amount_in_cents={_current_billing_amount_in_cents!r}, " + f"customer={_customer!r}, " + f"account_balances={_account_balances!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!s}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!s}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!s}, ' - f'current_billing_amount_in_cents={(self.current_billing_amount_in_cents if hasattr(self, "current_billing_amount_in_cents") else None)!s}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' - f'account_balances={(self.account_balances if hasattr(self, "account_balances") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _current_billing_amount_in_cents=( + self.current_billing_amount_in_cents + if hasattr(self, "current_billing_amount_in_cents") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _account_balances=( + self.account_balances + if hasattr(self, "account_balances") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"scheme={_scheme!s}, " + f"customer_id={_customer_id!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"subscription_ids={_subscription_ids!s}, " + f"primary_subscription_id={_primary_subscription_id!s}, " + f"next_assessment_at={_next_assessment_at!s}, " + f"state={_state!s}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!s}, " + f"current_billing_amount_in_cents={_current_billing_amount_in_cents!s}, " + f"customer={_customer!s}, " + f"account_balances={_account_balances!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/get_one_time_token_payment_profile.py b/advancedbilling/models/get_one_time_token_payment_profile.py index ee5f7c83..d2521bf2 100644 --- a/advancedbilling/models/get_one_time_token_payment_profile.py +++ b/advancedbilling/models/get_one_time_token_payment_profile.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class GetOneTimeTokenPaymentProfile(object): - """Implementation of the 'Get One Time Token Payment Profile' model. Attributes: @@ -22,8 +20,8 @@ class GetOneTimeTokenPaymentProfile(object): expiration_month (float): The model property of type float. expiration_year (float): The model property of type float. customer_id (str): The model property of type str. - current_vault (CreditCardVault): The vault that stores the payment - profile with the provided `vault_token`. Use `bogus` for testing. + current_vault (CreditCardVault): The vault that stores the payment profile + with the provided `vault_token`. Use `bogus` for testing. vault_token (str): The model property of type str. billing_address (str): The model property of type str. billing_address_2 (str): The model property of type str. @@ -36,103 +34,103 @@ class GetOneTimeTokenPaymentProfile(object): site_gateway_setting_id (int): The model property of type int. customer_vault_token (str): The model property of type str. gateway_handle (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "masked_card_number": 'masked_card_number', - "card_type": 'card_type', - "expiration_month": 'expiration_month', - "expiration_year": 'expiration_year', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "billing_address": 'billing_address', - "billing_city": 'billing_city', - "billing_country": 'billing_country', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "payment_type": 'payment_type', - "disabled": 'disabled', - "site_gateway_setting_id": 'site_gateway_setting_id', - "id": 'id', - "customer_id": 'customer_id', - "billing_address_2": 'billing_address_2', - "customer_vault_token": 'customer_vault_token', - "gateway_handle": 'gateway_handle' + "first_name": "first_name", + "last_name": "last_name", + "masked_card_number": "masked_card_number", + "card_type": "card_type", + "expiration_month": "expiration_month", + "expiration_year": "expiration_year", + "current_vault": "current_vault", + "vault_token": "vault_token", + "billing_address": "billing_address", + "billing_city": "billing_city", + "billing_country": "billing_country", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "payment_type": "payment_type", + "disabled": "disabled", + "site_gateway_setting_id": "site_gateway_setting_id", + "id": "id", + "customer_id": "customer_id", + "billing_address_2": "billing_address_2", + "customer_vault_token": "customer_vault_token", + "gateway_handle": "gateway_handle", } _optionals = [ - 'id', - 'customer_id', - 'billing_address_2', - 'customer_vault_token', - 'gateway_handle', + "id", + "customer_id", + "billing_address_2", + "customer_vault_token", + "gateway_handle", ] _nullables = [ - 'id', - 'customer_id', - 'customer_vault_token', - 'gateway_handle', + "id", + "customer_id", + "customer_vault_token", + "gateway_handle", ] - def __init__(self, - first_name=None, - last_name=None, - masked_card_number=None, - card_type=None, - expiration_month=None, - expiration_year=None, - current_vault=None, - vault_token=None, - billing_address=None, - billing_city=None, - billing_country=None, - billing_state=None, - billing_zip=None, - payment_type=None, - disabled=None, - site_gateway_setting_id=None, - id=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - additional_properties=None): - """Constructor for the GetOneTimeTokenPaymentProfile class""" - + def __init__( + self, + first_name=None, + last_name=None, + masked_card_number=None, + card_type=None, + expiration_month=None, + expiration_year=None, + current_vault=None, + vault_token=None, + billing_address=None, + billing_city=None, + billing_country=None, + billing_state=None, + billing_zip=None, + payment_type=None, + disabled=None, + site_gateway_setting_id=None, + id=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + additional_properties=None): + """Initialize a GetOneTimeTokenPaymentProfile instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id - self.first_name = first_name - self.last_name = last_name - self.masked_card_number = masked_card_number - self.card_type = card_type - self.expiration_month = expiration_month - self.expiration_year = expiration_year + self.id = id + self.first_name = first_name + self.last_name = last_name + self.masked_card_number = masked_card_number + self.card_type = card_type + self.expiration_month = expiration_month + self.expiration_year = expiration_year if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id - self.current_vault = current_vault - self.vault_token = vault_token - self.billing_address = billing_address + self.customer_id = customer_id + self.current_vault = current_vault + self.vault_token = vault_token + self.billing_address = billing_address if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 - self.billing_city = billing_city - self.billing_country = billing_country - self.billing_state = billing_state - self.billing_zip = billing_zip - self.payment_type = payment_type - self.disabled = disabled - self.site_gateway_setting_id = site_gateway_setting_id + self.billing_address_2 = billing_address_2 + self.billing_city = billing_city + self.billing_country = billing_country + self.billing_state = billing_state + self.billing_zip = billing_zip + self.payment_type = payment_type + self.disabled = disabled + self.site_gateway_setting_id = site_gateway_setting_id if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle # Add additional model properties to the instance if additional_properties is None: @@ -142,7 +140,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -153,34 +151,99 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else None - last_name = dictionary.get("last_name") if dictionary.get("last_name") else None - masked_card_number = dictionary.get("masked_card_number") if dictionary.get("masked_card_number") else None - card_type = dictionary.get("card_type") if dictionary.get("card_type") else None - expiration_month = dictionary.get("expiration_month") if dictionary.get("expiration_month") else None - expiration_year = dictionary.get("expiration_year") if dictionary.get("expiration_year") else None - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else None - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else None - billing_address = dictionary.get("billing_address") if dictionary.get("billing_address") else None - billing_city = dictionary.get("billing_city") if dictionary.get("billing_city") else None - billing_country = dictionary.get("billing_country") if dictionary.get("billing_country") else None - billing_state = dictionary.get("billing_state") if dictionary.get("billing_state") else None - billing_zip = dictionary.get("billing_zip") if dictionary.get("billing_zip") else None - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else None - disabled = dictionary.get("disabled") if "disabled" in dictionary.keys() else None - site_gateway_setting_id = dictionary.get("site_gateway_setting_id") if dictionary.get("site_gateway_setting_id") else None - id = dictionary.get("id") if "id" in dictionary.keys() else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if "customer_id" in dictionary.keys() else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if dictionary.get("billing_address_2") else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if "customer_vault_token" in dictionary.keys() else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if "gateway_handle" in dictionary.keys() else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else None + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else None + masked_card_number =\ + dictionary.get("masked_card_number")\ + if dictionary.get("masked_card_number")\ + else None + card_type =\ + dictionary.get("card_type")\ + if dictionary.get("card_type")\ + else None + expiration_month =\ + dictionary.get("expiration_month")\ + if dictionary.get("expiration_month")\ + else None + expiration_year =\ + dictionary.get("expiration_year")\ + if dictionary.get("expiration_year")\ + else None + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else None + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else None + billing_address =\ + dictionary.get("billing_address")\ + if dictionary.get("billing_address")\ + else None + billing_city =\ + dictionary.get("billing_city")\ + if dictionary.get("billing_city")\ + else None + billing_country =\ + dictionary.get("billing_country")\ + if dictionary.get("billing_country")\ + else None + billing_state =\ + dictionary.get("billing_state")\ + if dictionary.get("billing_state")\ + else None + billing_zip =\ + dictionary.get("billing_zip")\ + if dictionary.get("billing_zip")\ + else None + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else None + disabled =\ + dictionary.get("disabled")\ + if "disabled" in dictionary.keys()\ + else None + site_gateway_setting_id =\ + dictionary.get("site_gateway_setting_id")\ + if dictionary.get("site_gateway_setting_id")\ + else None + id =\ + dictionary.get("id")\ + if "id" in dictionary.keys()\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if "customer_id" in dictionary.keys()\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if dictionary.get("billing_address_2")\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if "customer_vault_token" in dictionary.keys()\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -206,51 +269,143 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'first_name={self.first_name!r}, ' - f'last_name={self.last_name!r}, ' - f'masked_card_number={self.masked_card_number!r}, ' - f'card_type={self.card_type!r}, ' - f'expiration_month={self.expiration_month!r}, ' - f'expiration_year={self.expiration_year!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'current_vault={self.current_vault!r}, ' - f'vault_token={self.vault_token!r}, ' - f'billing_address={self.billing_address!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'billing_city={self.billing_city!r}, ' - f'billing_country={self.billing_country!r}, ' - f'billing_state={self.billing_state!r}, ' - f'billing_zip={self.billing_zip!r}, ' - f'payment_type={self.payment_type!r}, ' - f'disabled={self.disabled!r}, ' - f'site_gateway_setting_id={self.site_gateway_setting_id!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=self.first_name + _last_name=self.last_name + _masked_card_number=self.masked_card_number + _card_type=self.card_type + _expiration_month=self.expiration_month + _expiration_year=self.expiration_year + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=self.current_vault + _vault_token=self.vault_token + _billing_address=self.billing_address + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=self.billing_city + _billing_country=self.billing_country + _billing_state=self.billing_state + _billing_zip=self.billing_zip + _payment_type=self.payment_type + _disabled=self.disabled + _site_gateway_setting_id=self.site_gateway_setting_id + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"masked_card_number={_masked_card_number!r}, " + f"card_type={_card_type!r}, " + f"expiration_month={_expiration_month!r}, " + f"expiration_year={_expiration_year!r}, " + f"customer_id={_customer_id!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"billing_address={_billing_address!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"billing_city={_billing_city!r}, " + f"billing_country={_billing_country!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"payment_type={_payment_type!r}, " + f"disabled={_disabled!r}, " + f"site_gateway_setting_id={_site_gateway_setting_id!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'first_name={self.first_name!s}, ' - f'last_name={self.last_name!s}, ' - f'masked_card_number={self.masked_card_number!s}, ' - f'card_type={self.card_type!s}, ' - f'expiration_month={self.expiration_month!s}, ' - f'expiration_year={self.expiration_year!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'current_vault={self.current_vault!s}, ' - f'vault_token={self.vault_token!s}, ' - f'billing_address={self.billing_address!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'billing_city={self.billing_city!s}, ' - f'billing_country={self.billing_country!s}, ' - f'billing_state={self.billing_state!s}, ' - f'billing_zip={self.billing_zip!s}, ' - f'payment_type={self.payment_type!s}, ' - f'disabled={self.disabled!s}, ' - f'site_gateway_setting_id={self.site_gateway_setting_id!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=self.first_name + _last_name=self.last_name + _masked_card_number=self.masked_card_number + _card_type=self.card_type + _expiration_month=self.expiration_month + _expiration_year=self.expiration_year + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=self.current_vault + _vault_token=self.vault_token + _billing_address=self.billing_address + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=self.billing_city + _billing_country=self.billing_country + _billing_state=self.billing_state + _billing_zip=self.billing_zip + _payment_type=self.payment_type + _disabled=self.disabled + _site_gateway_setting_id=self.site_gateway_setting_id + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"masked_card_number={_masked_card_number!s}, " + f"card_type={_card_type!s}, " + f"expiration_month={_expiration_month!s}, " + f"expiration_year={_expiration_year!s}, " + f"customer_id={_customer_id!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"billing_address={_billing_address!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"billing_city={_billing_city!s}, " + f"billing_country={_billing_country!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"payment_type={_payment_type!s}, " + f"disabled={_disabled!s}, " + f"site_gateway_setting_id={_site_gateway_setting_id!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/get_one_time_token_request.py b/advancedbilling/models/get_one_time_token_request.py index f6fd07d5..93cd9c6a 100644 --- a/advancedbilling/models/get_one_time_token_request.py +++ b/advancedbilling/models/get_one_time_token_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.get_one_time_token_payment_profile import GetOneTimeTokenPaymentProfile +# ruff: noqa: E501 +from advancedbilling.models.get_one_time_token_payment_profile import ( + GetOneTimeTokenPaymentProfile, +) -class GetOneTimeTokenRequest(object): +class GetOneTimeTokenRequest(object): """Implementation of the 'Get One Time Token Request' model. Attributes: - payment_profile (GetOneTimeTokenPaymentProfile): The model property of - type GetOneTimeTokenPaymentProfile. - additional_properties (Dict[str, object]): The additional properties - for the model. + payment_profile (GetOneTimeTokenPaymentProfile): The model property of type + GetOneTimeTokenPaymentProfile. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_profile": 'payment_profile' + "payment_profile": "payment_profile", } - def __init__(self, - payment_profile=None, - additional_properties=None): - """Constructor for the GetOneTimeTokenRequest class""" - + def __init__( + self, + payment_profile=None, + additional_properties=None): + """Initialize a GetOneTimeTokenRequest instance.""" # Initialize members of the class - self.payment_profile = payment_profile + self.payment_profile = payment_profile # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_profile = GetOneTimeTokenPaymentProfile.from_dictionary(dictionary.get('payment_profile')) if dictionary.get('payment_profile') else None + payment_profile =\ + GetOneTimeTokenPaymentProfile.from_dictionary( + dictionary.get("payment_profile"))\ + if dictionary.get("payment_profile") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_profile, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/group_billing.py b/advancedbilling/models/group_billing.py index f95ade54..d3321a1a 100644 --- a/advancedbilling/models/group_billing.py +++ b/advancedbilling/models/group_billing.py @@ -1,60 +1,55 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper - +# ruff: noqa: E501 class GroupBilling(object): - """Implementation of the 'Group Billing' model. - Optional attributes related to billing date and accrual. Note: Only - applicable for new subscriptions. + Optional attributes related to billing date and accrual. Note: Only applicable + for new subscriptions. Attributes: - accrue (bool): A flag indicating whether or not to accrue charges on - the new subscription. - align_date (bool): A flag indicating whether or not to align the - billing date of the new subscription with the billing date of the - primary subscription of the hierarchy's default subscription - group. Required to be true if prorate is also true. - prorate (bool): A flag indicating whether or not to prorate billing of - the new subscription for the current period. A value of true is - ignored unless align_date is also true. - additional_properties (Dict[str, object]): The additional properties - for the model. + accrue (bool): A flag indicating whether or not to accrue charges on the new + subscription. + align_date (bool): A flag indicating whether or not to align the billing date + of the new subscription with the billing date of the primary subscription + of the hierarchy's default subscription group. Required to be true if + prorate is also true. + prorate (bool): A flag indicating whether or not to prorate billing of the + new subscription for the current period. A value of true is ignored + unless align_date is also true. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "accrue": 'accrue', - "align_date": 'align_date', - "prorate": 'prorate' + "accrue": "accrue", + "align_date": "align_date", + "prorate": "prorate", } _optionals = [ - 'accrue', - 'align_date', - 'prorate', + "accrue", + "align_date", + "prorate", ] - def __init__(self, - accrue=False, - align_date=False, - prorate=False, - additional_properties=None): - """Constructor for the GroupBilling class""" - + def __init__( + self, + accrue=False, + align_date=False, + prorate=False, + additional_properties=None): + """Initialize a GroupBilling instance.""" # Initialize members of the class - self.accrue = accrue - self.align_date = align_date - self.prorate = prorate + self.accrue = accrue + self.align_date = align_date + self.prorate = prorate # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +59,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,16 +70,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - accrue = dictionary.get("accrue") if dictionary.get("accrue") else False - align_date = dictionary.get("align_date") if dictionary.get("align_date") else False - prorate = dictionary.get("prorate") if dictionary.get("prorate") else False + accrue =\ + dictionary.get("accrue")\ + if dictionary.get("accrue")\ + else False + align_date =\ + dictionary.get("align_date")\ + if dictionary.get("align_date")\ + else False + prorate =\ + dictionary.get("prorate")\ + if dictionary.get("prorate")\ + else False + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(accrue, align_date, @@ -93,7 +99,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -104,7 +110,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -114,15 +119,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'accrue={(self.accrue if hasattr(self, "accrue") else None)!r}, ' - f'align_date={(self.align_date if hasattr(self, "align_date") else None)!r}, ' - f'prorate={(self.prorate if hasattr(self, "prorate") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _accrue=( + self.accrue + if hasattr(self, "accrue") + else None + ) + _align_date=( + self.align_date + if hasattr(self, "align_date") + else None + ) + _prorate=( + self.prorate + if hasattr(self, "prorate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"accrue={_accrue!r}, " + f"align_date={_align_date!r}, " + f"prorate={_prorate!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'accrue={(self.accrue if hasattr(self, "accrue") else None)!s}, ' - f'align_date={(self.align_date if hasattr(self, "align_date") else None)!s}, ' - f'prorate={(self.prorate if hasattr(self, "prorate") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _accrue=( + self.accrue + if hasattr(self, "accrue") + else None + ) + _align_date=( + self.align_date + if hasattr(self, "align_date") + else None + ) + _prorate=( + self.prorate + if hasattr(self, "prorate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"accrue={_accrue!s}, " + f"align_date={_align_date!s}, " + f"prorate={_prorate!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/group_settings.py b/advancedbilling/models/group_settings.py index 2ba8bee0..8bf6ef2a 100644 --- a/advancedbilling/models/group_settings.py +++ b/advancedbilling/models/group_settings.py @@ -1,50 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.group_billing import GroupBilling -from advancedbilling.models.group_target import GroupTarget +from advancedbilling.models.group_billing import ( + GroupBilling, +) +from advancedbilling.models.group_target import ( + GroupTarget, +) class GroupSettings(object): - """Implementation of the 'Group Settings' model. Attributes: - target (GroupTarget): Attributes of the target customer who will be - the responsible payer of the created subscription. Required. - billing (GroupBilling): Optional attributes related to billing date - and accrual. Note: Only applicable for new subscriptions. - additional_properties (Dict[str, object]): The additional properties - for the model. + target (GroupTarget): Attributes of the target customer who will be the + responsible payer of the created subscription. Required. + billing (GroupBilling): Optional attributes related to billing date and + accrual. Note: Only applicable for new subscriptions. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "target": 'target', - "billing": 'billing' + "target": "target", + "billing": "billing", } _optionals = [ - 'billing', + "billing", ] - def __init__(self, - target=None, - billing=APIHelper.SKIP, - additional_properties=None): - """Constructor for the GroupSettings class""" - + def __init__( + self, + target=None, + billing=APIHelper.SKIP, + additional_properties=None): + """Initialize a GroupSettings instance.""" # Initialize members of the class - self.target = target + self.target = target if billing is not APIHelper.SKIP: - self.billing = billing + self.billing = billing # Add additional model properties to the instance if additional_properties is None: @@ -54,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -65,15 +67,24 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - target = GroupTarget.from_dictionary(dictionary.get('target')) if dictionary.get('target') else None - billing = GroupBilling.from_dictionary(dictionary.get('billing')) if 'billing' in dictionary.keys() else APIHelper.SKIP + target =\ + GroupTarget.from_dictionary( + dictionary.get("target"))\ + if dictionary.get("target") else None + billing =\ + GroupBilling.from_dictionary( + dictionary.get("billing"))\ + if "billing" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(target, billing, @@ -81,7 +92,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -92,27 +103,52 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.target, - type_callable=lambda value: GroupTarget.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.target, + type_callable=lambda value: + GroupTarget.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('target'), - type_callable=lambda value: GroupTarget.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("target"), + type_callable=lambda value: + GroupTarget.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'target={self.target!r}, ' - f'billing={(self.billing if hasattr(self, "billing") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _target=self.target + _billing=( + self.billing + if hasattr(self, "billing") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"target={_target!r}, " + f"billing={_billing!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'target={self.target!s}, ' - f'billing={(self.billing if hasattr(self, "billing") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _target=self.target + _billing=( + self.billing + if hasattr(self, "billing") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"target={_target!s}, " + f"billing={_billing!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/group_target.py b/advancedbilling/models/group_target.py index ba01df0f..8e0243b4 100644 --- a/advancedbilling/models/group_target.py +++ b/advancedbilling/models/group_target.py @@ -1,53 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.group_target_type import GroupTargetType +from advancedbilling.models.group_target_type import ( + GroupTargetType, +) class GroupTarget(object): - """Implementation of the 'Group Target' model. Attributes of the target customer who will be the responsible payer of the created subscription. Required. Attributes: - mtype (GroupTargetType): The type of object indicated by the id - attribute. - id (int): The id of the target customer or subscription to group the - existing subscription with. Ignored and should not be included if - type is "self" , "parent", or "eldest" - additional_properties (Dict[str, object]): The additional properties - for the model. + mtype (GroupTargetType): The type of object indicated by the id attribute. + id (int): The id of the target customer or subscription to group the existing + subscription with. Ignored and should not be included if type is "self" , + "parent", or "eldest" + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "mtype": 'type', - "id": 'id' + "mtype": "type", + "id": "id", } _optionals = [ - 'id', + "id", ] - def __init__(self, - mtype=None, - id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the GroupTarget class""" - + def __init__( + self, + mtype=None, + id=APIHelper.SKIP, + additional_properties=None): + """Initialize a GroupTarget instance.""" # Initialize members of the class - self.mtype = mtype + self.mtype = mtype if id is not APIHelper.SKIP: - self.id = id + self.id = id # Add additional model properties to the instance if additional_properties is None: @@ -57,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -68,15 +67,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - mtype = dictionary.get("type") if dictionary.get("type") else None - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(mtype, id, @@ -84,7 +91,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -95,25 +102,50 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.mtype, - type_callable=lambda value: GroupTargetType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.mtype, + type_callable=lambda value: + GroupTargetType.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('type'), - type_callable=lambda value: GroupTargetType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("type"), + type_callable=lambda value: + GroupTargetType.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'mtype={self.mtype!r}, ' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _mtype=self.mtype + _id=( + self.id + if hasattr(self, "id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mtype={_mtype!r}, " + f"id={_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'mtype={self.mtype!s}, ' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _mtype=self.mtype + _id=( + self.id + if hasattr(self, "id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mtype={_mtype!s}, " + f"id={_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/group_target_type.py b/advancedbilling/models/group_target_type.py index 129e6079..3d3b53da 100644 --- a/advancedbilling/models/group_target_type.py +++ b/advancedbilling/models/group_target_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class GroupTargetType(object): - """Implementation of the 'Group Target Type' enum. The type of object indicated by the id attribute. @@ -20,24 +17,25 @@ class GroupTargetType(object): SELF: The enum member of type str. PARENT: The enum member of type str. ELDEST: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['customer', 'subscription', 'self', 'parent', 'eldest'] - CUSTOMER = 'customer' - SUBSCRIPTION = 'subscription' + _all_values = ["customer", "subscription", "self", "parent", "eldest"] + CUSTOMER = "customer" - ENUM_SELF = 'self' + SUBSCRIPTION = "subscription" - PARENT = 'parent' + ENUM_SELF = "self" - ELDEST = 'eldest' + PARENT = "parent" + + ELDEST = "eldest" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -47,9 +45,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/group_type.py b/advancedbilling/models/group_type.py index e499f428..331f11b1 100644 --- a/advancedbilling/models/group_type.py +++ b/advancedbilling/models/group_type.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class GroupType(object): - """Implementation of the 'Group Type' enum. Attributes: SINGLE_CUSTOMER: The enum member of type str. MULTIPLE_CUSTOMERS: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - SINGLE_CUSTOMER = 'single_customer' - MULTIPLE_CUSTOMERS = 'multiple_customers' + SINGLE_CUSTOMER = "single_customer" + + MULTIPLE_CUSTOMERS = "multiple_customers" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/historic_usage.py b/advancedbilling/models/historic_usage.py index 1117b4bc..20f9de9a 100644 --- a/advancedbilling/models/historic_usage.py +++ b/advancedbilling/models/historic_usage.py @@ -1,58 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class HistoricUsage(object): - """Implementation of the 'Historic Usage' model. - Optional for Event Based Components. If the `include=historic_usages` - query param is provided, the last ten billing periods will be returned. + Optional for Event Based Components. If the `include=historic_usages` query param + is provided, the last ten billing periods will be returned. Attributes: - total_usage_quantity (float): Total usage of a component for billing - period + total_usage_quantity (float): Total usage of a component for billing period billing_period_starts_at (datetime): Start date of billing period billing_period_ends_at (datetime): End date of billing period - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "total_usage_quantity": 'total_usage_quantity', - "billing_period_starts_at": 'billing_period_starts_at', - "billing_period_ends_at": 'billing_period_ends_at' + "total_usage_quantity": "total_usage_quantity", + "billing_period_starts_at": "billing_period_starts_at", + "billing_period_ends_at": "billing_period_ends_at", } _optionals = [ - 'total_usage_quantity', - 'billing_period_starts_at', - 'billing_period_ends_at', + "total_usage_quantity", + "billing_period_starts_at", + "billing_period_ends_at", ] - def __init__(self, - total_usage_quantity=APIHelper.SKIP, - billing_period_starts_at=APIHelper.SKIP, - billing_period_ends_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the HistoricUsage class""" - + def __init__( + self, + total_usage_quantity=APIHelper.SKIP, + billing_period_starts_at=APIHelper.SKIP, + billing_period_ends_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a HistoricUsage instance.""" # Initialize members of the class if total_usage_quantity is not APIHelper.SKIP: - self.total_usage_quantity = total_usage_quantity + self.total_usage_quantity = total_usage_quantity if billing_period_starts_at is not APIHelper.SKIP: - self.billing_period_starts_at = APIHelper.apply_datetime_converter(billing_period_starts_at, APIHelper.RFC3339DateTime) if billing_period_starts_at else None + self.billing_period_starts_at =\ + APIHelper.apply_datetime_converter( + billing_period_starts_at, APIHelper.RFC3339DateTime)\ + if billing_period_starts_at else None if billing_period_ends_at is not APIHelper.SKIP: - self.billing_period_ends_at = APIHelper.apply_datetime_converter(billing_period_ends_at, APIHelper.RFC3339DateTime) if billing_period_ends_at else None + self.billing_period_ends_at =\ + APIHelper.apply_datetime_converter( + billing_period_ends_at, APIHelper.RFC3339DateTime)\ + if billing_period_ends_at else None # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,16 +76,25 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - total_usage_quantity = dictionary.get("total_usage_quantity") if dictionary.get("total_usage_quantity") else APIHelper.SKIP - billing_period_starts_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("billing_period_starts_at")).datetime if dictionary.get("billing_period_starts_at") else APIHelper.SKIP - billing_period_ends_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("billing_period_ends_at")).datetime if dictionary.get("billing_period_ends_at") else APIHelper.SKIP + total_usage_quantity =\ + dictionary.get("total_usage_quantity")\ + if dictionary.get("total_usage_quantity")\ + else APIHelper.SKIP + billing_period_starts_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("billing_period_starts_at")).datetime\ + if dictionary.get("billing_period_starts_at") else APIHelper.SKIP + billing_period_ends_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("billing_period_ends_at")).datetime\ + if dictionary.get("billing_period_ends_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(total_usage_quantity, billing_period_starts_at, @@ -91,7 +103,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -102,7 +114,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -112,15 +123,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'total_usage_quantity={(self.total_usage_quantity if hasattr(self, "total_usage_quantity") else None)!r}, ' - f'billing_period_starts_at={(self.billing_period_starts_at if hasattr(self, "billing_period_starts_at") else None)!r}, ' - f'billing_period_ends_at={(self.billing_period_ends_at if hasattr(self, "billing_period_ends_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _total_usage_quantity=( + self.total_usage_quantity + if hasattr(self, "total_usage_quantity") + else None + ) + _billing_period_starts_at=( + self.billing_period_starts_at + if hasattr(self, "billing_period_starts_at") + else None + ) + _billing_period_ends_at=( + self.billing_period_ends_at + if hasattr(self, "billing_period_ends_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_usage_quantity={_total_usage_quantity!r}, " + f"billing_period_starts_at={_billing_period_starts_at!r}, " + f"billing_period_ends_at={_billing_period_ends_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'total_usage_quantity={(self.total_usage_quantity if hasattr(self, "total_usage_quantity") else None)!s}, ' - f'billing_period_starts_at={(self.billing_period_starts_at if hasattr(self, "billing_period_starts_at") else None)!s}, ' - f'billing_period_ends_at={(self.billing_period_ends_at if hasattr(self, "billing_period_ends_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _total_usage_quantity=( + self.total_usage_quantity + if hasattr(self, "total_usage_quantity") + else None + ) + _billing_period_starts_at=( + self.billing_period_starts_at + if hasattr(self, "billing_period_starts_at") + else None + ) + _billing_period_ends_at=( + self.billing_period_ends_at + if hasattr(self, "billing_period_ends_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_usage_quantity={_total_usage_quantity!s}, " + f"billing_period_starts_at={_billing_period_starts_at!s}, " + f"billing_period_ends_at={_billing_period_ends_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/include_not_null.py b/advancedbilling/models/include_not_null.py index 7cf17be9..0d0854bb 100644 --- a/advancedbilling/models/include_not_null.py +++ b/advancedbilling/models/include_not_null.py @@ -1,29 +1,28 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class IncludeNotNull(object): - """Implementation of the 'Include Not Null' enum. Passed as a parameter to list methods to return only non null values. Attributes: NOT_NULL: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - NOT_NULL = 'not_null' + + NOT_NULL = "not_null" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/include_null_or_not_null.py b/advancedbilling/models/include_null_or_not_null.py index 814bb746..6efa239b 100644 --- a/advancedbilling/models/include_null_or_not_null.py +++ b/advancedbilling/models/include_null_or_not_null.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class IncludeNullOrNotNull(object): - """Implementation of the 'Include Null Or Not Null' enum. Allows to filter by `not_null` or `null`. @@ -17,16 +14,18 @@ class IncludeNullOrNotNull(object): Attributes: NOT_NULL: The enum member of type str. NULL: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - NOT_NULL = 'not_null' - NULL = 'null' + NOT_NULL = "not_null" + + NULL = "null" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/include_option.py b/advancedbilling/models/include_option.py index 700e500c..eebf56fd 100644 --- a/advancedbilling/models/include_option.py +++ b/advancedbilling/models/include_option.py @@ -1,32 +1,30 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class IncludeOption(object): - """Implementation of the 'Include Option' enum. Attributes: EXCLUDE: The enum member of type str. INCLUDE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['0', '1'] - EXCLUDE = '0' - INCLUDE = '1' + _all_values = ["0", "1"] + EXCLUDE = "0" + + INCLUDE = "1" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -36,9 +34,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/interval_unit.py b/advancedbilling/models/interval_unit.py index ddeecd49..187c6a80 100644 --- a/advancedbilling/models/interval_unit.py +++ b/advancedbilling/models/interval_unit.py @@ -1,32 +1,30 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class IntervalUnit(object): - """Implementation of the 'Interval Unit' enum. Attributes: DAY: The enum member of type str. MONTH: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['day', 'month'] - DAY = 'day' - MONTH = 'month' + _all_values = ["day", "month"] + DAY = "day" + + MONTH = "month" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -36,9 +34,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice.py b/advancedbilling/models/invoice.py index b0b7ae77..d88febdc 100644 --- a/advancedbilling/models/invoice.py +++ b/advancedbilling/models/invoice.py @@ -1,109 +1,127 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_address import InvoiceAddress -from advancedbilling.models.invoice_avatax_details import InvoiceAvataxDetails -from advancedbilling.models.invoice_credit import InvoiceCredit -from advancedbilling.models.invoice_custom_field import InvoiceCustomField -from advancedbilling.models.invoice_customer import InvoiceCustomer -from advancedbilling.models.invoice_debit import InvoiceDebit -from advancedbilling.models.invoice_discount import InvoiceDiscount -from advancedbilling.models.invoice_display_settings import InvoiceDisplaySettings -from advancedbilling.models.invoice_line_item import InvoiceLineItem -from advancedbilling.models.invoice_payer import InvoicePayer -from advancedbilling.models.invoice_payment import InvoicePayment -from advancedbilling.models.invoice_previous_balance import InvoicePreviousBalance -from advancedbilling.models.invoice_refund import InvoiceRefund -from advancedbilling.models.invoice_seller import InvoiceSeller -from advancedbilling.models.invoice_tax import InvoiceTax +from advancedbilling.models.invoice_address import ( + InvoiceAddress, +) +from advancedbilling.models.invoice_avatax_details import ( + InvoiceAvataxDetails, +) +from advancedbilling.models.invoice_credit import ( + InvoiceCredit, +) +from advancedbilling.models.invoice_custom_field import ( + InvoiceCustomField, +) +from advancedbilling.models.invoice_customer import ( + InvoiceCustomer, +) +from advancedbilling.models.invoice_debit import ( + InvoiceDebit, +) +from advancedbilling.models.invoice_discount import ( + InvoiceDiscount, +) +from advancedbilling.models.invoice_display_settings import ( + InvoiceDisplaySettings, +) +from advancedbilling.models.invoice_line_item import ( + InvoiceLineItem, +) +from advancedbilling.models.invoice_payer import ( + InvoicePayer, +) +from advancedbilling.models.invoice_payment import ( + InvoicePayment, +) +from advancedbilling.models.invoice_previous_balance import ( + InvoicePreviousBalance, +) +from advancedbilling.models.invoice_refund import ( + InvoiceRefund, +) +from advancedbilling.models.invoice_seller import ( + InvoiceSeller, +) +from advancedbilling.models.invoice_tax import ( + InvoiceTax, +) class Invoice(object): - """Implementation of the 'Invoice' model. Attributes: id (int): The model property of type int. - uid (str): Unique identifier for the invoice. It is generated - automatically by Chargify and has the prefix "inv_" followed by - alphanumeric characters. + uid (str): Unique identifier for the invoice. It is generated automatically + by Chargify and has the prefix "inv_" followed by alphanumeric characters. site_id (int): ID of the site to which the invoice belongs. customer_id (int): ID of the customer to which the invoice belongs. - subscription_id (int): ID of the subscription that generated the - invoice. - number (str): A unique, identifying string that appears on the invoice - and in places the invoice is referenced. While the UID is long - and not appropriate to show to customers, the number is usually - shorter and consumable by the customer and the merchant alike. - sequence_number (int): A monotonically increasing number assigned to - invoices as they are created. This number is unique within a site - and can be used to sort and order invoices. + subscription_id (int): ID of the subscription that generated the invoice. + number (str): A unique, identifying string that appears on the invoice and in + places the invoice is referenced. While the UID is long and not + appropriate to show to customers, the number is usually shorter and + consumable by the customer and the merchant alike. + sequence_number (int): A monotonically increasing number assigned to invoices + as they are created. This number is unique within a site and can be used + to sort and order invoices. transaction_time (datetime): The model property of type datetime. created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. - issue_date (date): Date the invoice was issued to the customer. This - is the date that the invoice was made available for payment. The - format is `"YYYY-MM-DD"`. - due_date (date): Date the invoice is due. The format is + issue_date (date): Date the invoice was issued to the customer. This is the + date that the invoice was made available for payment. The format is `"YYYY-MM-DD"`. - paid_date (date): Date the invoice became fully paid. If partial - payments are applied to the invoice, this date will not be present - until payment has been made in full. The format is `"YYYY-MM-DD"`. - status (InvoiceStatus): The current status of the invoice. See - [Invoice - Statuses](https://maxio.zendesk.com/hc/en-us/articles/2425228782964 - 5-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. + due_date (date): Date the invoice is due. The format is `"YYYY-MM-DD"`. + paid_date (date): Date the invoice became fully paid. If partial payments + are applied to the invoice, this date will not be present until payment + has been made in full. The format is `"YYYY-MM-DD"`. + status (InvoiceStatus): The current status of the invoice. See [Invoice + Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advan + ced-Billing-Invoices-Overview#invoice-statuses) for more. role (InvoiceRole): The model property of type InvoiceRole. parent_invoice_id (int): The model property of type int. - collection_method (CollectionMethod): The type of payment collection - to be used in the subscription. For legacy Statements Architecture - valid options are - `invoice`, `automatic`. For current - Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. - payment_instructions (str): A message that is printed on the invoice - when it is marked for remittance collection. It is intended to - describe to the customer how they may make payment, and is - configured by the merchant. - currency (str): The ISO 4217 currency code (3 character string) - representing the currency of invoice transaction. - consolidation_level (InvoiceConsolidationLevel): Consolidation level - of the invoice, which is applicable to invoice consolidation. It - will hold one of the following values: * "none": A normal invoice - with no consolidation. * "child": An invoice segment which has - been combined into a consolidated invoice. * "parent": A - consolidated invoice, whose contents are composed of invoice - segments. "Parent" invoices do not have lines of their own, but - they have subtotals and totals which aggregate the member invoice - segments. See also the [invoice consolidation - documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269 - 909389-Invoice-Consolidation). - parent_invoice_uid (str): For invoices with `consolidation_level` of - `child`, this specifies the UID of the parent (consolidated) - invoice. + collection_method (CollectionMethod): The type of payment collection to be + used in the subscription. For legacy Statements Architecture valid + options are - `invoice`, `automatic`. For current Relationship Invoicing + Architecture valid options are - `remittance`, `automatic`, `prepaid`. + payment_instructions (str): A message that is printed on the invoice when it + is marked for remittance collection. It is intended to describe to the + customer how they may make payment, and is configured by the merchant. + currency (str): The ISO 4217 currency code (3 character string) representing + the currency of invoice transaction. + consolidation_level (InvoiceConsolidationLevel): Consolidation level of the + invoice, which is applicable to invoice consolidation. It will hold one + of the following values: * "none": A normal invoice with no + consolidation. * "child": An invoice segment which has been combined into + a consolidated invoice. * "parent": A consolidated invoice, whose + contents are composed of invoice segments. "Parent" invoices do not have + lines of their own, but they have subtotals and totals which aggregate + the member invoice segments. See also the [invoice consolidation + documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389- + Invoice-Consolidation). + parent_invoice_uid (str): For invoices with `consolidation_level` of `child`, + this specifies the UID of the parent (consolidated) invoice. subscription_group_id (int): The model property of type int. - parent_invoice_number (int): For invoices with `consolidation_level` - of `child`, this specifies the number of the parent (consolidated) - invoice. - group_primary_subscription_id (int): For invoices with - `consolidation_level` of `parent`, this specifies the ID of the - subscription which was the primary subscription of the - subscription group that generated the invoice. - product_name (str): The name of the product subscribed when the + parent_invoice_number (int): For invoices with `consolidation_level` of + `child`, this specifies the number of the parent (consolidated) invoice. + group_primary_subscription_id (int): For invoices with `consolidation_level` + of `parent`, this specifies the ID of the subscription which was the + primary subscription of the subscription group that generated the invoice. + product_name (str): The name of the product subscribed when the invoice was + generated. + product_family_name (str): The name of the product family subscribed when the invoice was generated. - product_family_name (str): The name of the product family subscribed - when the invoice was generated. - seller (InvoiceSeller): Information about the seller (merchant) listed - on the masthead of the invoice. - customer (InvoiceCustomer): Information about the customer who is - owner or recipient the invoiced subscription. + seller (InvoiceSeller): Information about the seller (merchant) listed on the + masthead of the invoice. + customer (InvoiceCustomer): Information about the customer who is owner or + recipient the invoiced subscription. payer (InvoicePayer): The model property of type InvoicePayer. recipient_emails (List[str]): The model property of type List[str]. net_terms (int): The model property of type int. @@ -111,14 +129,14 @@ class Invoice(object): message is in control of the merchant. billing_address (InvoiceAddress): The invoice billing address. shipping_address (InvoiceAddress): The invoice shipping address. - subtotal_amount (str): Subtotal of the invoice, which is the sum of - all line items before discounts or taxes. + subtotal_amount (str): Subtotal of the invoice, which is the sum of all line + items before discounts or taxes. discount_amount (str): Total discount applied to the invoice. tax_amount (str): Total tax on the invoice. total_amount (str): The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' - credit_amount (str): The amount of credit (from credit notes) applied - to this invoice. Credits offset the amount due from the customer. + credit_amount (str): The amount of credit (from credit notes) applied to this + invoice. Credits offset the amount due from the customer. debit_amount (str): The model property of type str. refund_amount (str): The model property of type str. paid_amount (str): The amount paid on the invoice by the customer. @@ -128,12 +146,9 @@ class Invoice(object): discounts (List[InvoiceDiscount]): The model property of type List[InvoiceDiscount]. taxes (List[InvoiceTax]): The model property of type List[InvoiceTax]. - credits (List[InvoiceCredit]): The model property of type - List[InvoiceCredit]. - debits (List[InvoiceDebit]): The model property of type - List[InvoiceDebit]. - refunds (List[InvoiceRefund]): The model property of type - List[InvoiceRefund]. + credits (List[InvoiceCredit]): The model property of type List[InvoiceCredit]. + debits (List[InvoiceDebit]): The model property of type List[InvoiceDebit]. + refunds (List[InvoiceRefund]): The model property of type List[InvoiceRefund]. payments (List[InvoicePayment]): The model property of type List[InvoicePayment]. custom_fields (List[InvoiceCustomField]): The model property of type @@ -143,315 +158,324 @@ class Invoice(object): avatax_details (InvoiceAvataxDetails): The model property of type InvoiceAvataxDetails. public_url (str): The public URL of the invoice - previous_balance_data (InvoicePreviousBalance): The model property of - type InvoicePreviousBalance. + previous_balance_data (InvoicePreviousBalance): The model property of type + InvoicePreviousBalance. public_url_expires_on (date): The format is `"YYYY-MM-DD"`. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "uid": 'uid', - "site_id": 'site_id', - "customer_id": 'customer_id', - "subscription_id": 'subscription_id', - "number": 'number', - "sequence_number": 'sequence_number', - "transaction_time": 'transaction_time', - "created_at": 'created_at', - "updated_at": 'updated_at', - "issue_date": 'issue_date', - "due_date": 'due_date', - "paid_date": 'paid_date', - "status": 'status', - "role": 'role', - "parent_invoice_id": 'parent_invoice_id', - "collection_method": 'collection_method', - "payment_instructions": 'payment_instructions', - "currency": 'currency', - "consolidation_level": 'consolidation_level', - "parent_invoice_uid": 'parent_invoice_uid', - "subscription_group_id": 'subscription_group_id', - "parent_invoice_number": 'parent_invoice_number', - "group_primary_subscription_id": 'group_primary_subscription_id', - "product_name": 'product_name', - "product_family_name": 'product_family_name', - "seller": 'seller', - "customer": 'customer', - "payer": 'payer', - "recipient_emails": 'recipient_emails', - "net_terms": 'net_terms', - "memo": 'memo', - "billing_address": 'billing_address', - "shipping_address": 'shipping_address', - "subtotal_amount": 'subtotal_amount', - "discount_amount": 'discount_amount', - "tax_amount": 'tax_amount', - "total_amount": 'total_amount', - "credit_amount": 'credit_amount', - "debit_amount": 'debit_amount', - "refund_amount": 'refund_amount', - "paid_amount": 'paid_amount', - "due_amount": 'due_amount', - "line_items": 'line_items', - "discounts": 'discounts', - "taxes": 'taxes', - "credits": 'credits', - "debits": 'debits', - "refunds": 'refunds', - "payments": 'payments', - "custom_fields": 'custom_fields', - "display_settings": 'display_settings', - "avatax_details": 'avatax_details', - "public_url": 'public_url', - "previous_balance_data": 'previous_balance_data', - "public_url_expires_on": 'public_url_expires_on' + "id": "id", + "uid": "uid", + "site_id": "site_id", + "customer_id": "customer_id", + "subscription_id": "subscription_id", + "number": "number", + "sequence_number": "sequence_number", + "transaction_time": "transaction_time", + "created_at": "created_at", + "updated_at": "updated_at", + "issue_date": "issue_date", + "due_date": "due_date", + "paid_date": "paid_date", + "status": "status", + "role": "role", + "parent_invoice_id": "parent_invoice_id", + "collection_method": "collection_method", + "payment_instructions": "payment_instructions", + "currency": "currency", + "consolidation_level": "consolidation_level", + "parent_invoice_uid": "parent_invoice_uid", + "subscription_group_id": "subscription_group_id", + "parent_invoice_number": "parent_invoice_number", + "group_primary_subscription_id": "group_primary_subscription_id", + "product_name": "product_name", + "product_family_name": "product_family_name", + "seller": "seller", + "customer": "customer", + "payer": "payer", + "recipient_emails": "recipient_emails", + "net_terms": "net_terms", + "memo": "memo", + "billing_address": "billing_address", + "shipping_address": "shipping_address", + "subtotal_amount": "subtotal_amount", + "discount_amount": "discount_amount", + "tax_amount": "tax_amount", + "total_amount": "total_amount", + "credit_amount": "credit_amount", + "debit_amount": "debit_amount", + "refund_amount": "refund_amount", + "paid_amount": "paid_amount", + "due_amount": "due_amount", + "line_items": "line_items", + "discounts": "discounts", + "taxes": "taxes", + "credits": "credits", + "debits": "debits", + "refunds": "refunds", + "payments": "payments", + "custom_fields": "custom_fields", + "display_settings": "display_settings", + "avatax_details": "avatax_details", + "public_url": "public_url", + "previous_balance_data": "previous_balance_data", + "public_url_expires_on": "public_url_expires_on", } _optionals = [ - 'id', - 'uid', - 'site_id', - 'customer_id', - 'subscription_id', - 'number', - 'sequence_number', - 'transaction_time', - 'created_at', - 'updated_at', - 'issue_date', - 'due_date', - 'paid_date', - 'status', - 'role', - 'parent_invoice_id', - 'collection_method', - 'payment_instructions', - 'currency', - 'consolidation_level', - 'parent_invoice_uid', - 'subscription_group_id', - 'parent_invoice_number', - 'group_primary_subscription_id', - 'product_name', - 'product_family_name', - 'seller', - 'customer', - 'payer', - 'recipient_emails', - 'net_terms', - 'memo', - 'billing_address', - 'shipping_address', - 'subtotal_amount', - 'discount_amount', - 'tax_amount', - 'total_amount', - 'credit_amount', - 'debit_amount', - 'refund_amount', - 'paid_amount', - 'due_amount', - 'line_items', - 'discounts', - 'taxes', - 'credits', - 'debits', - 'refunds', - 'payments', - 'custom_fields', - 'display_settings', - 'avatax_details', - 'public_url', - 'previous_balance_data', - 'public_url_expires_on', + "id", + "uid", + "site_id", + "customer_id", + "subscription_id", + "number", + "sequence_number", + "transaction_time", + "created_at", + "updated_at", + "issue_date", + "due_date", + "paid_date", + "status", + "role", + "parent_invoice_id", + "collection_method", + "payment_instructions", + "currency", + "consolidation_level", + "parent_invoice_uid", + "subscription_group_id", + "parent_invoice_number", + "group_primary_subscription_id", + "product_name", + "product_family_name", + "seller", + "customer", + "payer", + "recipient_emails", + "net_terms", + "memo", + "billing_address", + "shipping_address", + "subtotal_amount", + "discount_amount", + "tax_amount", + "total_amount", + "credit_amount", + "debit_amount", + "refund_amount", + "paid_amount", + "due_amount", + "line_items", + "discounts", + "taxes", + "credits", + "debits", + "refunds", + "payments", + "custom_fields", + "display_settings", + "avatax_details", + "public_url", + "previous_balance_data", + "public_url_expires_on", ] _nullables = [ - 'paid_date', - 'parent_invoice_id', - 'parent_invoice_uid', - 'subscription_group_id', - 'parent_invoice_number', - 'group_primary_subscription_id', + "paid_date", + "parent_invoice_id", + "parent_invoice_uid", + "subscription_group_id", + "parent_invoice_number", + "group_primary_subscription_id", ] - def __init__(self, - id=APIHelper.SKIP, - uid=APIHelper.SKIP, - site_id=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - number=APIHelper.SKIP, - sequence_number=APIHelper.SKIP, - transaction_time=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - issue_date=APIHelper.SKIP, - due_date=APIHelper.SKIP, - paid_date=APIHelper.SKIP, - status=APIHelper.SKIP, - role=APIHelper.SKIP, - parent_invoice_id=APIHelper.SKIP, - collection_method=APIHelper.SKIP, - payment_instructions=APIHelper.SKIP, - currency=APIHelper.SKIP, - consolidation_level=APIHelper.SKIP, - parent_invoice_uid=APIHelper.SKIP, - subscription_group_id=APIHelper.SKIP, - parent_invoice_number=APIHelper.SKIP, - group_primary_subscription_id=APIHelper.SKIP, - product_name=APIHelper.SKIP, - product_family_name=APIHelper.SKIP, - seller=APIHelper.SKIP, - customer=APIHelper.SKIP, - payer=APIHelper.SKIP, - recipient_emails=APIHelper.SKIP, - net_terms=APIHelper.SKIP, - memo=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - shipping_address=APIHelper.SKIP, - subtotal_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - total_amount=APIHelper.SKIP, - credit_amount=APIHelper.SKIP, - debit_amount=APIHelper.SKIP, - refund_amount=APIHelper.SKIP, - paid_amount=APIHelper.SKIP, - due_amount=APIHelper.SKIP, - line_items=APIHelper.SKIP, - discounts=APIHelper.SKIP, - taxes=APIHelper.SKIP, - credits=APIHelper.SKIP, - debits=APIHelper.SKIP, - refunds=APIHelper.SKIP, - payments=APIHelper.SKIP, - custom_fields=APIHelper.SKIP, - display_settings=APIHelper.SKIP, - avatax_details=APIHelper.SKIP, - public_url=APIHelper.SKIP, - previous_balance_data=APIHelper.SKIP, - public_url_expires_on=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Invoice class""" - + def __init__( + self, + id=APIHelper.SKIP, + uid=APIHelper.SKIP, + site_id=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + number=APIHelper.SKIP, + sequence_number=APIHelper.SKIP, + transaction_time=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + issue_date=APIHelper.SKIP, + due_date=APIHelper.SKIP, + paid_date=APIHelper.SKIP, + status=APIHelper.SKIP, + role=APIHelper.SKIP, + parent_invoice_id=APIHelper.SKIP, + collection_method=APIHelper.SKIP, + payment_instructions=APIHelper.SKIP, + currency=APIHelper.SKIP, + consolidation_level=APIHelper.SKIP, + parent_invoice_uid=APIHelper.SKIP, + subscription_group_id=APIHelper.SKIP, + parent_invoice_number=APIHelper.SKIP, + group_primary_subscription_id=APIHelper.SKIP, + product_name=APIHelper.SKIP, + product_family_name=APIHelper.SKIP, + seller=APIHelper.SKIP, + customer=APIHelper.SKIP, + payer=APIHelper.SKIP, + recipient_emails=APIHelper.SKIP, + net_terms=APIHelper.SKIP, + memo=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + subtotal_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + total_amount=APIHelper.SKIP, + credit_amount=APIHelper.SKIP, + debit_amount=APIHelper.SKIP, + refund_amount=APIHelper.SKIP, + paid_amount=APIHelper.SKIP, + due_amount=APIHelper.SKIP, + line_items=APIHelper.SKIP, + discounts=APIHelper.SKIP, + taxes=APIHelper.SKIP, + credits=APIHelper.SKIP, + debits=APIHelper.SKIP, + refunds=APIHelper.SKIP, + payments=APIHelper.SKIP, + custom_fields=APIHelper.SKIP, + display_settings=APIHelper.SKIP, + avatax_details=APIHelper.SKIP, + public_url=APIHelper.SKIP, + previous_balance_data=APIHelper.SKIP, + public_url_expires_on=APIHelper.SKIP, + additional_properties=None): + """Initialize a Invoice instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if number is not APIHelper.SKIP: - self.number = number + self.number = number if sequence_number is not APIHelper.SKIP: - self.sequence_number = sequence_number + self.sequence_number = sequence_number if transaction_time is not APIHelper.SKIP: - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if issue_date is not APIHelper.SKIP: - self.issue_date = issue_date + self.issue_date = issue_date if due_date is not APIHelper.SKIP: - self.due_date = due_date + self.due_date = due_date if paid_date is not APIHelper.SKIP: - self.paid_date = paid_date + self.paid_date = paid_date if status is not APIHelper.SKIP: - self.status = status + self.status = status if role is not APIHelper.SKIP: - self.role = role + self.role = role if parent_invoice_id is not APIHelper.SKIP: - self.parent_invoice_id = parent_invoice_id + self.parent_invoice_id = parent_invoice_id if collection_method is not APIHelper.SKIP: - self.collection_method = collection_method + self.collection_method = collection_method if payment_instructions is not APIHelper.SKIP: - self.payment_instructions = payment_instructions + self.payment_instructions = payment_instructions if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if consolidation_level is not APIHelper.SKIP: - self.consolidation_level = consolidation_level + self.consolidation_level = consolidation_level if parent_invoice_uid is not APIHelper.SKIP: - self.parent_invoice_uid = parent_invoice_uid + self.parent_invoice_uid = parent_invoice_uid if subscription_group_id is not APIHelper.SKIP: - self.subscription_group_id = subscription_group_id + self.subscription_group_id = subscription_group_id if parent_invoice_number is not APIHelper.SKIP: - self.parent_invoice_number = parent_invoice_number + self.parent_invoice_number = parent_invoice_number if group_primary_subscription_id is not APIHelper.SKIP: - self.group_primary_subscription_id = group_primary_subscription_id + self.group_primary_subscription_id = group_primary_subscription_id if product_name is not APIHelper.SKIP: - self.product_name = product_name + self.product_name = product_name if product_family_name is not APIHelper.SKIP: - self.product_family_name = product_family_name + self.product_family_name = product_family_name if seller is not APIHelper.SKIP: - self.seller = seller + self.seller = seller if customer is not APIHelper.SKIP: - self.customer = customer + self.customer = customer if payer is not APIHelper.SKIP: - self.payer = payer + self.payer = payer if recipient_emails is not APIHelper.SKIP: - self.recipient_emails = recipient_emails + self.recipient_emails = recipient_emails if net_terms is not APIHelper.SKIP: - self.net_terms = net_terms + self.net_terms = net_terms if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if shipping_address is not APIHelper.SKIP: - self.shipping_address = shipping_address + self.shipping_address = shipping_address if subtotal_amount is not APIHelper.SKIP: - self.subtotal_amount = subtotal_amount + self.subtotal_amount = subtotal_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if total_amount is not APIHelper.SKIP: - self.total_amount = total_amount + self.total_amount = total_amount if credit_amount is not APIHelper.SKIP: - self.credit_amount = credit_amount + self.credit_amount = credit_amount if debit_amount is not APIHelper.SKIP: - self.debit_amount = debit_amount + self.debit_amount = debit_amount if refund_amount is not APIHelper.SKIP: - self.refund_amount = refund_amount + self.refund_amount = refund_amount if paid_amount is not APIHelper.SKIP: - self.paid_amount = paid_amount + self.paid_amount = paid_amount if due_amount is not APIHelper.SKIP: - self.due_amount = due_amount + self.due_amount = due_amount if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if discounts is not APIHelper.SKIP: - self.discounts = discounts + self.discounts = discounts if taxes is not APIHelper.SKIP: - self.taxes = taxes + self.taxes = taxes if credits is not APIHelper.SKIP: - self.credits = credits + self.credits = credits if debits is not APIHelper.SKIP: - self.debits = debits + self.debits = debits if refunds is not APIHelper.SKIP: - self.refunds = refunds + self.refunds = refunds if payments is not APIHelper.SKIP: - self.payments = payments + self.payments = payments if custom_fields is not APIHelper.SKIP: - self.custom_fields = custom_fields + self.custom_fields = custom_fields if display_settings is not APIHelper.SKIP: - self.display_settings = display_settings + self.display_settings = display_settings if avatax_details is not APIHelper.SKIP: - self.avatax_details = avatax_details + self.avatax_details = avatax_details if public_url is not APIHelper.SKIP: - self.public_url = public_url + self.public_url = public_url if previous_balance_data is not APIHelper.SKIP: - self.previous_balance_data = previous_balance_data + self.previous_balance_data = previous_balance_data if public_url_expires_on is not APIHelper.SKIP: - self.public_url_expires_on = public_url_expires_on + self.public_url_expires_on = public_url_expires_on # Add additional model properties to the instance if additional_properties is None: @@ -461,7 +485,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -472,104 +496,276 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - number = dictionary.get("number") if dictionary.get("number") else APIHelper.SKIP - sequence_number = dictionary.get("sequence_number") if dictionary.get("sequence_number") else APIHelper.SKIP - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - issue_date = dateutil.parser.parse(dictionary.get('issue_date')).date() if dictionary.get('issue_date') else APIHelper.SKIP - due_date = dateutil.parser.parse(dictionary.get('due_date')).date() if dictionary.get('due_date') else APIHelper.SKIP - if 'paid_date' in dictionary.keys(): - paid_date = dateutil.parser.parse(dictionary.get('paid_date')).date() if dictionary.get('paid_date') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else APIHelper.SKIP + sequence_number =\ + dictionary.get("sequence_number")\ + if dictionary.get("sequence_number")\ + else APIHelper.SKIP + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + issue_date = dateutil.parser.parse( + dictionary.get("issue_date")).date()\ + if dictionary.get("issue_date") else APIHelper.SKIP + due_date = dateutil.parser.parse( + dictionary.get("due_date")).date()\ + if dictionary.get("due_date") else APIHelper.SKIP + if "paid_date" in dictionary.keys(): + paid_date = dateutil.parser.parse( + dictionary.get("paid_date")).date()\ + if dictionary.get("paid_date") else None + else: paid_date = APIHelper.SKIP - status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP - role = dictionary.get("role") if dictionary.get("role") else APIHelper.SKIP - parent_invoice_id = dictionary.get("parent_invoice_id") if "parent_invoice_id" in dictionary.keys() else APIHelper.SKIP - collection_method = dictionary.get("collection_method") if dictionary.get("collection_method") else APIHelper.SKIP - payment_instructions = dictionary.get("payment_instructions") if dictionary.get("payment_instructions") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - consolidation_level = dictionary.get("consolidation_level") if dictionary.get("consolidation_level") else APIHelper.SKIP - parent_invoice_uid = dictionary.get("parent_invoice_uid") if "parent_invoice_uid" in dictionary.keys() else APIHelper.SKIP - subscription_group_id = dictionary.get("subscription_group_id") if "subscription_group_id" in dictionary.keys() else APIHelper.SKIP - parent_invoice_number = dictionary.get("parent_invoice_number") if "parent_invoice_number" in dictionary.keys() else APIHelper.SKIP - group_primary_subscription_id = dictionary.get("group_primary_subscription_id") if "group_primary_subscription_id" in dictionary.keys() else APIHelper.SKIP - product_name = dictionary.get("product_name") if dictionary.get("product_name") else APIHelper.SKIP - product_family_name = dictionary.get("product_family_name") if dictionary.get("product_family_name") else APIHelper.SKIP - seller = InvoiceSeller.from_dictionary(dictionary.get('seller')) if 'seller' in dictionary.keys() else APIHelper.SKIP - customer = InvoiceCustomer.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP - payer = InvoicePayer.from_dictionary(dictionary.get('payer')) if 'payer' in dictionary.keys() else APIHelper.SKIP - recipient_emails = dictionary.get("recipient_emails") if dictionary.get("recipient_emails") else APIHelper.SKIP - net_terms = dictionary.get("net_terms") if dictionary.get("net_terms") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - billing_address = InvoiceAddress.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP - shipping_address = InvoiceAddress.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP - subtotal_amount = dictionary.get("subtotal_amount") if dictionary.get("subtotal_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else APIHelper.SKIP - credit_amount = dictionary.get("credit_amount") if dictionary.get("credit_amount") else APIHelper.SKIP - debit_amount = dictionary.get("debit_amount") if dictionary.get("debit_amount") else APIHelper.SKIP - refund_amount = dictionary.get("refund_amount") if dictionary.get("refund_amount") else APIHelper.SKIP - paid_amount = dictionary.get("paid_amount") if dictionary.get("paid_amount") else APIHelper.SKIP - due_amount = dictionary.get("due_amount") if dictionary.get("due_amount") else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else APIHelper.SKIP + parent_invoice_id =\ + dictionary.get("parent_invoice_id")\ + if "parent_invoice_id" in dictionary.keys()\ + else APIHelper.SKIP + collection_method =\ + dictionary.get("collection_method")\ + if dictionary.get("collection_method")\ + else APIHelper.SKIP + payment_instructions =\ + dictionary.get("payment_instructions")\ + if dictionary.get("payment_instructions")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + consolidation_level =\ + dictionary.get("consolidation_level")\ + if dictionary.get("consolidation_level")\ + else APIHelper.SKIP + parent_invoice_uid =\ + dictionary.get("parent_invoice_uid")\ + if "parent_invoice_uid" in dictionary.keys()\ + else APIHelper.SKIP + subscription_group_id =\ + dictionary.get("subscription_group_id")\ + if "subscription_group_id" in dictionary.keys()\ + else APIHelper.SKIP + parent_invoice_number =\ + dictionary.get("parent_invoice_number")\ + if "parent_invoice_number" in dictionary.keys()\ + else APIHelper.SKIP + group_primary_subscription_id =\ + dictionary.get("group_primary_subscription_id")\ + if "group_primary_subscription_id" in dictionary.keys()\ + else APIHelper.SKIP + product_name =\ + dictionary.get("product_name")\ + if dictionary.get("product_name")\ + else APIHelper.SKIP + product_family_name =\ + dictionary.get("product_family_name")\ + if dictionary.get("product_family_name")\ + else APIHelper.SKIP + seller =\ + InvoiceSeller.from_dictionary( + dictionary.get("seller"))\ + if "seller" in dictionary.keys()\ + else APIHelper.SKIP + customer =\ + InvoiceCustomer.from_dictionary( + dictionary.get("customer"))\ + if "customer" in dictionary.keys()\ + else APIHelper.SKIP + payer =\ + InvoicePayer.from_dictionary( + dictionary.get("payer"))\ + if "payer" in dictionary.keys()\ + else APIHelper.SKIP + recipient_emails =\ + dictionary.get("recipient_emails")\ + if dictionary.get("recipient_emails")\ + else APIHelper.SKIP + net_terms =\ + dictionary.get("net_terms")\ + if dictionary.get("net_terms")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + billing_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("billing_address"))\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + shipping_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("shipping_address"))\ + if "shipping_address" in dictionary.keys()\ + else APIHelper.SKIP + subtotal_amount =\ + dictionary.get("subtotal_amount")\ + if dictionary.get("subtotal_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else APIHelper.SKIP + credit_amount =\ + dictionary.get("credit_amount")\ + if dictionary.get("credit_amount")\ + else APIHelper.SKIP + debit_amount =\ + dictionary.get("debit_amount")\ + if dictionary.get("debit_amount")\ + else APIHelper.SKIP + refund_amount =\ + dictionary.get("refund_amount")\ + if dictionary.get("refund_amount")\ + else APIHelper.SKIP + paid_amount =\ + dictionary.get("paid_amount")\ + if dictionary.get("paid_amount")\ + else APIHelper.SKIP + due_amount =\ + dictionary.get("due_amount")\ + if dictionary.get("due_amount")\ + else APIHelper.SKIP line_items = None - if dictionary.get('line_items') is not None: - line_items = [InvoiceLineItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + InvoiceLineItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP discounts = None - if dictionary.get('discounts') is not None: - discounts = [InvoiceDiscount.from_dictionary(x) for x in dictionary.get('discounts')] + if dictionary.get("discounts") is not None: + discounts = [ + InvoiceDiscount.from_dictionary(x) + for x in dictionary.get("discounts") + ] else: discounts = APIHelper.SKIP taxes = None - if dictionary.get('taxes') is not None: - taxes = [InvoiceTax.from_dictionary(x) for x in dictionary.get('taxes')] + if dictionary.get("taxes") is not None: + taxes = [ + InvoiceTax.from_dictionary(x) + for x in dictionary.get("taxes") + ] else: taxes = APIHelper.SKIP credits = None - if dictionary.get('credits') is not None: - credits = [InvoiceCredit.from_dictionary(x) for x in dictionary.get('credits')] + if dictionary.get("credits") is not None: + credits = [ + InvoiceCredit.from_dictionary(x) + for x in dictionary.get("credits") + ] else: credits = APIHelper.SKIP debits = None - if dictionary.get('debits') is not None: - debits = [InvoiceDebit.from_dictionary(x) for x in dictionary.get('debits')] + if dictionary.get("debits") is not None: + debits = [ + InvoiceDebit.from_dictionary(x) + for x in dictionary.get("debits") + ] else: debits = APIHelper.SKIP refunds = None - if dictionary.get('refunds') is not None: - refunds = [InvoiceRefund.from_dictionary(x) for x in dictionary.get('refunds')] + if dictionary.get("refunds") is not None: + refunds = [ + InvoiceRefund.from_dictionary(x) + for x in dictionary.get("refunds") + ] else: refunds = APIHelper.SKIP payments = None - if dictionary.get('payments') is not None: - payments = [InvoicePayment.from_dictionary(x) for x in dictionary.get('payments')] + if dictionary.get("payments") is not None: + payments = [ + InvoicePayment.from_dictionary(x) + for x in dictionary.get("payments") + ] else: payments = APIHelper.SKIP custom_fields = None - if dictionary.get('custom_fields') is not None: - custom_fields = [InvoiceCustomField.from_dictionary(x) for x in dictionary.get('custom_fields')] + if dictionary.get("custom_fields") is not None: + custom_fields = [ + InvoiceCustomField.from_dictionary(x) + for x in dictionary.get("custom_fields") + ] else: custom_fields = APIHelper.SKIP - display_settings = InvoiceDisplaySettings.from_dictionary(dictionary.get('display_settings')) if 'display_settings' in dictionary.keys() else APIHelper.SKIP - avatax_details = InvoiceAvataxDetails.from_dictionary(dictionary.get('avatax_details')) if 'avatax_details' in dictionary.keys() else APIHelper.SKIP - public_url = dictionary.get("public_url") if dictionary.get("public_url") else APIHelper.SKIP - previous_balance_data = InvoicePreviousBalance.from_dictionary(dictionary.get('previous_balance_data')) if 'previous_balance_data' in dictionary.keys() else APIHelper.SKIP - public_url_expires_on = dateutil.parser.parse(dictionary.get('public_url_expires_on')).date() if dictionary.get('public_url_expires_on') else APIHelper.SKIP + display_settings =\ + InvoiceDisplaySettings.from_dictionary( + dictionary.get("display_settings"))\ + if "display_settings" in dictionary.keys()\ + else APIHelper.SKIP + avatax_details =\ + InvoiceAvataxDetails.from_dictionary( + dictionary.get("avatax_details"))\ + if "avatax_details" in dictionary.keys()\ + else APIHelper.SKIP + public_url =\ + dictionary.get("public_url")\ + if dictionary.get("public_url")\ + else APIHelper.SKIP + previous_balance_data =\ + InvoicePreviousBalance.from_dictionary( + dictionary.get("previous_balance_data"))\ + if "previous_balance_data" in dictionary.keys()\ + else APIHelper.SKIP + public_url_expires_on = dateutil.parser.parse( + dictionary.get("public_url_expires_on")).date()\ + if dictionary.get("public_url_expires_on") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, uid, @@ -631,7 +827,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -642,7 +838,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -652,121 +847,691 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'number={(self.number if hasattr(self, "number") else None)!r}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!r}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!r}, ' - f'due_date={(self.due_date if hasattr(self, "due_date") else None)!r}, ' - f'paid_date={(self.paid_date if hasattr(self, "paid_date") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'role={(self.role if hasattr(self, "role") else None)!r}, ' - f'parent_invoice_id={(self.parent_invoice_id if hasattr(self, "parent_invoice_id") else None)!r}, ' - f'collection_method={(self.collection_method if hasattr(self, "collection_method") else None)!r}, ' - f'payment_instructions={(self.payment_instructions if hasattr(self, "payment_instructions") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!r}, ' - f'parent_invoice_uid={(self.parent_invoice_uid if hasattr(self, "parent_invoice_uid") else None)!r}, ' - f'subscription_group_id={(self.subscription_group_id if hasattr(self, "subscription_group_id") else None)!r}, ' - f'parent_invoice_number={(self.parent_invoice_number if hasattr(self, "parent_invoice_number") else None)!r}, ' - f'group_primary_subscription_id={(self.group_primary_subscription_id if hasattr(self, "group_primary_subscription_id") else None)!r}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!r}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!r}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!r}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' - f'payer={(self.payer if hasattr(self, "payer") else None)!r}, ' - f'recipient_emails={(self.recipient_emails if hasattr(self, "recipient_emails") else None)!r}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!r}, ' - f'credit_amount={(self.credit_amount if hasattr(self, "credit_amount") else None)!r}, ' - f'debit_amount={(self.debit_amount if hasattr(self, "debit_amount") else None)!r}, ' - f'refund_amount={(self.refund_amount if hasattr(self, "refund_amount") else None)!r}, ' - f'paid_amount={(self.paid_amount if hasattr(self, "paid_amount") else None)!r}, ' - f'due_amount={(self.due_amount if hasattr(self, "due_amount") else None)!r}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!r}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r}, ' - f'credits={(self.credits if hasattr(self, "credits") else None)!r}, ' - f'debits={(self.debits if hasattr(self, "debits") else None)!r}, ' - f'refunds={(self.refunds if hasattr(self, "refunds") else None)!r}, ' - f'payments={(self.payments if hasattr(self, "payments") else None)!r}, ' - f'custom_fields={(self.custom_fields if hasattr(self, "custom_fields") else None)!r}, ' - f'display_settings={(self.display_settings if hasattr(self, "display_settings") else None)!r}, ' - f'avatax_details={(self.avatax_details if hasattr(self, "avatax_details") else None)!r}, ' - f'public_url={(self.public_url if hasattr(self, "public_url") else None)!r}, ' - f'previous_balance_data={(self.previous_balance_data if hasattr(self, "previous_balance_data") else None)!r}, ' - f'public_url_expires_on={(self.public_url_expires_on if hasattr(self, "public_url_expires_on") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _due_date=( + self.due_date + if hasattr(self, "due_date") + else None + ) + _paid_date=( + self.paid_date + if hasattr(self, "paid_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _parent_invoice_id=( + self.parent_invoice_id + if hasattr(self, "parent_invoice_id") + else None + ) + _collection_method=( + self.collection_method + if hasattr(self, "collection_method") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _parent_invoice_uid=( + self.parent_invoice_uid + if hasattr(self, "parent_invoice_uid") + else None + ) + _subscription_group_id=( + self.subscription_group_id + if hasattr(self, "subscription_group_id") + else None + ) + _parent_invoice_number=( + self.parent_invoice_number + if hasattr(self, "parent_invoice_number") + else None + ) + _group_primary_subscription_id=( + self.group_primary_subscription_id + if hasattr(self, "group_primary_subscription_id") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _payer=( + self.payer + if hasattr(self, "payer") + else None + ) + _recipient_emails=( + self.recipient_emails + if hasattr(self, "recipient_emails") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _credit_amount=( + self.credit_amount + if hasattr(self, "credit_amount") + else None + ) + _debit_amount=( + self.debit_amount + if hasattr(self, "debit_amount") + else None + ) + _refund_amount=( + self.refund_amount + if hasattr(self, "refund_amount") + else None + ) + _paid_amount=( + self.paid_amount + if hasattr(self, "paid_amount") + else None + ) + _due_amount=( + self.due_amount + if hasattr(self, "due_amount") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _credits=( + self.credits + if hasattr(self, "credits") + else None + ) + _debits=( + self.debits + if hasattr(self, "debits") + else None + ) + _refunds=( + self.refunds + if hasattr(self, "refunds") + else None + ) + _payments=( + self.payments + if hasattr(self, "payments") + else None + ) + _custom_fields=( + self.custom_fields + if hasattr(self, "custom_fields") + else None + ) + _display_settings=( + self.display_settings + if hasattr(self, "display_settings") + else None + ) + _avatax_details=( + self.avatax_details + if hasattr(self, "avatax_details") + else None + ) + _public_url=( + self.public_url + if hasattr(self, "public_url") + else None + ) + _previous_balance_data=( + self.previous_balance_data + if hasattr(self, "previous_balance_data") + else None + ) + _public_url_expires_on=( + self.public_url_expires_on + if hasattr(self, "public_url_expires_on") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"uid={_uid!r}, " + f"site_id={_site_id!r}, " + f"customer_id={_customer_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"number={_number!r}, " + f"sequence_number={_sequence_number!r}, " + f"transaction_time={_transaction_time!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"issue_date={_issue_date!r}, " + f"due_date={_due_date!r}, " + f"paid_date={_paid_date!r}, " + f"status={_status!r}, " + f"role={_role!r}, " + f"parent_invoice_id={_parent_invoice_id!r}, " + f"collection_method={_collection_method!r}, " + f"payment_instructions={_payment_instructions!r}, " + f"currency={_currency!r}, " + f"consolidation_level={_consolidation_level!r}, " + f"parent_invoice_uid={_parent_invoice_uid!r}, " + f"subscription_group_id={_subscription_group_id!r}, " + f"parent_invoice_number={_parent_invoice_number!r}, " + f"group_primary_subscription_id={_group_primary_subscription_id!r}, " + f"product_name={_product_name!r}, " + f"product_family_name={_product_family_name!r}, " + f"seller={_seller!r}, " + f"customer={_customer!r}, " + f"payer={_payer!r}, " + f"recipient_emails={_recipient_emails!r}, " + f"net_terms={_net_terms!r}, " + f"memo={_memo!r}, " + f"billing_address={_billing_address!r}, " + f"shipping_address={_shipping_address!r}, " + f"subtotal_amount={_subtotal_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"total_amount={_total_amount!r}, " + f"credit_amount={_credit_amount!r}, " + f"debit_amount={_debit_amount!r}, " + f"refund_amount={_refund_amount!r}, " + f"paid_amount={_paid_amount!r}, " + f"due_amount={_due_amount!r}, " + f"line_items={_line_items!r}, " + f"discounts={_discounts!r}, " + f"taxes={_taxes!r}, " + f"credits={_credits!r}, " + f"debits={_debits!r}, " + f"refunds={_refunds!r}, " + f"payments={_payments!r}, " + f"custom_fields={_custom_fields!r}, " + f"display_settings={_display_settings!r}, " + f"avatax_details={_avatax_details!r}, " + f"public_url={_public_url!r}, " + f"previous_balance_data={_previous_balance_data!r}, " + f"public_url_expires_on={_public_url_expires_on!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'number={(self.number if hasattr(self, "number") else None)!s}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!s}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'issue_date={(self.issue_date if hasattr(self, "issue_date") else None)!s}, ' - f'due_date={(self.due_date if hasattr(self, "due_date") else None)!s}, ' - f'paid_date={(self.paid_date if hasattr(self, "paid_date") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'role={(self.role if hasattr(self, "role") else None)!s}, ' - f'parent_invoice_id={(self.parent_invoice_id if hasattr(self, "parent_invoice_id") else None)!s}, ' - f'collection_method={(self.collection_method if hasattr(self, "collection_method") else None)!s}, ' - f'payment_instructions={(self.payment_instructions if hasattr(self, "payment_instructions") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!s}, ' - f'parent_invoice_uid={(self.parent_invoice_uid if hasattr(self, "parent_invoice_uid") else None)!s}, ' - f'subscription_group_id={(self.subscription_group_id if hasattr(self, "subscription_group_id") else None)!s}, ' - f'parent_invoice_number={(self.parent_invoice_number if hasattr(self, "parent_invoice_number") else None)!s}, ' - f'group_primary_subscription_id={(self.group_primary_subscription_id if hasattr(self, "group_primary_subscription_id") else None)!s}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!s}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!s}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!s}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' - f'payer={(self.payer if hasattr(self, "payer") else None)!s}, ' - f'recipient_emails={(self.recipient_emails if hasattr(self, "recipient_emails") else None)!s}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!s}, ' - f'credit_amount={(self.credit_amount if hasattr(self, "credit_amount") else None)!s}, ' - f'debit_amount={(self.debit_amount if hasattr(self, "debit_amount") else None)!s}, ' - f'refund_amount={(self.refund_amount if hasattr(self, "refund_amount") else None)!s}, ' - f'paid_amount={(self.paid_amount if hasattr(self, "paid_amount") else None)!s}, ' - f'due_amount={(self.due_amount if hasattr(self, "due_amount") else None)!s}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!s}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s}, ' - f'credits={(self.credits if hasattr(self, "credits") else None)!s}, ' - f'debits={(self.debits if hasattr(self, "debits") else None)!s}, ' - f'refunds={(self.refunds if hasattr(self, "refunds") else None)!s}, ' - f'payments={(self.payments if hasattr(self, "payments") else None)!s}, ' - f'custom_fields={(self.custom_fields if hasattr(self, "custom_fields") else None)!s}, ' - f'display_settings={(self.display_settings if hasattr(self, "display_settings") else None)!s}, ' - f'avatax_details={(self.avatax_details if hasattr(self, "avatax_details") else None)!s}, ' - f'public_url={(self.public_url if hasattr(self, "public_url") else None)!s}, ' - f'previous_balance_data={(self.previous_balance_data if hasattr(self, "previous_balance_data") else None)!s}, ' - f'public_url_expires_on={(self.public_url_expires_on if hasattr(self, "public_url_expires_on") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _due_date=( + self.due_date + if hasattr(self, "due_date") + else None + ) + _paid_date=( + self.paid_date + if hasattr(self, "paid_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _parent_invoice_id=( + self.parent_invoice_id + if hasattr(self, "parent_invoice_id") + else None + ) + _collection_method=( + self.collection_method + if hasattr(self, "collection_method") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _parent_invoice_uid=( + self.parent_invoice_uid + if hasattr(self, "parent_invoice_uid") + else None + ) + _subscription_group_id=( + self.subscription_group_id + if hasattr(self, "subscription_group_id") + else None + ) + _parent_invoice_number=( + self.parent_invoice_number + if hasattr(self, "parent_invoice_number") + else None + ) + _group_primary_subscription_id=( + self.group_primary_subscription_id + if hasattr(self, "group_primary_subscription_id") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _payer=( + self.payer + if hasattr(self, "payer") + else None + ) + _recipient_emails=( + self.recipient_emails + if hasattr(self, "recipient_emails") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _credit_amount=( + self.credit_amount + if hasattr(self, "credit_amount") + else None + ) + _debit_amount=( + self.debit_amount + if hasattr(self, "debit_amount") + else None + ) + _refund_amount=( + self.refund_amount + if hasattr(self, "refund_amount") + else None + ) + _paid_amount=( + self.paid_amount + if hasattr(self, "paid_amount") + else None + ) + _due_amount=( + self.due_amount + if hasattr(self, "due_amount") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _credits=( + self.credits + if hasattr(self, "credits") + else None + ) + _debits=( + self.debits + if hasattr(self, "debits") + else None + ) + _refunds=( + self.refunds + if hasattr(self, "refunds") + else None + ) + _payments=( + self.payments + if hasattr(self, "payments") + else None + ) + _custom_fields=( + self.custom_fields + if hasattr(self, "custom_fields") + else None + ) + _display_settings=( + self.display_settings + if hasattr(self, "display_settings") + else None + ) + _avatax_details=( + self.avatax_details + if hasattr(self, "avatax_details") + else None + ) + _public_url=( + self.public_url + if hasattr(self, "public_url") + else None + ) + _previous_balance_data=( + self.previous_balance_data + if hasattr(self, "previous_balance_data") + else None + ) + _public_url_expires_on=( + self.public_url_expires_on + if hasattr(self, "public_url_expires_on") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"uid={_uid!s}, " + f"site_id={_site_id!s}, " + f"customer_id={_customer_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"number={_number!s}, " + f"sequence_number={_sequence_number!s}, " + f"transaction_time={_transaction_time!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"issue_date={_issue_date!s}, " + f"due_date={_due_date!s}, " + f"paid_date={_paid_date!s}, " + f"status={_status!s}, " + f"role={_role!s}, " + f"parent_invoice_id={_parent_invoice_id!s}, " + f"collection_method={_collection_method!s}, " + f"payment_instructions={_payment_instructions!s}, " + f"currency={_currency!s}, " + f"consolidation_level={_consolidation_level!s}, " + f"parent_invoice_uid={_parent_invoice_uid!s}, " + f"subscription_group_id={_subscription_group_id!s}, " + f"parent_invoice_number={_parent_invoice_number!s}, " + f"group_primary_subscription_id={_group_primary_subscription_id!s}, " + f"product_name={_product_name!s}, " + f"product_family_name={_product_family_name!s}, " + f"seller={_seller!s}, " + f"customer={_customer!s}, " + f"payer={_payer!s}, " + f"recipient_emails={_recipient_emails!s}, " + f"net_terms={_net_terms!s}, " + f"memo={_memo!s}, " + f"billing_address={_billing_address!s}, " + f"shipping_address={_shipping_address!s}, " + f"subtotal_amount={_subtotal_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"total_amount={_total_amount!s}, " + f"credit_amount={_credit_amount!s}, " + f"debit_amount={_debit_amount!s}, " + f"refund_amount={_refund_amount!s}, " + f"paid_amount={_paid_amount!s}, " + f"due_amount={_due_amount!s}, " + f"line_items={_line_items!s}, " + f"discounts={_discounts!s}, " + f"taxes={_taxes!s}, " + f"credits={_credits!s}, " + f"debits={_debits!s}, " + f"refunds={_refunds!s}, " + f"payments={_payments!s}, " + f"custom_fields={_custom_fields!s}, " + f"display_settings={_display_settings!s}, " + f"avatax_details={_avatax_details!s}, " + f"public_url={_public_url!s}, " + f"previous_balance_data={_previous_balance_data!s}, " + f"public_url_expires_on={_public_url_expires_on!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_address.py b/advancedbilling/models/invoice_address.py index c8314456..616cded0 100644 --- a/advancedbilling/models/invoice_address.py +++ b/advancedbilling/models/invoice_address.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceAddress(object): - """Implementation of the 'Invoice Address' model. Attributes: @@ -20,62 +18,62 @@ class InvoiceAddress(object): state (str): The model property of type str. zip (str): The model property of type str. country (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "street": 'street', - "line_2": 'line2', - "city": 'city', - "state": 'state', - "zip": 'zip', - "country": 'country' + "street": "street", + "line_2": "line2", + "city": "city", + "state": "state", + "zip": "zip", + "country": "country", } _optionals = [ - 'street', - 'line_2', - 'city', - 'state', - 'zip', - 'country', + "street", + "line_2", + "city", + "state", + "zip", + "country", ] _nullables = [ - 'street', - 'line_2', - 'city', - 'state', - 'zip', - 'country', + "street", + "line_2", + "city", + "state", + "zip", + "country", ] - def __init__(self, - street=APIHelper.SKIP, - line_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceAddress class""" - + def __init__( + self, + street=APIHelper.SKIP, + line_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceAddress instance.""" # Initialize members of the class if street is not APIHelper.SKIP: - self.street = street + self.street = street if line_2 is not APIHelper.SKIP: - self.line_2 = line_2 + self.line_2 = line_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country # Add additional model properties to the instance if additional_properties is None: @@ -85,7 +83,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -96,19 +94,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - street = dictionary.get("street") if "street" in dictionary.keys() else APIHelper.SKIP - line_2 = dictionary.get("line2") if "line2" in dictionary.keys() else APIHelper.SKIP - city = dictionary.get("city") if "city" in dictionary.keys() else APIHelper.SKIP - state = dictionary.get("state") if "state" in dictionary.keys() else APIHelper.SKIP - zip = dictionary.get("zip") if "zip" in dictionary.keys() else APIHelper.SKIP - country = dictionary.get("country") if "country" in dictionary.keys() else APIHelper.SKIP + street =\ + dictionary.get("street")\ + if "street" in dictionary.keys()\ + else APIHelper.SKIP + line_2 =\ + dictionary.get("line2")\ + if "line2" in dictionary.keys()\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if "city" in dictionary.keys()\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if "state" in dictionary.keys()\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if "zip" in dictionary.keys()\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if "country" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(street, line_2, @@ -120,7 +138,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -131,7 +149,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -141,21 +158,91 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'street={(self.street if hasattr(self, "street") else None)!r}, ' - f'line_2={(self.line_2 if hasattr(self, "line_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _street=( + self.street + if hasattr(self, "street") + else None + ) + _line_2=( + self.line_2 + if hasattr(self, "line_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"street={_street!r}, " + f"line_2={_line_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'street={(self.street if hasattr(self, "street") else None)!s}, ' - f'line_2={(self.line_2 if hasattr(self, "line_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _street=( + self.street + if hasattr(self, "street") + else None + ) + _line_2=( + self.line_2 + if hasattr(self, "line_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"street={_street!s}, " + f"line_2={_line_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_avatax_details.py b/advancedbilling/models/invoice_avatax_details.py index dfaa5a94..30c4945c 100644 --- a/advancedbilling/models/invoice_avatax_details.py +++ b/advancedbilling/models/invoice_avatax_details.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceAvataxDetails(object): - """Implementation of the 'Invoice Avatax Details' model. Attributes: @@ -19,56 +17,62 @@ class InvoiceAvataxDetails(object): document_code (str): The model property of type str. commit_date (datetime): The model property of type datetime. modify_date (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "status": 'status', - "document_code": 'document_code', - "commit_date": 'commit_date', - "modify_date": 'modify_date' + "id": "id", + "status": "status", + "document_code": "document_code", + "commit_date": "commit_date", + "modify_date": "modify_date", } _optionals = [ - 'id', - 'status', - 'document_code', - 'commit_date', - 'modify_date', + "id", + "status", + "document_code", + "commit_date", + "modify_date", ] _nullables = [ - 'id', - 'status', - 'document_code', - 'commit_date', - 'modify_date', + "id", + "status", + "document_code", + "commit_date", + "modify_date", ] - def __init__(self, - id=APIHelper.SKIP, - status=APIHelper.SKIP, - document_code=APIHelper.SKIP, - commit_date=APIHelper.SKIP, - modify_date=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceAvataxDetails class""" - + def __init__( + self, + id=APIHelper.SKIP, + status=APIHelper.SKIP, + document_code=APIHelper.SKIP, + commit_date=APIHelper.SKIP, + modify_date=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceAvataxDetails instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if status is not APIHelper.SKIP: - self.status = status + self.status = status if document_code is not APIHelper.SKIP: - self.document_code = document_code + self.document_code = document_code if commit_date is not APIHelper.SKIP: - self.commit_date = APIHelper.apply_datetime_converter(commit_date, APIHelper.RFC3339DateTime) if commit_date else None + self.commit_date =\ + APIHelper.apply_datetime_converter( + commit_date, APIHelper.RFC3339DateTime)\ + if commit_date else None if modify_date is not APIHelper.SKIP: - self.modify_date = APIHelper.apply_datetime_converter(modify_date, APIHelper.RFC3339DateTime) if modify_date else None + self.modify_date =\ + APIHelper.apply_datetime_converter( + modify_date, APIHelper.RFC3339DateTime)\ + if modify_date else None # Add additional model properties to the instance if additional_properties is None: @@ -78,7 +82,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -89,24 +93,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if "id" in dictionary.keys() else APIHelper.SKIP - status = dictionary.get("status") if "status" in dictionary.keys() else APIHelper.SKIP - document_code = dictionary.get("document_code") if "document_code" in dictionary.keys() else APIHelper.SKIP - if 'commit_date' in dictionary.keys(): - commit_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("commit_date")).datetime if dictionary.get("commit_date") else None + id =\ + dictionary.get("id")\ + if "id" in dictionary.keys()\ + else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if "status" in dictionary.keys()\ + else APIHelper.SKIP + document_code =\ + dictionary.get("document_code")\ + if "document_code" in dictionary.keys()\ + else APIHelper.SKIP + if "commit_date" in dictionary.keys(): + commit_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("commit_date")).datetime\ + if dictionary.get("commit_date") else None + else: commit_date = APIHelper.SKIP - if 'modify_date' in dictionary.keys(): - modify_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("modify_date")).datetime if dictionary.get("modify_date") else None + if "modify_date" in dictionary.keys(): + modify_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("modify_date")).datetime\ + if dictionary.get("modify_date") else None + else: modify_date = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, status, @@ -117,7 +138,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -128,7 +149,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -138,19 +158,79 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'document_code={(self.document_code if hasattr(self, "document_code") else None)!r}, ' - f'commit_date={(self.commit_date if hasattr(self, "commit_date") else None)!r}, ' - f'modify_date={(self.modify_date if hasattr(self, "modify_date") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _document_code=( + self.document_code + if hasattr(self, "document_code") + else None + ) + _commit_date=( + self.commit_date + if hasattr(self, "commit_date") + else None + ) + _modify_date=( + self.modify_date + if hasattr(self, "modify_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"status={_status!r}, " + f"document_code={_document_code!r}, " + f"commit_date={_commit_date!r}, " + f"modify_date={_modify_date!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'document_code={(self.document_code if hasattr(self, "document_code") else None)!s}, ' - f'commit_date={(self.commit_date if hasattr(self, "commit_date") else None)!s}, ' - f'modify_date={(self.modify_date if hasattr(self, "modify_date") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _document_code=( + self.document_code + if hasattr(self, "document_code") + else None + ) + _commit_date=( + self.commit_date + if hasattr(self, "commit_date") + else None + ) + _modify_date=( + self.modify_date + if hasattr(self, "modify_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"status={_status!s}, " + f"document_code={_document_code!s}, " + f"commit_date={_commit_date!s}, " + f"modify_date={_modify_date!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_balance_item.py b/advancedbilling/models/invoice_balance_item.py index 4ff93fe5..8c350579 100644 --- a/advancedbilling/models/invoice_balance_item.py +++ b/advancedbilling/models/invoice_balance_item.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceBalanceItem(object): - """Implementation of the 'Invoice Balance Item' model. Attributes: uid (str): The model property of type str. number (str): The model property of type str. outstanding_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "number": 'number', - "outstanding_amount": 'outstanding_amount' + "uid": "uid", + "number": "number", + "outstanding_amount": "outstanding_amount", } _optionals = [ - 'uid', - 'number', - 'outstanding_amount', + "uid", + "number", + "outstanding_amount", ] - def __init__(self, - uid=APIHelper.SKIP, - number=APIHelper.SKIP, - outstanding_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceBalanceItem class""" - + def __init__( + self, + uid=APIHelper.SKIP, + number=APIHelper.SKIP, + outstanding_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceBalanceItem instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if number is not APIHelper.SKIP: - self.number = number + self.number = number if outstanding_amount is not APIHelper.SKIP: - self.outstanding_amount = outstanding_amount + self.outstanding_amount = outstanding_amount # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - number = dictionary.get("number") if dictionary.get("number") else APIHelper.SKIP - outstanding_amount = dictionary.get("outstanding_amount") if dictionary.get("outstanding_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else APIHelper.SKIP + outstanding_amount =\ + dictionary.get("outstanding_amount")\ + if dictionary.get("outstanding_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, number, @@ -87,7 +96,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -98,7 +107,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -108,15 +116,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'number={(self.number if hasattr(self, "number") else None)!r}, ' - f'outstanding_amount={(self.outstanding_amount if hasattr(self, "outstanding_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _outstanding_amount=( + self.outstanding_amount + if hasattr(self, "outstanding_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"number={_number!r}, " + f"outstanding_amount={_outstanding_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'number={(self.number if hasattr(self, "number") else None)!s}, ' - f'outstanding_amount={(self.outstanding_amount if hasattr(self, "outstanding_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _outstanding_amount=( + self.outstanding_amount + if hasattr(self, "outstanding_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"number={_number!s}, " + f"outstanding_amount={_outstanding_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_consolidation_level.py b/advancedbilling/models/invoice_consolidation_level.py index 02931210..c88d062c 100644 --- a/advancedbilling/models/invoice_consolidation_level.py +++ b/advancedbilling/models/invoice_consolidation_level.py @@ -1,48 +1,45 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceConsolidationLevel(object): - """Implementation of the 'Invoice Consolidation Level' enum. - Consolidation level of the invoice, which is applicable to invoice - consolidation. It will hold one of the following values: + Consolidation level of the invoice, which is applicable to invoice consolidation. + It will hold one of the following values: * "none": A normal invoice with no consolidation. - * "child": An invoice segment which has been combined into a consolidated - invoice. + * "child": An invoice segment which has been combined into a consolidated invoice. * "parent": A consolidated invoice, whose contents are composed of invoice segments. - "Parent" invoices do not have lines of their own, but they have subtotals - and totals which aggregate the member invoice segments. + "Parent" invoices do not have lines of their own, but they have subtotals and + totals which aggregate the member invoice segments. See also the [invoice consolidation - documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-I - nvoice-Consolidation). + documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice- + Consolidation). Attributes: NONE: The enum member of type str. CHILD: The enum member of type str. PARENT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['none', 'child', 'parent'] - NONE = 'none' - CHILD = 'child' + _all_values = ["none", "child", "parent"] + NONE = "none" - PARENT = 'parent' + CHILD = "child" + + PARENT = "parent" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -52,9 +49,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_credit.py b/advancedbilling/models/invoice_credit.py index 184cf287..1e94e939 100644 --- a/advancedbilling/models/invoice_credit.py +++ b/advancedbilling/models/invoice_credit.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceCredit(object): - """Implementation of the 'Invoice Credit' model. Attributes: @@ -21,58 +19,61 @@ class InvoiceCredit(object): memo (str): The model property of type str. original_amount (str): The model property of type str. applied_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "credit_note_number": 'credit_note_number', - "credit_note_uid": 'credit_note_uid', - "transaction_time": 'transaction_time', - "memo": 'memo', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount' + "uid": "uid", + "credit_note_number": "credit_note_number", + "credit_note_uid": "credit_note_uid", + "transaction_time": "transaction_time", + "memo": "memo", + "original_amount": "original_amount", + "applied_amount": "applied_amount", } _optionals = [ - 'uid', - 'credit_note_number', - 'credit_note_uid', - 'transaction_time', - 'memo', - 'original_amount', - 'applied_amount', + "uid", + "credit_note_number", + "credit_note_uid", + "transaction_time", + "memo", + "original_amount", + "applied_amount", ] - def __init__(self, - uid=APIHelper.SKIP, - credit_note_number=APIHelper.SKIP, - credit_note_uid=APIHelper.SKIP, - transaction_time=APIHelper.SKIP, - memo=APIHelper.SKIP, - original_amount=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceCredit class""" - + def __init__( + self, + uid=APIHelper.SKIP, + credit_note_number=APIHelper.SKIP, + credit_note_uid=APIHelper.SKIP, + transaction_time=APIHelper.SKIP, + memo=APIHelper.SKIP, + original_amount=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceCredit instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if credit_note_number is not APIHelper.SKIP: - self.credit_note_number = credit_note_number + self.credit_note_number = credit_note_number if credit_note_uid is not APIHelper.SKIP: - self.credit_note_uid = credit_note_uid + self.credit_note_uid = credit_note_uid if transaction_time is not APIHelper.SKIP: - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount + self.original_amount = original_amount if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount # Add additional model properties to the instance if additional_properties is None: @@ -82,7 +83,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -93,20 +94,42 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - credit_note_number = dictionary.get("credit_note_number") if dictionary.get("credit_note_number") else APIHelper.SKIP - credit_note_uid = dictionary.get("credit_note_uid") if dictionary.get("credit_note_uid") else APIHelper.SKIP - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + credit_note_number =\ + dictionary.get("credit_note_number")\ + if dictionary.get("credit_note_number")\ + else APIHelper.SKIP + credit_note_uid =\ + dictionary.get("credit_note_uid")\ + if dictionary.get("credit_note_uid")\ + else APIHelper.SKIP + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, credit_note_number, @@ -119,7 +142,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -130,7 +153,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -140,23 +162,103 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'credit_note_number={(self.credit_note_number if hasattr(self, "credit_note_number") else None)!r}, ' - f'credit_note_uid={(self.credit_note_uid if hasattr(self, "credit_note_uid") else None)!r}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _credit_note_number=( + self.credit_note_number + if hasattr(self, "credit_note_number") + else None + ) + _credit_note_uid=( + self.credit_note_uid + if hasattr(self, "credit_note_uid") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"credit_note_number={_credit_note_number!r}, " + f"credit_note_uid={_credit_note_uid!r}, " + f"transaction_time={_transaction_time!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'credit_note_number={(self.credit_note_number if hasattr(self, "credit_note_number") else None)!s}, ' - f'credit_note_uid={(self.credit_note_uid if hasattr(self, "credit_note_uid") else None)!s}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _credit_note_number=( + self.credit_note_number + if hasattr(self, "credit_note_number") + else None + ) + _credit_note_uid=( + self.credit_note_uid + if hasattr(self, "credit_note_uid") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"credit_note_number={_credit_note_number!s}, " + f"credit_note_uid={_credit_note_uid!s}, " + f"transaction_time={_transaction_time!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_custom_field.py b/advancedbilling/models/invoice_custom_field.py index 162ee01f..288d61be 100644 --- a/advancedbilling/models/invoice_custom_field.py +++ b/advancedbilling/models/invoice_custom_field.py @@ -1,67 +1,64 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceCustomField(object): - """Implementation of the 'Invoice Custom Field' model. Attributes: owner_id (int): The model property of type int. - owner_type (CustomFieldOwner): The model property of type - CustomFieldOwner. + owner_type (CustomFieldOwner): The model property of type CustomFieldOwner. name (str): The model property of type str. value (str): The model property of type str. metadatum_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "owner_id": 'owner_id', - "owner_type": 'owner_type', - "name": 'name', - "value": 'value', - "metadatum_id": 'metadatum_id' + "owner_id": "owner_id", + "owner_type": "owner_type", + "name": "name", + "value": "value", + "metadatum_id": "metadatum_id", } _optionals = [ - 'owner_id', - 'owner_type', - 'name', - 'value', - 'metadatum_id', + "owner_id", + "owner_type", + "name", + "value", + "metadatum_id", ] - def __init__(self, - owner_id=APIHelper.SKIP, - owner_type=APIHelper.SKIP, - name=APIHelper.SKIP, - value=APIHelper.SKIP, - metadatum_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceCustomField class""" - + def __init__( + self, + owner_id=APIHelper.SKIP, + owner_type=APIHelper.SKIP, + name=APIHelper.SKIP, + value=APIHelper.SKIP, + metadatum_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceCustomField instance.""" # Initialize members of the class if owner_id is not APIHelper.SKIP: - self.owner_id = owner_id + self.owner_id = owner_id if owner_type is not APIHelper.SKIP: - self.owner_type = owner_type + self.owner_type = owner_type if name is not APIHelper.SKIP: - self.name = name + self.name = name if value is not APIHelper.SKIP: - self.value = value + self.value = value if metadatum_id is not APIHelper.SKIP: - self.metadatum_id = metadatum_id + self.metadatum_id = metadatum_id # Add additional model properties to the instance if additional_properties is None: @@ -71,7 +68,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -82,18 +79,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - owner_id = dictionary.get("owner_id") if dictionary.get("owner_id") else APIHelper.SKIP - owner_type = dictionary.get("owner_type") if dictionary.get("owner_type") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - value = dictionary.get("value") if dictionary.get("value") else APIHelper.SKIP - metadatum_id = dictionary.get("metadatum_id") if dictionary.get("metadatum_id") else APIHelper.SKIP + owner_id =\ + dictionary.get("owner_id")\ + if dictionary.get("owner_id")\ + else APIHelper.SKIP + owner_type =\ + dictionary.get("owner_type")\ + if dictionary.get("owner_type")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + value =\ + dictionary.get("value")\ + if dictionary.get("value")\ + else APIHelper.SKIP + metadatum_id =\ + dictionary.get("metadatum_id")\ + if dictionary.get("metadatum_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(owner_id, owner_type, @@ -104,7 +118,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -115,7 +129,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -125,19 +138,79 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'owner_id={(self.owner_id if hasattr(self, "owner_id") else None)!r}, ' - f'owner_type={(self.owner_type if hasattr(self, "owner_type") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'value={(self.value if hasattr(self, "value") else None)!r}, ' - f'metadatum_id={(self.metadatum_id if hasattr(self, "metadatum_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _owner_id=( + self.owner_id + if hasattr(self, "owner_id") + else None + ) + _owner_type=( + self.owner_type + if hasattr(self, "owner_type") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _metadatum_id=( + self.metadatum_id + if hasattr(self, "metadatum_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"owner_id={_owner_id!r}, " + f"owner_type={_owner_type!r}, " + f"name={_name!r}, " + f"value={_value!r}, " + f"metadatum_id={_metadatum_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'owner_id={(self.owner_id if hasattr(self, "owner_id") else None)!s}, ' - f'owner_type={(self.owner_type if hasattr(self, "owner_type") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'value={(self.value if hasattr(self, "value") else None)!s}, ' - f'metadatum_id={(self.metadatum_id if hasattr(self, "metadatum_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _owner_id=( + self.owner_id + if hasattr(self, "owner_id") + else None + ) + _owner_type=( + self.owner_type + if hasattr(self, "owner_type") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _metadatum_id=( + self.metadatum_id + if hasattr(self, "metadatum_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"owner_id={_owner_id!s}, " + f"owner_type={_owner_type!s}, " + f"name={_name!s}, " + f"value={_value!s}, " + f"metadatum_id={_metadatum_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_customer.py b/advancedbilling/models/invoice_customer.py index dfd8548f..8e42ffc5 100644 --- a/advancedbilling/models/invoice_customer.py +++ b/advancedbilling/models/invoice_customer.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceCustomer(object): - """Implementation of the 'Invoice Customer' model. Information about the customer who is owner or recipient the invoiced @@ -24,65 +22,65 @@ class InvoiceCustomer(object): email (str): The model property of type str. vat_number (str): The model property of type str. reference (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify_id": 'chargify_id', - "first_name": 'first_name', - "last_name": 'last_name', - "organization": 'organization', - "email": 'email', - "vat_number": 'vat_number', - "reference": 'reference' + "chargify_id": "chargify_id", + "first_name": "first_name", + "last_name": "last_name", + "organization": "organization", + "email": "email", + "vat_number": "vat_number", + "reference": "reference", } _optionals = [ - 'chargify_id', - 'first_name', - 'last_name', - 'organization', - 'email', - 'vat_number', - 'reference', + "chargify_id", + "first_name", + "last_name", + "organization", + "email", + "vat_number", + "reference", ] _nullables = [ - 'chargify_id', - 'organization', - 'vat_number', - 'reference', + "chargify_id", + "organization", + "vat_number", + "reference", ] - def __init__(self, - chargify_id=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - organization=APIHelper.SKIP, - email=APIHelper.SKIP, - vat_number=APIHelper.SKIP, - reference=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceCustomer class""" - + def __init__( + self, + chargify_id=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + organization=APIHelper.SKIP, + email=APIHelper.SKIP, + vat_number=APIHelper.SKIP, + reference=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceCustomer instance.""" # Initialize members of the class if chargify_id is not APIHelper.SKIP: - self.chargify_id = chargify_id + self.chargify_id = chargify_id if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if email is not APIHelper.SKIP: - self.email = email + self.email = email if vat_number is not APIHelper.SKIP: - self.vat_number = vat_number + self.vat_number = vat_number if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference # Add additional model properties to the instance if additional_properties is None: @@ -92,7 +90,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -103,20 +101,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargify_id = dictionary.get("chargify_id") if "chargify_id" in dictionary.keys() else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - organization = dictionary.get("organization") if "organization" in dictionary.keys() else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP - vat_number = dictionary.get("vat_number") if "vat_number" in dictionary.keys() else APIHelper.SKIP - reference = dictionary.get("reference") if "reference" in dictionary.keys() else APIHelper.SKIP + chargify_id =\ + dictionary.get("chargify_id")\ + if "chargify_id" in dictionary.keys()\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if "organization" in dictionary.keys()\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + vat_number =\ + dictionary.get("vat_number")\ + if "vat_number" in dictionary.keys()\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if "reference" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify_id, first_name, @@ -129,7 +150,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -140,7 +161,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -150,23 +170,103 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify_id={(self.chargify_id if hasattr(self, "chargify_id") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify_id=( + self.chargify_id + if hasattr(self, "chargify_id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_id={_chargify_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"organization={_organization!r}, " + f"email={_email!r}, " + f"vat_number={_vat_number!r}, " + f"reference={_reference!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify_id={(self.chargify_id if hasattr(self, "chargify_id") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify_id=( + self.chargify_id + if hasattr(self, "chargify_id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_id={_chargify_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"organization={_organization!s}, " + f"email={_email!s}, " + f"vat_number={_vat_number!s}, " + f"reference={_reference!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_date_field.py b/advancedbilling/models/invoice_date_field.py index 24d22c74..c6d7d6f4 100644 --- a/advancedbilling/models/invoice_date_field.py +++ b/advancedbilling/models/invoice_date_field.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceDateField(object): - """Implementation of the 'Invoice Date Field' enum. Attributes: @@ -18,22 +15,24 @@ class InvoiceDateField(object): ISSUE_DATE: The enum member of type str. UPDATED_AT: The enum member of type str. PAID_DATE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CREATED_AT = 'created_at' - DUE_DATE = 'due_date' + CREATED_AT = "created_at" + + DUE_DATE = "due_date" - ISSUE_DATE = 'issue_date' + ISSUE_DATE = "issue_date" - UPDATED_AT = 'updated_at' + UPDATED_AT = "updated_at" - PAID_DATE = 'paid_date' + PAID_DATE = "paid_date" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_debit.py b/advancedbilling/models/invoice_debit.py index 86a89803..5d885848 100644 --- a/advancedbilling/models/invoice_debit.py +++ b/advancedbilling/models/invoice_debit.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceDebit(object): - """Implementation of the 'Invoice Debit' model. Attributes: @@ -22,63 +20,66 @@ class InvoiceDebit(object): memo (str): The model property of type str. original_amount (str): The model property of type str. applied_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "debit_note_number": 'debit_note_number', - "debit_note_uid": 'debit_note_uid', - "role": 'role', - "transaction_time": 'transaction_time', - "memo": 'memo', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount' + "uid": "uid", + "debit_note_number": "debit_note_number", + "debit_note_uid": "debit_note_uid", + "role": "role", + "transaction_time": "transaction_time", + "memo": "memo", + "original_amount": "original_amount", + "applied_amount": "applied_amount", } _optionals = [ - 'uid', - 'debit_note_number', - 'debit_note_uid', - 'role', - 'transaction_time', - 'memo', - 'original_amount', - 'applied_amount', + "uid", + "debit_note_number", + "debit_note_uid", + "role", + "transaction_time", + "memo", + "original_amount", + "applied_amount", ] - def __init__(self, - uid=APIHelper.SKIP, - debit_note_number=APIHelper.SKIP, - debit_note_uid=APIHelper.SKIP, - role=APIHelper.SKIP, - transaction_time=APIHelper.SKIP, - memo=APIHelper.SKIP, - original_amount=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceDebit class""" - + def __init__( + self, + uid=APIHelper.SKIP, + debit_note_number=APIHelper.SKIP, + debit_note_uid=APIHelper.SKIP, + role=APIHelper.SKIP, + transaction_time=APIHelper.SKIP, + memo=APIHelper.SKIP, + original_amount=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceDebit instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if debit_note_number is not APIHelper.SKIP: - self.debit_note_number = debit_note_number + self.debit_note_number = debit_note_number if debit_note_uid is not APIHelper.SKIP: - self.debit_note_uid = debit_note_uid + self.debit_note_uid = debit_note_uid if role is not APIHelper.SKIP: - self.role = role + self.role = role if transaction_time is not APIHelper.SKIP: - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount + self.original_amount = original_amount if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount # Add additional model properties to the instance if additional_properties is None: @@ -88,7 +89,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -99,21 +100,46 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - debit_note_number = dictionary.get("debit_note_number") if dictionary.get("debit_note_number") else APIHelper.SKIP - debit_note_uid = dictionary.get("debit_note_uid") if dictionary.get("debit_note_uid") else APIHelper.SKIP - role = dictionary.get("role") if dictionary.get("role") else APIHelper.SKIP - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + debit_note_number =\ + dictionary.get("debit_note_number")\ + if dictionary.get("debit_note_number")\ + else APIHelper.SKIP + debit_note_uid =\ + dictionary.get("debit_note_uid")\ + if dictionary.get("debit_note_uid")\ + else APIHelper.SKIP + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else APIHelper.SKIP + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, debit_note_number, @@ -127,7 +153,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -138,7 +164,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -148,25 +173,115 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'debit_note_number={(self.debit_note_number if hasattr(self, "debit_note_number") else None)!r}, ' - f'debit_note_uid={(self.debit_note_uid if hasattr(self, "debit_note_uid") else None)!r}, ' - f'role={(self.role if hasattr(self, "role") else None)!r}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _debit_note_number=( + self.debit_note_number + if hasattr(self, "debit_note_number") + else None + ) + _debit_note_uid=( + self.debit_note_uid + if hasattr(self, "debit_note_uid") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"debit_note_number={_debit_note_number!r}, " + f"debit_note_uid={_debit_note_uid!r}, " + f"role={_role!r}, " + f"transaction_time={_transaction_time!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'debit_note_number={(self.debit_note_number if hasattr(self, "debit_note_number") else None)!s}, ' - f'debit_note_uid={(self.debit_note_uid if hasattr(self, "debit_note_uid") else None)!s}, ' - f'role={(self.role if hasattr(self, "role") else None)!s}, ' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _debit_note_number=( + self.debit_note_number + if hasattr(self, "debit_note_number") + else None + ) + _debit_note_uid=( + self.debit_note_uid + if hasattr(self, "debit_note_uid") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"debit_note_number={_debit_note_number!s}, " + f"debit_note_uid={_debit_note_uid!s}, " + f"role={_role!s}, " + f"transaction_time={_transaction_time!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_discount.py b/advancedbilling/models/invoice_discount.py index d40b2d97..e3be4514 100644 --- a/advancedbilling/models/invoice_discount.py +++ b/advancedbilling/models/invoice_discount.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_discount_breakout import InvoiceDiscountBreakout +from advancedbilling.models.invoice_discount_breakout import ( + InvoiceDiscountBreakout, +) class InvoiceDiscount(object): - """Implementation of the 'Invoice Discount' model. Attributes: @@ -28,89 +28,89 @@ class InvoiceDiscount(object): eligible_amount (str): The model property of type str. discount_amount (str): The model property of type str. transaction_id (int): The model property of type int. - line_item_breakouts (List[InvoiceDiscountBreakout]): The model - property of type List[InvoiceDiscountBreakout]. - additional_properties (Dict[str, object]): The additional properties - for the model. + line_item_breakouts (List[InvoiceDiscountBreakout]): The model property of + type List[InvoiceDiscountBreakout]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "title": 'title', - "description": 'description', - "code": 'code', - "source_type": 'source_type', - "source_id": 'source_id', - "discount_type": 'discount_type', - "percentage": 'percentage', - "eligible_amount": 'eligible_amount', - "discount_amount": 'discount_amount', - "transaction_id": 'transaction_id', - "line_item_breakouts": 'line_item_breakouts' + "uid": "uid", + "title": "title", + "description": "description", + "code": "code", + "source_type": "source_type", + "source_id": "source_id", + "discount_type": "discount_type", + "percentage": "percentage", + "eligible_amount": "eligible_amount", + "discount_amount": "discount_amount", + "transaction_id": "transaction_id", + "line_item_breakouts": "line_item_breakouts", } _optionals = [ - 'uid', - 'title', - 'description', - 'code', - 'source_type', - 'source_id', - 'discount_type', - 'percentage', - 'eligible_amount', - 'discount_amount', - 'transaction_id', - 'line_item_breakouts', + "uid", + "title", + "description", + "code", + "source_type", + "source_id", + "discount_type", + "percentage", + "eligible_amount", + "discount_amount", + "transaction_id", + "line_item_breakouts", ] _nullables = [ - 'description', + "description", ] - def __init__(self, - uid=APIHelper.SKIP, - title=APIHelper.SKIP, - description=APIHelper.SKIP, - code=APIHelper.SKIP, - source_type=APIHelper.SKIP, - source_id=APIHelper.SKIP, - discount_type=APIHelper.SKIP, - percentage=APIHelper.SKIP, - eligible_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - transaction_id=APIHelper.SKIP, - line_item_breakouts=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceDiscount class""" - + def __init__( + self, + uid=APIHelper.SKIP, + title=APIHelper.SKIP, + description=APIHelper.SKIP, + code=APIHelper.SKIP, + source_type=APIHelper.SKIP, + source_id=APIHelper.SKIP, + discount_type=APIHelper.SKIP, + percentage=APIHelper.SKIP, + eligible_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + transaction_id=APIHelper.SKIP, + line_item_breakouts=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceDiscount instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if title is not APIHelper.SKIP: - self.title = title + self.title = title if description is not APIHelper.SKIP: - self.description = description + self.description = description if code is not APIHelper.SKIP: - self.code = code + self.code = code if source_type is not APIHelper.SKIP: - self.source_type = source_type + self.source_type = source_type if source_id is not APIHelper.SKIP: - self.source_id = source_id + self.source_id = source_id if discount_type is not APIHelper.SKIP: - self.discount_type = discount_type + self.discount_type = discount_type if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage if eligible_amount is not APIHelper.SKIP: - self.eligible_amount = eligible_amount + self.eligible_amount = eligible_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount if transaction_id is not APIHelper.SKIP: - self.transaction_id = transaction_id + self.transaction_id = transaction_id if line_item_breakouts is not APIHelper.SKIP: - self.line_item_breakouts = line_item_breakouts + self.line_item_breakouts = line_item_breakouts # Add additional model properties to the instance if additional_properties is None: @@ -120,7 +120,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -131,29 +131,67 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - source_type = dictionary.get("source_type") if dictionary.get("source_type") else APIHelper.SKIP - source_id = dictionary.get("source_id") if dictionary.get("source_id") else APIHelper.SKIP - discount_type = dictionary.get("discount_type") if dictionary.get("discount_type") else APIHelper.SKIP - percentage = dictionary.get("percentage") if dictionary.get("percentage") else APIHelper.SKIP - eligible_amount = dictionary.get("eligible_amount") if dictionary.get("eligible_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + source_type =\ + dictionary.get("source_type")\ + if dictionary.get("source_type")\ + else APIHelper.SKIP + source_id =\ + dictionary.get("source_id")\ + if dictionary.get("source_id")\ + else APIHelper.SKIP + discount_type =\ + dictionary.get("discount_type")\ + if dictionary.get("discount_type")\ + else APIHelper.SKIP + percentage =\ + dictionary.get("percentage")\ + if dictionary.get("percentage")\ + else APIHelper.SKIP + eligible_amount =\ + dictionary.get("eligible_amount")\ + if dictionary.get("eligible_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else APIHelper.SKIP line_item_breakouts = None - if dictionary.get('line_item_breakouts') is not None: - line_item_breakouts = [InvoiceDiscountBreakout.from_dictionary(x) for x in dictionary.get('line_item_breakouts')] + if dictionary.get("line_item_breakouts") is not None: + line_item_breakouts = [ + InvoiceDiscountBreakout.from_dictionary(x) + for x in dictionary.get("line_item_breakouts") + ] else: line_item_breakouts = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, title, @@ -171,7 +209,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -182,7 +220,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -192,33 +229,163 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!r}, ' - f'source_id={(self.source_id if hasattr(self, "source_id") else None)!r}, ' - f'discount_type={(self.discount_type if hasattr(self, "discount_type") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'eligible_amount={(self.eligible_amount if hasattr(self, "eligible_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _source_id=( + self.source_id + if hasattr(self, "source_id") + else None + ) + _discount_type=( + self.discount_type + if hasattr(self, "discount_type") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _eligible_amount=( + self.eligible_amount + if hasattr(self, "eligible_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"title={_title!r}, " + f"description={_description!r}, " + f"code={_code!r}, " + f"source_type={_source_type!r}, " + f"source_id={_source_id!r}, " + f"discount_type={_discount_type!r}, " + f"percentage={_percentage!r}, " + f"eligible_amount={_eligible_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"transaction_id={_transaction_id!r}, " + f"line_item_breakouts={_line_item_breakouts!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!s}, ' - f'source_id={(self.source_id if hasattr(self, "source_id") else None)!s}, ' - f'discount_type={(self.discount_type if hasattr(self, "discount_type") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'eligible_amount={(self.eligible_amount if hasattr(self, "eligible_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _source_id=( + self.source_id + if hasattr(self, "source_id") + else None + ) + _discount_type=( + self.discount_type + if hasattr(self, "discount_type") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _eligible_amount=( + self.eligible_amount + if hasattr(self, "eligible_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"title={_title!s}, " + f"description={_description!s}, " + f"code={_code!s}, " + f"source_type={_source_type!s}, " + f"source_id={_source_id!s}, " + f"discount_type={_discount_type!s}, " + f"percentage={_percentage!s}, " + f"eligible_amount={_eligible_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"transaction_id={_transaction_id!s}, " + f"line_item_breakouts={_line_item_breakouts!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_discount_breakout.py b/advancedbilling/models/invoice_discount_breakout.py index 9e60b648..f9af2702 100644 --- a/advancedbilling/models/invoice_discount_breakout.py +++ b/advancedbilling/models/invoice_discount_breakout.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceDiscountBreakout(object): - """Implementation of the 'Invoice Discount Breakout' model. Attributes: uid (str): The model property of type str. eligible_amount (str): The model property of type str. discount_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "eligible_amount": 'eligible_amount', - "discount_amount": 'discount_amount' + "uid": "uid", + "eligible_amount": "eligible_amount", + "discount_amount": "discount_amount", } _optionals = [ - 'uid', - 'eligible_amount', - 'discount_amount', + "uid", + "eligible_amount", + "discount_amount", ] - def __init__(self, - uid=APIHelper.SKIP, - eligible_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceDiscountBreakout class""" - + def __init__( + self, + uid=APIHelper.SKIP, + eligible_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceDiscountBreakout instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if eligible_amount is not APIHelper.SKIP: - self.eligible_amount = eligible_amount + self.eligible_amount = eligible_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - eligible_amount = dictionary.get("eligible_amount") if dictionary.get("eligible_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + eligible_amount =\ + dictionary.get("eligible_amount")\ + if dictionary.get("eligible_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, eligible_amount, @@ -87,7 +96,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -98,7 +107,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -108,15 +116,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'eligible_amount={(self.eligible_amount if hasattr(self, "eligible_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _eligible_amount=( + self.eligible_amount + if hasattr(self, "eligible_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"eligible_amount={_eligible_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'eligible_amount={(self.eligible_amount if hasattr(self, "eligible_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _eligible_amount=( + self.eligible_amount + if hasattr(self, "eligible_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"eligible_amount={_eligible_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_discount_source_type.py b/advancedbilling/models/invoice_discount_source_type.py index 07b3d7dd..ee5907fa 100644 --- a/advancedbilling/models/invoice_discount_source_type.py +++ b/advancedbilling/models/invoice_discount_source_type.py @@ -1,35 +1,33 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceDiscountSourceType(object): - """Implementation of the 'Invoice Discount Source Type' enum. Attributes: COUPON: The enum member of type str. REFERRAL: The enum member of type str. ENUM_AD HOC COUPON: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['Coupon', 'Referral', 'Ad Hoc Coupon'] - COUPON = 'Coupon' - REFERRAL = 'Referral' + _all_values = ["Coupon", "Referral", "Ad Hoc Coupon"] + COUPON = "Coupon" - ENUM_AD_HOC_COUPON = 'Ad Hoc Coupon' + REFERRAL = "Referral" + + ENUM_AD_HOC_COUPON = "Ad Hoc Coupon" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -39,9 +37,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_discount_type.py b/advancedbilling/models/invoice_discount_type.py index 8e64b21d..ce19f9be 100644 --- a/advancedbilling/models/invoice_discount_type.py +++ b/advancedbilling/models/invoice_discount_type.py @@ -1,35 +1,33 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceDiscountType(object): - """Implementation of the 'Invoice Discount Type' enum. Attributes: PERCENTAGE: The enum member of type str. FLAT_AMOUNT: The enum member of type str. ROLLOVER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['percentage', 'flat_amount', 'rollover'] - PERCENTAGE = 'percentage' - FLAT_AMOUNT = 'flat_amount' + _all_values = ["percentage", "flat_amount", "rollover"] + PERCENTAGE = "percentage" - ROLLOVER = 'rollover' + FLAT_AMOUNT = "flat_amount" + + ROLLOVER = "rollover" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -39,9 +37,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_display_settings.py b/advancedbilling/models/invoice_display_settings.py index 176cfe2d..f8dc0c51 100644 --- a/advancedbilling/models/invoice_display_settings.py +++ b/advancedbilling/models/invoice_display_settings.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceDisplaySettings(object): - """Implementation of the 'Invoice Display Settings' model. Attributes: hide_zero_subtotal_lines (bool): The model property of type bool. include_discounts_on_lines (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "hide_zero_subtotal_lines": 'hide_zero_subtotal_lines', - "include_discounts_on_lines": 'include_discounts_on_lines' + "hide_zero_subtotal_lines": "hide_zero_subtotal_lines", + "include_discounts_on_lines": "include_discounts_on_lines", } _optionals = [ - 'hide_zero_subtotal_lines', - 'include_discounts_on_lines', + "hide_zero_subtotal_lines", + "include_discounts_on_lines", ] - def __init__(self, - hide_zero_subtotal_lines=APIHelper.SKIP, - include_discounts_on_lines=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceDisplaySettings class""" - + def __init__( + self, + hide_zero_subtotal_lines=APIHelper.SKIP, + include_discounts_on_lines=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceDisplaySettings instance.""" # Initialize members of the class if hide_zero_subtotal_lines is not APIHelper.SKIP: - self.hide_zero_subtotal_lines = hide_zero_subtotal_lines + self.hide_zero_subtotal_lines = hide_zero_subtotal_lines if include_discounts_on_lines is not APIHelper.SKIP: - self.include_discounts_on_lines = include_discounts_on_lines + self.include_discounts_on_lines = include_discounts_on_lines # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,15 +61,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - hide_zero_subtotal_lines = dictionary.get("hide_zero_subtotal_lines") if "hide_zero_subtotal_lines" in dictionary.keys() else APIHelper.SKIP - include_discounts_on_lines = dictionary.get("include_discounts_on_lines") if "include_discounts_on_lines" in dictionary.keys() else APIHelper.SKIP + hide_zero_subtotal_lines =\ + dictionary.get("hide_zero_subtotal_lines")\ + if "hide_zero_subtotal_lines" in dictionary.keys()\ + else APIHelper.SKIP + include_discounts_on_lines =\ + dictionary.get("include_discounts_on_lines")\ + if "include_discounts_on_lines" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(hide_zero_subtotal_lines, include_discounts_on_lines, @@ -79,7 +85,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -90,7 +96,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -100,13 +105,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'hide_zero_subtotal_lines={(self.hide_zero_subtotal_lines if hasattr(self, "hide_zero_subtotal_lines") else None)!r}, ' - f'include_discounts_on_lines={(self.include_discounts_on_lines if hasattr(self, "include_discounts_on_lines") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _hide_zero_subtotal_lines=( + self.hide_zero_subtotal_lines + if hasattr(self, "hide_zero_subtotal_lines") + else None + ) + _include_discounts_on_lines=( + self.include_discounts_on_lines + if hasattr(self, "include_discounts_on_lines") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"hide_zero_subtotal_lines={_hide_zero_subtotal_lines!r}, " + f"include_discounts_on_lines={_include_discounts_on_lines!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'hide_zero_subtotal_lines={(self.hide_zero_subtotal_lines if hasattr(self, "hide_zero_subtotal_lines") else None)!s}, ' - f'include_discounts_on_lines={(self.include_discounts_on_lines if hasattr(self, "include_discounts_on_lines") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _hide_zero_subtotal_lines=( + self.hide_zero_subtotal_lines + if hasattr(self, "hide_zero_subtotal_lines") + else None + ) + _include_discounts_on_lines=( + self.include_discounts_on_lines + if hasattr(self, "include_discounts_on_lines") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"hide_zero_subtotal_lines={_hide_zero_subtotal_lines!s}, " + f"include_discounts_on_lines={_include_discounts_on_lines!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_event_payment_method.py b/advancedbilling/models/invoice_event_payment_method.py index 57c17875..db3f5f44 100644 --- a/advancedbilling/models/invoice_event_payment_method.py +++ b/advancedbilling/models/invoice_event_payment_method.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceEventPaymentMethod(object): - """Implementation of the 'Invoice Event Payment Method' enum. Attributes: @@ -18,24 +15,26 @@ class InvoiceEventPaymentMethod(object): CREDIT_CARD: The enum member of type str. EXTERNAL: The enum member of type str. PAYPAL_ACCOUNT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['apple_pay', 'bank_account', 'credit_card', 'external', 'paypal_account'] - APPLE_PAY = 'apple_pay' - BANK_ACCOUNT = 'bank_account' + _all_values = ["apple_pay", "bank_account", "credit_card", "external", + "paypal_account"] + APPLE_PAY = "apple_pay" - CREDIT_CARD = 'credit_card' + BANK_ACCOUNT = "bank_account" - EXTERNAL = 'external' + CREDIT_CARD = "credit_card" - PAYPAL_ACCOUNT = 'paypal_account' + EXTERNAL = "external" + + PAYPAL_ACCOUNT = "paypal_account" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -45,9 +44,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_event_type.py b/advancedbilling/models/invoice_event_type.py index aaca4b41..40a9b48b 100644 --- a/advancedbilling/models/invoice_event_type.py +++ b/advancedbilling/models/invoice_event_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceEventType(object): - """Implementation of the 'Invoice Event Type' enum. Invoice Event Type @@ -30,44 +27,49 @@ class InvoiceEventType(object): REMOVE_PAYMENT: The enum member of type str. FAILED_PAYMENT: The enum member of type str. CHANGE_CHARGEBACK_STATUS: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['issue_invoice', 'apply_credit_note', 'create_credit_note', 'apply_payment', 'apply_debit_note', 'create_debit_note', 'refund_invoice', 'void_invoice', 'void_remainder', 'backport_invoice', 'change_invoice_status', 'change_invoice_collection_method', 'remove_payment', 'failed_payment', 'change_chargeback_status'] - ISSUE_INVOICE = 'issue_invoice' - APPLY_CREDIT_NOTE = 'apply_credit_note' + _all_values = ["issue_invoice", "apply_credit_note", "create_credit_note", + "apply_payment", "apply_debit_note", "create_debit_note", "refund_invoice", + "void_invoice", "void_remainder", "backport_invoice", "change_invoice_status", + "change_invoice_collection_method", "remove_payment", "failed_payment", + "change_chargeback_status"] + ISSUE_INVOICE = "issue_invoice" - CREATE_CREDIT_NOTE = 'create_credit_note' + APPLY_CREDIT_NOTE = "apply_credit_note" - APPLY_PAYMENT = 'apply_payment' + CREATE_CREDIT_NOTE = "create_credit_note" - APPLY_DEBIT_NOTE = 'apply_debit_note' + APPLY_PAYMENT = "apply_payment" - CREATE_DEBIT_NOTE = 'create_debit_note' + APPLY_DEBIT_NOTE = "apply_debit_note" - REFUND_INVOICE = 'refund_invoice' + CREATE_DEBIT_NOTE = "create_debit_note" - VOID_INVOICE = 'void_invoice' + REFUND_INVOICE = "refund_invoice" - VOID_REMAINDER = 'void_remainder' + VOID_INVOICE = "void_invoice" - BACKPORT_INVOICE = 'backport_invoice' + VOID_REMAINDER = "void_remainder" - CHANGE_INVOICE_STATUS = 'change_invoice_status' + BACKPORT_INVOICE = "backport_invoice" - CHANGE_INVOICE_COLLECTION_METHOD = 'change_invoice_collection_method' + CHANGE_INVOICE_STATUS = "change_invoice_status" - REMOVE_PAYMENT = 'remove_payment' + CHANGE_INVOICE_COLLECTION_METHOD = "change_invoice_collection_method" - FAILED_PAYMENT = 'failed_payment' + REMOVE_PAYMENT = "remove_payment" - CHANGE_CHARGEBACK_STATUS = 'change_chargeback_status' + FAILED_PAYMENT = "failed_payment" + + CHANGE_CHARGEBACK_STATUS = "change_chargeback_status" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -77,9 +79,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_issued.py b/advancedbilling/models/invoice_issued.py index 67718b99..411765a4 100644 --- a/advancedbilling/models/invoice_issued.py +++ b/advancedbilling/models/invoice_issued.py @@ -1,20 +1,21 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 +from datetime import date + import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_line_item_event_data import InvoiceLineItemEventData -from datetime import date +from advancedbilling.models.invoice_line_item_event_data import ( + InvoiceLineItemEventData, +) class InvoiceIssued(object): - """Implementation of the 'Invoice Issued' model. Attributes: @@ -22,8 +23,8 @@ class InvoiceIssued(object): number (str): The model property of type str. role (str): The model property of type str. due_date (date): The model property of type date. - issue_date (str): Invoice issue date. Can be an empty string if value - is missing. + issue_date (str): Invoice issue date. Can be an empty string if value is + missing. paid_date (str): Paid date. Can be an empty string if value is missing. due_amount (str): The model property of type str. paid_amount (str): The model property of type str. @@ -33,71 +34,71 @@ class InvoiceIssued(object): status_amount (str): The model property of type str. product_name (str): The model property of type str. consolidation_level (str): The model property of type str. - line_items (List[InvoiceLineItemEventData]): The model property of - type List[InvoiceLineItemEventData]. - additional_properties (Dict[str, object]): The additional properties - for the model. + line_items (List[InvoiceLineItemEventData]): The model property of type + List[InvoiceLineItemEventData]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "number": 'number', - "role": 'role', - "due_date": 'due_date', - "issue_date": 'issue_date', - "paid_date": 'paid_date', - "due_amount": 'due_amount', - "paid_amount": 'paid_amount', - "tax_amount": 'tax_amount', - "refund_amount": 'refund_amount', - "total_amount": 'total_amount', - "status_amount": 'status_amount', - "product_name": 'product_name', - "consolidation_level": 'consolidation_level', - "line_items": 'line_items' + "uid": "uid", + "number": "number", + "role": "role", + "due_date": "due_date", + "issue_date": "issue_date", + "paid_date": "paid_date", + "due_amount": "due_amount", + "paid_amount": "paid_amount", + "tax_amount": "tax_amount", + "refund_amount": "refund_amount", + "total_amount": "total_amount", + "status_amount": "status_amount", + "product_name": "product_name", + "consolidation_level": "consolidation_level", + "line_items": "line_items", } _nullables = [ - 'due_date', + "due_date", ] - def __init__(self, - uid=None, - number=None, - role=None, - due_date=None, - issue_date=None, - paid_date=None, - due_amount=None, - paid_amount=None, - tax_amount=None, - refund_amount=None, - total_amount=None, - status_amount=None, - product_name=None, - consolidation_level=None, - line_items=None, - additional_properties=None): - """Constructor for the InvoiceIssued class""" - + def __init__( + self, + uid=None, + number=None, + role=None, + due_date=None, + issue_date=None, + paid_date=None, + due_amount=None, + paid_amount=None, + tax_amount=None, + refund_amount=None, + total_amount=None, + status_amount=None, + product_name=None, + consolidation_level=None, + line_items=None, + additional_properties=None): + """Initialize a InvoiceIssued instance.""" # Initialize members of the class - self.uid = uid - self.number = number - self.role = role - self.due_date = due_date - self.issue_date = issue_date - self.paid_date = paid_date - self.due_amount = due_amount - self.paid_amount = paid_amount - self.tax_amount = tax_amount - self.refund_amount = refund_amount - self.total_amount = total_amount - self.status_amount = status_amount - self.product_name = product_name - self.consolidation_level = consolidation_level - self.line_items = line_items + self.uid = uid + self.number = number + self.role = role + self.due_date = due_date + self.issue_date = issue_date + self.paid_date = paid_date + self.due_amount = due_amount + self.paid_amount = paid_amount + self.tax_amount = tax_amount + self.refund_amount = refund_amount + self.total_amount = total_amount + self.status_amount = status_amount + self.product_name = product_name + self.consolidation_level = consolidation_level + self.line_items = line_items # Add additional model properties to the instance if additional_properties is None: @@ -107,7 +108,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -118,30 +119,76 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else None - number = dictionary.get("number") if dictionary.get("number") else None - role = dictionary.get("role") if dictionary.get("role") else None - due_date = dateutil.parser.parse(dictionary.get('due_date')).date() if dictionary.get('due_date') else None - issue_date = dictionary.get("issue_date") if dictionary.get("issue_date") else None - paid_date = dictionary.get("paid_date") if dictionary.get("paid_date") else None - due_amount = dictionary.get("due_amount") if dictionary.get("due_amount") else None - paid_amount = dictionary.get("paid_amount") if dictionary.get("paid_amount") else None - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else None - refund_amount = dictionary.get("refund_amount") if dictionary.get("refund_amount") else None - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else None - status_amount = dictionary.get("status_amount") if dictionary.get("status_amount") else None - product_name = dictionary.get("product_name") if dictionary.get("product_name") else None - consolidation_level = dictionary.get("consolidation_level") if dictionary.get("consolidation_level") else None + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else None + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else None + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else None + due_date = dateutil.parser.parse( + dictionary.get("due_date")).date()\ + if dictionary.get("due_date") else None + issue_date =\ + dictionary.get("issue_date")\ + if dictionary.get("issue_date")\ + else None + paid_date =\ + dictionary.get("paid_date")\ + if dictionary.get("paid_date")\ + else None + due_amount =\ + dictionary.get("due_amount")\ + if dictionary.get("due_amount")\ + else None + paid_amount =\ + dictionary.get("paid_amount")\ + if dictionary.get("paid_amount")\ + else None + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else None + refund_amount =\ + dictionary.get("refund_amount")\ + if dictionary.get("refund_amount")\ + else None + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else None + status_amount =\ + dictionary.get("status_amount")\ + if dictionary.get("status_amount")\ + else None + product_name =\ + dictionary.get("product_name")\ + if dictionary.get("product_name")\ + else None + consolidation_level =\ + dictionary.get("consolidation_level")\ + if dictionary.get("consolidation_level")\ + else None line_items = None - if dictionary.get('line_items') is not None: - line_items = [InvoiceLineItemEventData.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + InvoiceLineItemEventData.from_dictionary(x) + for x in dictionary.get("line_items") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, number, @@ -162,7 +209,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -173,113 +220,296 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.uid, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.role, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.due_date, - type_callable=lambda value: isinstance(value, date), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.issue_date, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.paid_date, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.due_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.paid_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.tax_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.refund_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.total_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.status_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.product_name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.consolidation_level, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.line_items, - type_callable=lambda value: InvoiceLineItemEventData.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.uid, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.role, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.due_date, + type_callable=lambda value: + isinstance( + value, + date, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.issue_date, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.paid_date, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.due_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.paid_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.tax_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.refund_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.total_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.status_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.product_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.consolidation_level, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.line_items, + type_callable=lambda value: + InvoiceLineItemEventData.validate(value), + is_model_dict=True, + is_inner_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('uid'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('role'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('due_date'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('issue_date'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('paid_date'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('due_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('paid_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('tax_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('refund_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('total_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('status_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('product_name'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('consolidation_level'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('line_items'), - type_callable=lambda value: InvoiceLineItemEventData.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("uid"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("role"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("due_date"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("issue_date"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("paid_date"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("due_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("paid_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("tax_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("refund_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("total_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("status_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("product_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("consolidation_level"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("line_items"), + type_callable=lambda value: + InvoiceLineItemEventData.validate(value), + is_model_dict=True, + is_inner_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={self.uid!r}, ' - f'number={self.number!r}, ' - f'role={self.role!r}, ' - f'due_date={self.due_date!r}, ' - f'issue_date={self.issue_date!r}, ' - f'paid_date={self.paid_date!r}, ' - f'due_amount={self.due_amount!r}, ' - f'paid_amount={self.paid_amount!r}, ' - f'tax_amount={self.tax_amount!r}, ' - f'refund_amount={self.refund_amount!r}, ' - f'total_amount={self.total_amount!r}, ' - f'status_amount={self.status_amount!r}, ' - f'product_name={self.product_name!r}, ' - f'consolidation_level={self.consolidation_level!r}, ' - f'line_items={self.line_items!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=self.uid + _number=self.number + _role=self.role + _due_date=self.due_date + _issue_date=self.issue_date + _paid_date=self.paid_date + _due_amount=self.due_amount + _paid_amount=self.paid_amount + _tax_amount=self.tax_amount + _refund_amount=self.refund_amount + _total_amount=self.total_amount + _status_amount=self.status_amount + _product_name=self.product_name + _consolidation_level=self.consolidation_level + _line_items=self.line_items + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"number={_number!r}, " + f"role={_role!r}, " + f"due_date={_due_date!r}, " + f"issue_date={_issue_date!r}, " + f"paid_date={_paid_date!r}, " + f"due_amount={_due_amount!r}, " + f"paid_amount={_paid_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"refund_amount={_refund_amount!r}, " + f"total_amount={_total_amount!r}, " + f"status_amount={_status_amount!r}, " + f"product_name={_product_name!r}, " + f"consolidation_level={_consolidation_level!r}, " + f"line_items={_line_items!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={self.uid!s}, ' - f'number={self.number!s}, ' - f'role={self.role!s}, ' - f'due_date={self.due_date!s}, ' - f'issue_date={self.issue_date!s}, ' - f'paid_date={self.paid_date!s}, ' - f'due_amount={self.due_amount!s}, ' - f'paid_amount={self.paid_amount!s}, ' - f'tax_amount={self.tax_amount!s}, ' - f'refund_amount={self.refund_amount!s}, ' - f'total_amount={self.total_amount!s}, ' - f'status_amount={self.status_amount!s}, ' - f'product_name={self.product_name!s}, ' - f'consolidation_level={self.consolidation_level!s}, ' - f'line_items={self.line_items!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=self.uid + _number=self.number + _role=self.role + _due_date=self.due_date + _issue_date=self.issue_date + _paid_date=self.paid_date + _due_amount=self.due_amount + _paid_amount=self.paid_amount + _tax_amount=self.tax_amount + _refund_amount=self.refund_amount + _total_amount=self.total_amount + _status_amount=self.status_amount + _product_name=self.product_name + _consolidation_level=self.consolidation_level + _line_items=self.line_items + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"number={_number!s}, " + f"role={_role!s}, " + f"due_date={_due_date!s}, " + f"issue_date={_issue_date!s}, " + f"paid_date={_paid_date!s}, " + f"due_amount={_due_amount!s}, " + f"paid_amount={_paid_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"refund_amount={_refund_amount!s}, " + f"total_amount={_total_amount!s}, " + f"status_amount={_status_amount!s}, " + f"product_name={_product_name!s}, " + f"consolidation_level={_consolidation_level!s}, " + f"line_items={_line_items!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_line_item.py b/advancedbilling/models/invoice_line_item.py index d886dc02..1aec4104 100644 --- a/advancedbilling/models/invoice_line_item.py +++ b/advancedbilling/models/invoice_line_item.py @@ -1,241 +1,236 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_line_item_component_cost_data import InvoiceLineItemComponentCostData +from advancedbilling.models.invoice_line_item_component_cost_data import ( + InvoiceLineItemComponentCostData, +) class InvoiceLineItem(object): - """Implementation of the 'Invoice Line Item' model. Attributes: uid (str): Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. - title (str): A short descriptor for the charge or item represented by - this line. - description (str): Detailed description for the charge or item - represented by this line. May include proration details in plain - text. Note: this string may contain line breaks that are hints - for the best display format on the invoice. - quantity (str): The quantity or count of units billed by the line - item. This is a decimal number represented as a string. (See - "About Decimal Numbers".) - unit_price (str): The price per unit for the line item. When tiered - pricing was used (i.e. not every unit was actually priced at the - same price) this will be the blended average cost per unit and the - `tiered_unit_price` field will be set to `true`. - subtotal_amount (str): The line subtotal, generally calculated as - `quantity * unit_price`. This is the canonical amount of record - for the line - when rounding differences are in play, - `subtotal_amount` takes precedence over the value derived from - `quantity * unit_price` (which may not have the proper precision - to exactly equal this amount). - discount_amount (str): The approximate discount applied to just this - line. The value is approximated in cases where rounding errors - make it difficult to apportion exactly a total discount among many - lines. Several lines may have been summed prior to applying the - discount to arrive at `discount_amount` for the invoice - backing - that out to the discount on a single line may introduce rounding - or precision errors. - tax_amount (str): The approximate tax applied to just this line. The - value is approximated in cases where rounding errors make it - difficult to apportion exactly a total tax among many lines. - Several lines may have been summed prior to applying the tax rate - to arrive at `tax_amount` for the invoice - backing that out to - the tax on a single line may introduce rounding or precision - errors. - total_amount (str): The non-canonical total amount for the line. + title (str): A short descriptor for the charge or item represented by this + line. + description (str): Detailed description for the charge or item represented by + this line. May include proration details in plain text. Note: this + string may contain line breaks that are hints for the best display format + on the invoice. + quantity (str): The quantity or count of units billed by the line item. This + is a decimal number represented as a string. (See "About Decimal + Numbers".) + unit_price (str): The price per unit for the line item. When tiered pricing + was used (i.e. not every unit was actually priced at the same price) this + will be the blended average cost per unit and the `tiered_unit_price` + field will be set to `true`. + subtotal_amount (str): The line subtotal, generally calculated as `quantity * + unit_price`. This is the canonical amount of record for the line - when + rounding differences are in play, `subtotal_amount` takes precedence over + the value derived from `quantity * unit_price` (which may not have the + proper precision to exactly equal this amount). + discount_amount (str): The approximate discount applied to just this line. + The value is approximated in cases where rounding errors make it + difficult to apportion exactly a total discount among many lines. Several + lines may have been summed prior to applying the discount to arrive at + `discount_amount` for the invoice - backing that out to the discount on a + single line may introduce rounding or precision errors. + tax_amount (str): The approximate tax applied to just this line. The value + is approximated in cases where rounding errors make it difficult to + apportion exactly a total tax among many lines. Several lines may have + been summed prior to applying the tax rate to arrive at `tax_amount` for + the invoice - backing that out to the tax on a single line may introduce + rounding or precision errors. + total_amount (str): The non-canonical total amount for the line. `subtotal_amount` is the canonical amount for a line. The invoice - `total_amount` is derived from the sum of the line - `subtotal_amount`s and discounts or taxes applied thereafter. - Therefore, due to rounding or precision errors, the sum of line - `total_amount`s may not equal the invoice `total_amount`. - tiered_unit_price (bool): When `true`, indicates that the actual - pricing scheme for the line was tiered, so the `unit_price` shown - is the blended average for all units. - period_range_start (date): Start date for the period covered by this - line. The format is `"YYYY-MM-DD"`. * For periodic charges paid - in advance, this date will match the billing date, and the end - date will be in the future. * For periodic charges paid in arrears - (e.g. metered charges), this date will be the date of the previous - billing, and the end date will be the current billing date. * For - non-periodic charges, this date and the end date will match. - period_range_end (date): End date for the period covered by this line. - The format is `"YYYY-MM-DD"`. * For periodic charges paid in - advance, this date will match the next (future) billing date. * - For periodic charges paid in arrears (e.g. metered charges), this - date will be the date of the current billing date. * For - non-periodic charges, this date and the start date will match. + `total_amount` is derived from the sum of the line `subtotal_amount`s and + discounts or taxes applied thereafter. Therefore, due to rounding or + precision errors, the sum of line `total_amount`s may not equal the + invoice `total_amount`. + tiered_unit_price (bool): When `true`, indicates that the actual pricing + scheme for the line was tiered, so the `unit_price` shown is the blended + average for all units. + period_range_start (date): Start date for the period covered by this line. + The format is `"YYYY-MM-DD"`. * For periodic charges paid in advance, + this date will match the billing date, and the end date will be in the + future. * For periodic charges paid in arrears (e.g. metered charges), + this date will be the date of the previous billing, and the end date will + be the current billing date. * For non-periodic charges, this date and + the end date will match. + period_range_end (date): End date for the period covered by this line. The + format is `"YYYY-MM-DD"`. * For periodic charges paid in advance, this + date will match the next (future) billing date. * For periodic charges + paid in arrears (e.g. metered charges), this date will be the date of the + current billing date. * For non-periodic charges, this date and the start + date will match. transaction_id (int): The model property of type int. - product_id (int): The ID of the product subscribed when the charge was - made. This may be set even for component charges, so true - product-only (non-component) charges will also have a nil - `component_id`. - product_version (int): The version of the product subscribed when the - charge was made. - component_id (int): The ID of the component being billed. Will be - `nil` for non-component charges. - price_point_id (int): The price point ID of the component being - billed. Will be `nil` for non-component charges. + product_id (int): The ID of the product subscribed when the charge was made. + This may be set even for component charges, so true product-only + (non-component) charges will also have a nil `component_id`. + product_version (int): The version of the product subscribed when the charge + was made. + component_id (int): The ID of the component being billed. Will be `nil` for + non-component charges. + price_point_id (int): The price point ID of the component being billed. Will + be `nil` for non-component charges. billing_schedule_item_id (int): The model property of type int. hide (bool): The model property of type bool. - component_cost_data (InvoiceLineItemComponentCostData): The model - property of type InvoiceLineItemComponentCostData. - product_price_point_id (int): The price point ID of the line item's - product + component_cost_data (InvoiceLineItemComponentCostData): The model property of + type InvoiceLineItemComponentCostData. + product_price_point_id (int): The price point ID of the line item's product custom_item (bool): The model property of type bool. kind (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "title": 'title', - "description": 'description', - "quantity": 'quantity', - "unit_price": 'unit_price', - "subtotal_amount": 'subtotal_amount', - "discount_amount": 'discount_amount', - "tax_amount": 'tax_amount', - "total_amount": 'total_amount', - "tiered_unit_price": 'tiered_unit_price', - "period_range_start": 'period_range_start', - "period_range_end": 'period_range_end', - "transaction_id": 'transaction_id', - "product_id": 'product_id', - "product_version": 'product_version', - "component_id": 'component_id', - "price_point_id": 'price_point_id', - "billing_schedule_item_id": 'billing_schedule_item_id', - "hide": 'hide', - "component_cost_data": 'component_cost_data', - "product_price_point_id": 'product_price_point_id', - "custom_item": 'custom_item', - "kind": 'kind' + "uid": "uid", + "title": "title", + "description": "description", + "quantity": "quantity", + "unit_price": "unit_price", + "subtotal_amount": "subtotal_amount", + "discount_amount": "discount_amount", + "tax_amount": "tax_amount", + "total_amount": "total_amount", + "tiered_unit_price": "tiered_unit_price", + "period_range_start": "period_range_start", + "period_range_end": "period_range_end", + "transaction_id": "transaction_id", + "product_id": "product_id", + "product_version": "product_version", + "component_id": "component_id", + "price_point_id": "price_point_id", + "billing_schedule_item_id": "billing_schedule_item_id", + "hide": "hide", + "component_cost_data": "component_cost_data", + "product_price_point_id": "product_price_point_id", + "custom_item": "custom_item", + "kind": "kind", } _optionals = [ - 'uid', - 'title', - 'description', - 'quantity', - 'unit_price', - 'subtotal_amount', - 'discount_amount', - 'tax_amount', - 'total_amount', - 'tiered_unit_price', - 'period_range_start', - 'period_range_end', - 'transaction_id', - 'product_id', - 'product_version', - 'component_id', - 'price_point_id', - 'billing_schedule_item_id', - 'hide', - 'component_cost_data', - 'product_price_point_id', - 'custom_item', - 'kind', + "uid", + "title", + "description", + "quantity", + "unit_price", + "subtotal_amount", + "discount_amount", + "tax_amount", + "total_amount", + "tiered_unit_price", + "period_range_start", + "period_range_end", + "transaction_id", + "product_id", + "product_version", + "component_id", + "price_point_id", + "billing_schedule_item_id", + "hide", + "component_cost_data", + "product_price_point_id", + "custom_item", + "kind", ] _nullables = [ - 'product_id', - 'product_version', - 'component_id', - 'price_point_id', - 'billing_schedule_item_id', - 'component_cost_data', - 'product_price_point_id', + "product_id", + "product_version", + "component_id", + "price_point_id", + "billing_schedule_item_id", + "component_cost_data", + "product_price_point_id", ] - def __init__(self, - uid=APIHelper.SKIP, - title=APIHelper.SKIP, - description=APIHelper.SKIP, - quantity=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - subtotal_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - total_amount=APIHelper.SKIP, - tiered_unit_price=APIHelper.SKIP, - period_range_start=APIHelper.SKIP, - period_range_end=APIHelper.SKIP, - transaction_id=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_version=APIHelper.SKIP, - component_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - billing_schedule_item_id=APIHelper.SKIP, - hide=APIHelper.SKIP, - component_cost_data=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - custom_item=APIHelper.SKIP, - kind=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceLineItem class""" - + def __init__( + self, + uid=APIHelper.SKIP, + title=APIHelper.SKIP, + description=APIHelper.SKIP, + quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + subtotal_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + total_amount=APIHelper.SKIP, + tiered_unit_price=APIHelper.SKIP, + period_range_start=APIHelper.SKIP, + period_range_end=APIHelper.SKIP, + transaction_id=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_version=APIHelper.SKIP, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + billing_schedule_item_id=APIHelper.SKIP, + hide=APIHelper.SKIP, + component_cost_data=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + custom_item=APIHelper.SKIP, + kind=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceLineItem instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if title is not APIHelper.SKIP: - self.title = title + self.title = title if description is not APIHelper.SKIP: - self.description = description + self.description = description if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if subtotal_amount is not APIHelper.SKIP: - self.subtotal_amount = subtotal_amount + self.subtotal_amount = subtotal_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if total_amount is not APIHelper.SKIP: - self.total_amount = total_amount + self.total_amount = total_amount if tiered_unit_price is not APIHelper.SKIP: - self.tiered_unit_price = tiered_unit_price + self.tiered_unit_price = tiered_unit_price if period_range_start is not APIHelper.SKIP: - self.period_range_start = period_range_start + self.period_range_start = period_range_start if period_range_end is not APIHelper.SKIP: - self.period_range_end = period_range_end + self.period_range_end = period_range_end if transaction_id is not APIHelper.SKIP: - self.transaction_id = transaction_id + self.transaction_id = transaction_id if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_version is not APIHelper.SKIP: - self.product_version = product_version + self.product_version = product_version if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if billing_schedule_item_id is not APIHelper.SKIP: - self.billing_schedule_item_id = billing_schedule_item_id + self.billing_schedule_item_id = billing_schedule_item_id if hide is not APIHelper.SKIP: - self.hide = hide + self.hide = hide if component_cost_data is not APIHelper.SKIP: - self.component_cost_data = component_cost_data + self.component_cost_data = component_cost_data if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if custom_item is not APIHelper.SKIP: - self.custom_item = custom_item + self.custom_item = custom_item if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind # Add additional model properties to the instance if additional_properties is None: @@ -245,7 +240,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -256,39 +251,108 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - unit_price = dictionary.get("unit_price") if dictionary.get("unit_price") else APIHelper.SKIP - subtotal_amount = dictionary.get("subtotal_amount") if dictionary.get("subtotal_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else APIHelper.SKIP - tiered_unit_price = dictionary.get("tiered_unit_price") if "tiered_unit_price" in dictionary.keys() else APIHelper.SKIP - period_range_start = dateutil.parser.parse(dictionary.get('period_range_start')).date() if dictionary.get('period_range_start') else APIHelper.SKIP - period_range_end = dateutil.parser.parse(dictionary.get('period_range_end')).date() if dictionary.get('period_range_end') else APIHelper.SKIP - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP - product_id = dictionary.get("product_id") if "product_id" in dictionary.keys() else APIHelper.SKIP - product_version = dictionary.get("product_version") if "product_version" in dictionary.keys() else APIHelper.SKIP - component_id = dictionary.get("component_id") if "component_id" in dictionary.keys() else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if "price_point_id" in dictionary.keys() else APIHelper.SKIP - billing_schedule_item_id = dictionary.get("billing_schedule_item_id") if "billing_schedule_item_id" in dictionary.keys() else APIHelper.SKIP - hide = dictionary.get("hide") if "hide" in dictionary.keys() else APIHelper.SKIP - if 'component_cost_data' in dictionary.keys(): - component_cost_data = InvoiceLineItemComponentCostData.from_dictionary(dictionary.get('component_cost_data')) if dictionary.get('component_cost_data') else None + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + unit_price =\ + dictionary.get("unit_price")\ + if dictionary.get("unit_price")\ + else APIHelper.SKIP + subtotal_amount =\ + dictionary.get("subtotal_amount")\ + if dictionary.get("subtotal_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else APIHelper.SKIP + tiered_unit_price =\ + dictionary.get("tiered_unit_price")\ + if "tiered_unit_price" in dictionary.keys()\ + else APIHelper.SKIP + period_range_start = dateutil.parser.parse( + dictionary.get("period_range_start")).date()\ + if dictionary.get("period_range_start") else APIHelper.SKIP + period_range_end = dateutil.parser.parse( + dictionary.get("period_range_end")).date()\ + if dictionary.get("period_range_end") else APIHelper.SKIP + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if "product_id" in dictionary.keys()\ + else APIHelper.SKIP + product_version =\ + dictionary.get("product_version")\ + if "product_version" in dictionary.keys()\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if "component_id" in dictionary.keys()\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if "price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + billing_schedule_item_id =\ + dictionary.get("billing_schedule_item_id")\ + if "billing_schedule_item_id" in dictionary.keys()\ + else APIHelper.SKIP + hide =\ + dictionary.get("hide")\ + if "hide" in dictionary.keys()\ + else APIHelper.SKIP + if "component_cost_data" in dictionary.keys(): + component_cost_data =\ + InvoiceLineItemComponentCostData.from_dictionary( + dictionary.get("component_cost_data"))\ + if dictionary.get("component_cost_data") else None else: component_cost_data = APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if "product_price_point_id" in dictionary.keys() else APIHelper.SKIP - custom_item = dictionary.get("custom_item") if "custom_item" in dictionary.keys() else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if "product_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + custom_item =\ + dictionary.get("custom_item")\ + if "custom_item" in dictionary.keys()\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, title, @@ -317,7 +381,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -328,7 +392,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -338,55 +401,295 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!r}, ' - f'tiered_unit_price={(self.tiered_unit_price if hasattr(self, "tiered_unit_price") else None)!r}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!r}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!r}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_version={(self.product_version if hasattr(self, "product_version") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'billing_schedule_item_id={(self.billing_schedule_item_id if hasattr(self, "billing_schedule_item_id") else None)!r}, ' - f'hide={(self.hide if hasattr(self, "hide") else None)!r}, ' - f'component_cost_data={(self.component_cost_data if hasattr(self, "component_cost_data") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'custom_item={(self.custom_item if hasattr(self, "custom_item") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _tiered_unit_price=( + self.tiered_unit_price + if hasattr(self, "tiered_unit_price") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_version=( + self.product_version + if hasattr(self, "product_version") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule_item_id=( + self.billing_schedule_item_id + if hasattr(self, "billing_schedule_item_id") + else None + ) + _hide=( + self.hide + if hasattr(self, "hide") + else None + ) + _component_cost_data=( + self.component_cost_data + if hasattr(self, "component_cost_data") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _custom_item=( + self.custom_item + if hasattr(self, "custom_item") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"title={_title!r}, " + f"description={_description!r}, " + f"quantity={_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"subtotal_amount={_subtotal_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"total_amount={_total_amount!r}, " + f"tiered_unit_price={_tiered_unit_price!r}, " + f"period_range_start={_period_range_start!r}, " + f"period_range_end={_period_range_end!r}, " + f"transaction_id={_transaction_id!r}, " + f"product_id={_product_id!r}, " + f"product_version={_product_version!r}, " + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"billing_schedule_item_id={_billing_schedule_item_id!r}, " + f"hide={_hide!r}, " + f"component_cost_data={_component_cost_data!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"custom_item={_custom_item!r}, " + f"kind={_kind!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!s}, ' - f'tiered_unit_price={(self.tiered_unit_price if hasattr(self, "tiered_unit_price") else None)!s}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!s}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!s}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_version={(self.product_version if hasattr(self, "product_version") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'billing_schedule_item_id={(self.billing_schedule_item_id if hasattr(self, "billing_schedule_item_id") else None)!s}, ' - f'hide={(self.hide if hasattr(self, "hide") else None)!s}, ' - f'component_cost_data={(self.component_cost_data if hasattr(self, "component_cost_data") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'custom_item={(self.custom_item if hasattr(self, "custom_item") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _tiered_unit_price=( + self.tiered_unit_price + if hasattr(self, "tiered_unit_price") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_version=( + self.product_version + if hasattr(self, "product_version") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _billing_schedule_item_id=( + self.billing_schedule_item_id + if hasattr(self, "billing_schedule_item_id") + else None + ) + _hide=( + self.hide + if hasattr(self, "hide") + else None + ) + _component_cost_data=( + self.component_cost_data + if hasattr(self, "component_cost_data") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _custom_item=( + self.custom_item + if hasattr(self, "custom_item") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"title={_title!s}, " + f"description={_description!s}, " + f"quantity={_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"subtotal_amount={_subtotal_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"total_amount={_total_amount!s}, " + f"tiered_unit_price={_tiered_unit_price!s}, " + f"period_range_start={_period_range_start!s}, " + f"period_range_end={_period_range_end!s}, " + f"transaction_id={_transaction_id!s}, " + f"product_id={_product_id!s}, " + f"product_version={_product_version!s}, " + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"billing_schedule_item_id={_billing_schedule_item_id!s}, " + f"hide={_hide!s}, " + f"component_cost_data={_component_cost_data!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"custom_item={_custom_item!s}, " + f"kind={_kind!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_line_item_component_cost_data.py b/advancedbilling/models/invoice_line_item_component_cost_data.py index 4531ed37..2d42ebf9 100644 --- a/advancedbilling/models/invoice_line_item_component_cost_data.py +++ b/advancedbilling/models/invoice_line_item_component_cost_data.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_cost_data import ComponentCostData +from advancedbilling.models.component_cost_data import ( + ComponentCostData, +) class InvoiceLineItemComponentCostData(object): - """Implementation of the 'Invoice Line Item Component Cost Data' model. Attributes: rates (List[ComponentCostData]): The model property of type List[ComponentCostData]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "rates": 'rates' + "rates": "rates", } _optionals = [ - 'rates', + "rates", ] - def __init__(self, - rates=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceLineItemComponentCostData class""" - + def __init__( + self, + rates=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceLineItemComponentCostData instance.""" # Initialize members of the class if rates is not APIHelper.SKIP: - self.rates = rates + self.rates = rates # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,25 +59,30 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary rates = None - if dictionary.get('rates') is not None: - rates = [ComponentCostData.from_dictionary(x) for x in dictionary.get('rates')] + if dictionary.get("rates") is not None: + rates = [ + ComponentCostData.from_dictionary(x) + for x in dictionary.get("rates") + ] else: rates = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(rates, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -88,7 +93,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -98,11 +102,31 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'rates={(self.rates if hasattr(self, "rates") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _rates=( + self.rates + if hasattr(self, "rates") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"rates={_rates!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'rates={(self.rates if hasattr(self, "rates") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _rates=( + self.rates + if hasattr(self, "rates") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"rates={_rates!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_line_item_event_data.py b/advancedbilling/models/invoice_line_item_event_data.py index 70679e02..3c829eee 100644 --- a/advancedbilling/models/invoice_line_item_event_data.py +++ b/advancedbilling/models/invoice_line_item_event_data.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_line_item_pricing_detail import InvoiceLineItemPricingDetail +from advancedbilling.models.invoice_line_item_pricing_detail import ( + InvoiceLineItemPricingDetail, +) class InvoiceLineItemEventData(object): - """Implementation of the 'Invoice Line Item Event Data' model. Attributes: @@ -26,8 +26,8 @@ class InvoiceLineItemEventData(object): amount (str): The model property of type str. line_references (str): The model property of type str. pricing_details_index (int): The model property of type int. - pricing_details (List[InvoiceLineItemPricingDetail]): The model - property of type List[InvoiceLineItemPricingDetail]. + pricing_details (List[InvoiceLineItemPricingDetail]): The model property of + type List[InvoiceLineItemPricingDetail]. tax_code (str): The model property of type str. tax_amount (str): The model property of type str. product_id (int): The model property of type int. @@ -36,134 +36,134 @@ class InvoiceLineItemEventData(object): component_id (int): The model property of type int. billing_schedule_item_id (int): The model property of type int. custom_item (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "title": 'title', - "description": 'description', - "quantity": 'quantity', - "quantity_delta": 'quantity_delta', - "unit_price": 'unit_price', - "period_range_start": 'period_range_start', - "period_range_end": 'period_range_end', - "amount": 'amount', - "line_references": 'line_references', - "pricing_details_index": 'pricing_details_index', - "pricing_details": 'pricing_details', - "tax_code": 'tax_code', - "tax_amount": 'tax_amount', - "product_id": 'product_id', - "product_price_point_id": 'product_price_point_id', - "price_point_id": 'price_point_id', - "component_id": 'component_id', - "billing_schedule_item_id": 'billing_schedule_item_id', - "custom_item": 'custom_item' + "uid": "uid", + "title": "title", + "description": "description", + "quantity": "quantity", + "quantity_delta": "quantity_delta", + "unit_price": "unit_price", + "period_range_start": "period_range_start", + "period_range_end": "period_range_end", + "amount": "amount", + "line_references": "line_references", + "pricing_details_index": "pricing_details_index", + "pricing_details": "pricing_details", + "tax_code": "tax_code", + "tax_amount": "tax_amount", + "product_id": "product_id", + "product_price_point_id": "product_price_point_id", + "price_point_id": "price_point_id", + "component_id": "component_id", + "billing_schedule_item_id": "billing_schedule_item_id", + "custom_item": "custom_item", } _optionals = [ - 'uid', - 'title', - 'description', - 'quantity', - 'quantity_delta', - 'unit_price', - 'period_range_start', - 'period_range_end', - 'amount', - 'line_references', - 'pricing_details_index', - 'pricing_details', - 'tax_code', - 'tax_amount', - 'product_id', - 'product_price_point_id', - 'price_point_id', - 'component_id', - 'billing_schedule_item_id', - 'custom_item', + "uid", + "title", + "description", + "quantity", + "quantity_delta", + "unit_price", + "period_range_start", + "period_range_end", + "amount", + "line_references", + "pricing_details_index", + "pricing_details", + "tax_code", + "tax_amount", + "product_id", + "product_price_point_id", + "price_point_id", + "component_id", + "billing_schedule_item_id", + "custom_item", ] _nullables = [ - 'quantity_delta', - 'pricing_details_index', - 'tax_code', - 'product_price_point_id', - 'price_point_id', - 'component_id', - 'billing_schedule_item_id', - 'custom_item', + "quantity_delta", + "pricing_details_index", + "tax_code", + "product_price_point_id", + "price_point_id", + "component_id", + "billing_schedule_item_id", + "custom_item", ] - def __init__(self, - uid=APIHelper.SKIP, - title=APIHelper.SKIP, - description=APIHelper.SKIP, - quantity=APIHelper.SKIP, - quantity_delta=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - period_range_start=APIHelper.SKIP, - period_range_end=APIHelper.SKIP, - amount=APIHelper.SKIP, - line_references=APIHelper.SKIP, - pricing_details_index=APIHelper.SKIP, - pricing_details=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - component_id=APIHelper.SKIP, - billing_schedule_item_id=APIHelper.SKIP, - custom_item=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceLineItemEventData class""" - + def __init__( + self, + uid=APIHelper.SKIP, + title=APIHelper.SKIP, + description=APIHelper.SKIP, + quantity=APIHelper.SKIP, + quantity_delta=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + period_range_start=APIHelper.SKIP, + period_range_end=APIHelper.SKIP, + amount=APIHelper.SKIP, + line_references=APIHelper.SKIP, + pricing_details_index=APIHelper.SKIP, + pricing_details=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + billing_schedule_item_id=APIHelper.SKIP, + custom_item=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceLineItemEventData instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if title is not APIHelper.SKIP: - self.title = title + self.title = title if description is not APIHelper.SKIP: - self.description = description + self.description = description if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if quantity_delta is not APIHelper.SKIP: - self.quantity_delta = quantity_delta + self.quantity_delta = quantity_delta if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if period_range_start is not APIHelper.SKIP: - self.period_range_start = period_range_start + self.period_range_start = period_range_start if period_range_end is not APIHelper.SKIP: - self.period_range_end = period_range_end + self.period_range_end = period_range_end if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount if line_references is not APIHelper.SKIP: - self.line_references = line_references + self.line_references = line_references if pricing_details_index is not APIHelper.SKIP: - self.pricing_details_index = pricing_details_index + self.pricing_details_index = pricing_details_index if pricing_details is not APIHelper.SKIP: - self.pricing_details = pricing_details + self.pricing_details = pricing_details if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if billing_schedule_item_id is not APIHelper.SKIP: - self.billing_schedule_item_id = billing_schedule_item_id + self.billing_schedule_item_id = billing_schedule_item_id if custom_item is not APIHelper.SKIP: - self.custom_item = custom_item + self.custom_item = custom_item # Add additional model properties to the instance if additional_properties is None: @@ -173,7 +173,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -184,37 +184,99 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - quantity_delta = dictionary.get("quantity_delta") if "quantity_delta" in dictionary.keys() else APIHelper.SKIP - unit_price = dictionary.get("unit_price") if dictionary.get("unit_price") else APIHelper.SKIP - period_range_start = dictionary.get("period_range_start") if dictionary.get("period_range_start") else APIHelper.SKIP - period_range_end = dictionary.get("period_range_end") if dictionary.get("period_range_end") else APIHelper.SKIP - amount = dictionary.get("amount") if dictionary.get("amount") else APIHelper.SKIP - line_references = dictionary.get("line_references") if dictionary.get("line_references") else APIHelper.SKIP - pricing_details_index = dictionary.get("pricing_details_index") if "pricing_details_index" in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + quantity_delta =\ + dictionary.get("quantity_delta")\ + if "quantity_delta" in dictionary.keys()\ + else APIHelper.SKIP + unit_price =\ + dictionary.get("unit_price")\ + if dictionary.get("unit_price")\ + else APIHelper.SKIP + period_range_start =\ + dictionary.get("period_range_start")\ + if dictionary.get("period_range_start")\ + else APIHelper.SKIP + period_range_end =\ + dictionary.get("period_range_end")\ + if dictionary.get("period_range_end")\ + else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else APIHelper.SKIP + line_references =\ + dictionary.get("line_references")\ + if dictionary.get("line_references")\ + else APIHelper.SKIP + pricing_details_index =\ + dictionary.get("pricing_details_index")\ + if "pricing_details_index" in dictionary.keys()\ + else APIHelper.SKIP pricing_details = None - if dictionary.get('pricing_details') is not None: - pricing_details = [InvoiceLineItemPricingDetail.from_dictionary(x) for x in dictionary.get('pricing_details')] + if dictionary.get("pricing_details") is not None: + pricing_details = [ + InvoiceLineItemPricingDetail.from_dictionary(x) + for x in dictionary.get("pricing_details") + ] else: pricing_details = APIHelper.SKIP - tax_code = dictionary.get("tax_code") if "tax_code" in dictionary.keys() else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if "product_price_point_id" in dictionary.keys() else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if "price_point_id" in dictionary.keys() else APIHelper.SKIP - component_id = dictionary.get("component_id") if "component_id" in dictionary.keys() else APIHelper.SKIP - billing_schedule_item_id = dictionary.get("billing_schedule_item_id") if "billing_schedule_item_id" in dictionary.keys() else APIHelper.SKIP - custom_item = dictionary.get("custom_item") if "custom_item" in dictionary.keys() else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if "tax_code" in dictionary.keys()\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if "product_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if "price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if "component_id" in dictionary.keys()\ + else APIHelper.SKIP + billing_schedule_item_id =\ + dictionary.get("billing_schedule_item_id")\ + if "billing_schedule_item_id" in dictionary.keys()\ + else APIHelper.SKIP + custom_item =\ + dictionary.get("custom_item")\ + if "custom_item" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, title, @@ -240,7 +302,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -251,7 +313,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -261,49 +322,259 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'quantity_delta={(self.quantity_delta if hasattr(self, "quantity_delta") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!r}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'line_references={(self.line_references if hasattr(self, "line_references") else None)!r}, ' - f'pricing_details_index={(self.pricing_details_index if hasattr(self, "pricing_details_index") else None)!r}, ' - f'pricing_details={(self.pricing_details if hasattr(self, "pricing_details") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'billing_schedule_item_id={(self.billing_schedule_item_id if hasattr(self, "billing_schedule_item_id") else None)!r}, ' - f'custom_item={(self.custom_item if hasattr(self, "custom_item") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _quantity_delta=( + self.quantity_delta + if hasattr(self, "quantity_delta") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _line_references=( + self.line_references + if hasattr(self, "line_references") + else None + ) + _pricing_details_index=( + self.pricing_details_index + if hasattr(self, "pricing_details_index") + else None + ) + _pricing_details=( + self.pricing_details + if hasattr(self, "pricing_details") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _billing_schedule_item_id=( + self.billing_schedule_item_id + if hasattr(self, "billing_schedule_item_id") + else None + ) + _custom_item=( + self.custom_item + if hasattr(self, "custom_item") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"title={_title!r}, " + f"description={_description!r}, " + f"quantity={_quantity!r}, " + f"quantity_delta={_quantity_delta!r}, " + f"unit_price={_unit_price!r}, " + f"period_range_start={_period_range_start!r}, " + f"period_range_end={_period_range_end!r}, " + f"amount={_amount!r}, " + f"line_references={_line_references!r}, " + f"pricing_details_index={_pricing_details_index!r}, " + f"pricing_details={_pricing_details!r}, " + f"tax_code={_tax_code!r}, " + f"tax_amount={_tax_amount!r}, " + f"product_id={_product_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"component_id={_component_id!r}, " + f"billing_schedule_item_id={_billing_schedule_item_id!r}, " + f"custom_item={_custom_item!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'quantity_delta={(self.quantity_delta if hasattr(self, "quantity_delta") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!s}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'line_references={(self.line_references if hasattr(self, "line_references") else None)!s}, ' - f'pricing_details_index={(self.pricing_details_index if hasattr(self, "pricing_details_index") else None)!s}, ' - f'pricing_details={(self.pricing_details if hasattr(self, "pricing_details") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'billing_schedule_item_id={(self.billing_schedule_item_id if hasattr(self, "billing_schedule_item_id") else None)!s}, ' - f'custom_item={(self.custom_item if hasattr(self, "custom_item") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _quantity_delta=( + self.quantity_delta + if hasattr(self, "quantity_delta") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _line_references=( + self.line_references + if hasattr(self, "line_references") + else None + ) + _pricing_details_index=( + self.pricing_details_index + if hasattr(self, "pricing_details_index") + else None + ) + _pricing_details=( + self.pricing_details + if hasattr(self, "pricing_details") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _billing_schedule_item_id=( + self.billing_schedule_item_id + if hasattr(self, "billing_schedule_item_id") + else None + ) + _custom_item=( + self.custom_item + if hasattr(self, "custom_item") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"title={_title!s}, " + f"description={_description!s}, " + f"quantity={_quantity!s}, " + f"quantity_delta={_quantity_delta!s}, " + f"unit_price={_unit_price!s}, " + f"period_range_start={_period_range_start!s}, " + f"period_range_end={_period_range_end!s}, " + f"amount={_amount!s}, " + f"line_references={_line_references!s}, " + f"pricing_details_index={_pricing_details_index!s}, " + f"pricing_details={_pricing_details!s}, " + f"tax_code={_tax_code!s}, " + f"tax_amount={_tax_amount!s}, " + f"product_id={_product_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"component_id={_component_id!s}, " + f"billing_schedule_item_id={_billing_schedule_item_id!s}, " + f"custom_item={_custom_item!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_line_item_pricing_detail.py b/advancedbilling/models/invoice_line_item_pricing_detail.py index 031b333d..e43bce74 100644 --- a/advancedbilling/models/invoice_line_item_pricing_detail.py +++ b/advancedbilling/models/invoice_line_item_pricing_detail.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceLineItemPricingDetail(object): - """Implementation of the 'Invoice Line Item Pricing Detail' model. Attributes: label (str): The model property of type str. amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "label": 'label', - "amount": 'amount' + "label": "label", + "amount": "amount", } _optionals = [ - 'label', - 'amount', + "label", + "amount", ] - def __init__(self, - label=APIHelper.SKIP, - amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceLineItemPricingDetail class""" - + def __init__( + self, + label=APIHelper.SKIP, + amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceLineItemPricingDetail instance.""" # Initialize members of the class if label is not APIHelper.SKIP: - self.label = label + self.label = label if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,15 +61,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - label = dictionary.get("label") if dictionary.get("label") else APIHelper.SKIP - amount = dictionary.get("amount") if dictionary.get("amount") else APIHelper.SKIP + label =\ + dictionary.get("label")\ + if dictionary.get("label")\ + else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(label, amount, @@ -79,7 +85,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -90,7 +96,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -100,13 +105,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'label={(self.label if hasattr(self, "label") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _label=( + self.label + if hasattr(self, "label") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"label={_label!r}, " + f"amount={_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'label={(self.label if hasattr(self, "label") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _label=( + self.label + if hasattr(self, "label") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"label={_label!s}, " + f"amount={_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_payer.py b/advancedbilling/models/invoice_payer.py index 4b131de8..12182941 100644 --- a/advancedbilling/models/invoice_payer.py +++ b/advancedbilling/models/invoice_payer.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoicePayer(object): - """Implementation of the 'Invoice Payer' model. Attributes: @@ -20,58 +18,58 @@ class InvoicePayer(object): organization (str): The model property of type str. email (str): The model property of type str. vat_number (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify_id": 'chargify_id', - "first_name": 'first_name', - "last_name": 'last_name', - "organization": 'organization', - "email": 'email', - "vat_number": 'vat_number' + "chargify_id": "chargify_id", + "first_name": "first_name", + "last_name": "last_name", + "organization": "organization", + "email": "email", + "vat_number": "vat_number", } _optionals = [ - 'chargify_id', - 'first_name', - 'last_name', - 'organization', - 'email', - 'vat_number', + "chargify_id", + "first_name", + "last_name", + "organization", + "email", + "vat_number", ] _nullables = [ - 'organization', - 'vat_number', + "organization", + "vat_number", ] - def __init__(self, - chargify_id=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - organization=APIHelper.SKIP, - email=APIHelper.SKIP, - vat_number=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoicePayer class""" - + def __init__( + self, + chargify_id=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + organization=APIHelper.SKIP, + email=APIHelper.SKIP, + vat_number=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoicePayer instance.""" # Initialize members of the class if chargify_id is not APIHelper.SKIP: - self.chargify_id = chargify_id + self.chargify_id = chargify_id if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if email is not APIHelper.SKIP: - self.email = email + self.email = email if vat_number is not APIHelper.SKIP: - self.vat_number = vat_number + self.vat_number = vat_number # Add additional model properties to the instance if additional_properties is None: @@ -81,7 +79,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -92,19 +90,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargify_id = dictionary.get("chargify_id") if dictionary.get("chargify_id") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - organization = dictionary.get("organization") if "organization" in dictionary.keys() else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP - vat_number = dictionary.get("vat_number") if "vat_number" in dictionary.keys() else APIHelper.SKIP + chargify_id =\ + dictionary.get("chargify_id")\ + if dictionary.get("chargify_id")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if "organization" in dictionary.keys()\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + vat_number =\ + dictionary.get("vat_number")\ + if "vat_number" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify_id, first_name, @@ -116,7 +134,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -127,7 +145,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -137,21 +154,91 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify_id={(self.chargify_id if hasattr(self, "chargify_id") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify_id=( + self.chargify_id + if hasattr(self, "chargify_id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_id={_chargify_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"organization={_organization!r}, " + f"email={_email!r}, " + f"vat_number={_vat_number!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify_id={(self.chargify_id if hasattr(self, "chargify_id") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify_id=( + self.chargify_id + if hasattr(self, "chargify_id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_id={_chargify_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"organization={_organization!s}, " + f"email={_email!s}, " + f"vat_number={_vat_number!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_payer_change.py b/advancedbilling/models/invoice_payer_change.py index bb9febcb..c7e1943b 100644 --- a/advancedbilling/models/invoice_payer_change.py +++ b/advancedbilling/models/invoice_payer_change.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoicePayerChange(object): - """Implementation of the 'Invoice Payer Change' model. Attributes: @@ -18,43 +16,43 @@ class InvoicePayerChange(object): last_name (str): The model property of type str. organization (str): The model property of type str. email (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "organization": 'organization', - "email": 'email' + "first_name": "first_name", + "last_name": "last_name", + "organization": "organization", + "email": "email", } _optionals = [ - 'first_name', - 'last_name', - 'organization', - 'email', + "first_name", + "last_name", + "organization", + "email", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - organization=APIHelper.SKIP, - email=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoicePayerChange class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + organization=APIHelper.SKIP, + email=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoicePayerChange instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if email is not APIHelper.SKIP: - self.email = email + self.email = email # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - organization = dictionary.get("organization") if dictionary.get("organization") else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if dictionary.get("organization")\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"organization={_organization!r}, " + f"email={_email!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"organization={_organization!s}, " + f"email={_email!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_payment.py b/advancedbilling/models/invoice_payment.py index e098da70..aa2747f6 100644 --- a/advancedbilling/models/invoice_payment.py +++ b/advancedbilling/models/invoice_payment.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_payment_method import InvoicePaymentMethod +from advancedbilling.models.invoice_payment_method import ( + InvoicePaymentMethod, +) class InvoicePayment(object): - """Implementation of the 'Invoice Payment' model. Attributes: @@ -27,95 +27,97 @@ class InvoicePayment(object): prepayment (bool): The model property of type bool. gateway_handle (str): The model property of type str. gateway_used (str): The model property of type str. - gateway_transaction_id (str): The transaction ID for the payment as - returned from the payment gateway - received_on (date): Date reflecting when the payment was received from - a customer. Must be in the past. Applicable only to `external` - payments. + gateway_transaction_id (str): The transaction ID for the payment as returned + from the payment gateway + received_on (date): Date reflecting when the payment was received from a + customer. Must be in the past. Applicable only to `external` payments. uid (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "transaction_time": 'transaction_time', - "memo": 'memo', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount', - "payment_method": 'payment_method', - "transaction_id": 'transaction_id', - "prepayment": 'prepayment', - "gateway_handle": 'gateway_handle', - "gateway_used": 'gateway_used', - "gateway_transaction_id": 'gateway_transaction_id', - "received_on": 'received_on', - "uid": 'uid' + "transaction_time": "transaction_time", + "memo": "memo", + "original_amount": "original_amount", + "applied_amount": "applied_amount", + "payment_method": "payment_method", + "transaction_id": "transaction_id", + "prepayment": "prepayment", + "gateway_handle": "gateway_handle", + "gateway_used": "gateway_used", + "gateway_transaction_id": "gateway_transaction_id", + "received_on": "received_on", + "uid": "uid", } _optionals = [ - 'transaction_time', - 'memo', - 'original_amount', - 'applied_amount', - 'payment_method', - 'transaction_id', - 'prepayment', - 'gateway_handle', - 'gateway_used', - 'gateway_transaction_id', - 'received_on', - 'uid', + "transaction_time", + "memo", + "original_amount", + "applied_amount", + "payment_method", + "transaction_id", + "prepayment", + "gateway_handle", + "gateway_used", + "gateway_transaction_id", + "received_on", + "uid", ] _nullables = [ - 'gateway_handle', - 'gateway_transaction_id', - 'received_on', + "gateway_handle", + "gateway_transaction_id", + "received_on", ] - def __init__(self, - transaction_time=APIHelper.SKIP, - memo=APIHelper.SKIP, - original_amount=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - payment_method=APIHelper.SKIP, - transaction_id=APIHelper.SKIP, - prepayment=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - gateway_used=APIHelper.SKIP, - gateway_transaction_id=APIHelper.SKIP, - received_on=APIHelper.SKIP, - uid=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoicePayment class""" - + def __init__( + self, + transaction_time=APIHelper.SKIP, + memo=APIHelper.SKIP, + original_amount=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + payment_method=APIHelper.SKIP, + transaction_id=APIHelper.SKIP, + prepayment=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + gateway_used=APIHelper.SKIP, + gateway_transaction_id=APIHelper.SKIP, + received_on=APIHelper.SKIP, + uid=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoicePayment instance.""" # Initialize members of the class if transaction_time is not APIHelper.SKIP: - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount + self.original_amount = original_amount if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount if payment_method is not APIHelper.SKIP: - self.payment_method = payment_method + self.payment_method = payment_method if transaction_id is not APIHelper.SKIP: - self.transaction_id = transaction_id + self.transaction_id = transaction_id if prepayment is not APIHelper.SKIP: - self.prepayment = prepayment + self.prepayment = prepayment if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if gateway_used is not APIHelper.SKIP: - self.gateway_used = gateway_used + self.gateway_used = gateway_used if gateway_transaction_id is not APIHelper.SKIP: - self.gateway_transaction_id = gateway_transaction_id + self.gateway_transaction_id = gateway_transaction_id if received_on is not APIHelper.SKIP: - self.received_on = received_on + self.received_on = received_on if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid # Add additional model properties to the instance if additional_properties is None: @@ -125,7 +127,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -136,28 +138,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP - payment_method = InvoicePaymentMethod.from_dictionary(dictionary.get('payment_method')) if 'payment_method' in dictionary.keys() else APIHelper.SKIP - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP - prepayment = dictionary.get("prepayment") if "prepayment" in dictionary.keys() else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if "gateway_handle" in dictionary.keys() else APIHelper.SKIP - gateway_used = dictionary.get("gateway_used") if dictionary.get("gateway_used") else APIHelper.SKIP - gateway_transaction_id = dictionary.get("gateway_transaction_id") if "gateway_transaction_id" in dictionary.keys() else APIHelper.SKIP - if 'received_on' in dictionary.keys(): - received_on = dateutil.parser.parse(dictionary.get('received_on')).date() if dictionary.get('received_on') else None + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + payment_method =\ + InvoicePaymentMethod.from_dictionary( + dictionary.get("payment_method"))\ + if "payment_method" in dictionary.keys()\ + else APIHelper.SKIP + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else APIHelper.SKIP + prepayment =\ + dictionary.get("prepayment")\ + if "prepayment" in dictionary.keys()\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + gateway_used =\ + dictionary.get("gateway_used")\ + if dictionary.get("gateway_used")\ + else APIHelper.SKIP + gateway_transaction_id =\ + dictionary.get("gateway_transaction_id")\ + if "gateway_transaction_id" in dictionary.keys()\ + else APIHelper.SKIP + if "received_on" in dictionary.keys(): + received_on = dateutil.parser.parse( + dictionary.get("received_on")).date()\ + if dictionary.get("received_on") else None + else: received_on = APIHelper.SKIP - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(transaction_time, memo, @@ -175,7 +215,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -186,7 +226,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -196,33 +235,163 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'payment_method={(self.payment_method if hasattr(self, "payment_method") else None)!r}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'gateway_used={(self.gateway_used if hasattr(self, "gateway_used") else None)!r}, ' - f'gateway_transaction_id={(self.gateway_transaction_id if hasattr(self, "gateway_transaction_id") else None)!r}, ' - f'received_on={(self.received_on if hasattr(self, "received_on") else None)!r}, ' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _payment_method=( + self.payment_method + if hasattr(self, "payment_method") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _gateway_used=( + self.gateway_used + if hasattr(self, "gateway_used") + else None + ) + _gateway_transaction_id=( + self.gateway_transaction_id + if hasattr(self, "gateway_transaction_id") + else None + ) + _received_on=( + self.received_on + if hasattr(self, "received_on") + else None + ) + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_time={_transaction_time!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"payment_method={_payment_method!r}, " + f"transaction_id={_transaction_id!r}, " + f"prepayment={_prepayment!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"gateway_used={_gateway_used!r}, " + f"gateway_transaction_id={_gateway_transaction_id!r}, " + f"received_on={_received_on!r}, " + f"uid={_uid!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'transaction_time={(self.transaction_time if hasattr(self, "transaction_time") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'payment_method={(self.payment_method if hasattr(self, "payment_method") else None)!s}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'gateway_used={(self.gateway_used if hasattr(self, "gateway_used") else None)!s}, ' - f'gateway_transaction_id={(self.gateway_transaction_id if hasattr(self, "gateway_transaction_id") else None)!s}, ' - f'received_on={(self.received_on if hasattr(self, "received_on") else None)!s}, ' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _transaction_time=( + self.transaction_time + if hasattr(self, "transaction_time") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _payment_method=( + self.payment_method + if hasattr(self, "payment_method") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _gateway_used=( + self.gateway_used + if hasattr(self, "gateway_used") + else None + ) + _gateway_transaction_id=( + self.gateway_transaction_id + if hasattr(self, "gateway_transaction_id") + else None + ) + _received_on=( + self.received_on + if hasattr(self, "received_on") + else None + ) + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_time={_transaction_time!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"payment_method={_payment_method!s}, " + f"transaction_id={_transaction_id!s}, " + f"prepayment={_prepayment!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"gateway_used={_gateway_used!s}, " + f"gateway_transaction_id={_gateway_transaction_id!s}, " + f"received_on={_received_on!s}, " + f"uid={_uid!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_payment_application.py b/advancedbilling/models/invoice_payment_application.py index f0c4f409..1b0e90c1 100644 --- a/advancedbilling/models/invoice_payment_application.py +++ b/advancedbilling/models/invoice_payment_application.py @@ -1,56 +1,54 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoicePaymentApplication(object): - """Implementation of the 'Invoice Payment Application' model. Attributes: - invoice_uid (str): Unique identifier for the paid invoice. It has the - prefix "inv_" followed by alphanumeric characters. - application_uid (str): Unique identifier for the payment. It has the - prefix "pmt_" followed by alphanumeric characters. + invoice_uid (str): Unique identifier for the paid invoice. It has the prefix + "inv_" followed by alphanumeric characters. + application_uid (str): Unique identifier for the payment. It has the prefix + "pmt_" followed by alphanumeric characters. applied_amount (str): Dollar amount of the paid invoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "invoice_uid": 'invoice_uid', - "application_uid": 'application_uid', - "applied_amount": 'applied_amount' + "invoice_uid": "invoice_uid", + "application_uid": "application_uid", + "applied_amount": "applied_amount", } _optionals = [ - 'invoice_uid', - 'application_uid', - 'applied_amount', + "invoice_uid", + "application_uid", + "applied_amount", ] - def __init__(self, - invoice_uid=APIHelper.SKIP, - application_uid=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoicePaymentApplication class""" - + def __init__( + self, + invoice_uid=APIHelper.SKIP, + application_uid=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoicePaymentApplication instance.""" # Initialize members of the class if invoice_uid is not APIHelper.SKIP: - self.invoice_uid = invoice_uid + self.invoice_uid = invoice_uid if application_uid is not APIHelper.SKIP: - self.application_uid = application_uid + self.application_uid = application_uid if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount # Add additional model properties to the instance if additional_properties is None: @@ -60,7 +58,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -71,16 +69,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - invoice_uid = dictionary.get("invoice_uid") if dictionary.get("invoice_uid") else APIHelper.SKIP - application_uid = dictionary.get("application_uid") if dictionary.get("application_uid") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP + invoice_uid =\ + dictionary.get("invoice_uid")\ + if dictionary.get("invoice_uid")\ + else APIHelper.SKIP + application_uid =\ + dictionary.get("application_uid")\ + if dictionary.get("application_uid")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(invoice_uid, application_uid, @@ -88,15 +97,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoice_uid={(self.invoice_uid if hasattr(self, "invoice_uid") else None)!r}, ' - f'application_uid={(self.application_uid if hasattr(self, "application_uid") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _invoice_uid=( + self.invoice_uid + if hasattr(self, "invoice_uid") + else None + ) + _application_uid=( + self.application_uid + if hasattr(self, "application_uid") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice_uid={_invoice_uid!r}, " + f"application_uid={_application_uid!r}, " + f"applied_amount={_applied_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoice_uid={(self.invoice_uid if hasattr(self, "invoice_uid") else None)!s}, ' - f'application_uid={(self.application_uid if hasattr(self, "application_uid") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _invoice_uid=( + self.invoice_uid + if hasattr(self, "invoice_uid") + else None + ) + _application_uid=( + self.application_uid + if hasattr(self, "application_uid") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice_uid={_invoice_uid!s}, " + f"application_uid={_application_uid!s}, " + f"applied_amount={_applied_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_payment_method.py b/advancedbilling/models/invoice_payment_method.py index 9dad2e1a..2551f865 100644 --- a/advancedbilling/models/invoice_payment_method.py +++ b/advancedbilling/models/invoice_payment_method.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoicePaymentMethod(object): - """Implementation of the 'Invoice Payment Method' model. Attributes: @@ -22,67 +20,67 @@ class InvoicePaymentMethod(object): card_expiration (str): The model property of type str. last_four (str): The model property of type str. masked_card_number (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "details": 'details', - "kind": 'kind', - "memo": 'memo', - "mtype": 'type', - "card_brand": 'card_brand', - "card_expiration": 'card_expiration', - "last_four": 'last_four', - "masked_card_number": 'masked_card_number' + "details": "details", + "kind": "kind", + "memo": "memo", + "mtype": "type", + "card_brand": "card_brand", + "card_expiration": "card_expiration", + "last_four": "last_four", + "masked_card_number": "masked_card_number", } _optionals = [ - 'details', - 'kind', - 'memo', - 'mtype', - 'card_brand', - 'card_expiration', - 'last_four', - 'masked_card_number', + "details", + "kind", + "memo", + "mtype", + "card_brand", + "card_expiration", + "last_four", + "masked_card_number", ] _nullables = [ - 'last_four', + "last_four", ] - def __init__(self, - details=APIHelper.SKIP, - kind=APIHelper.SKIP, - memo=APIHelper.SKIP, - mtype=APIHelper.SKIP, - card_brand=APIHelper.SKIP, - card_expiration=APIHelper.SKIP, - last_four=APIHelper.SKIP, - masked_card_number=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoicePaymentMethod class""" - + def __init__( + self, + details=APIHelper.SKIP, + kind=APIHelper.SKIP, + memo=APIHelper.SKIP, + mtype=APIHelper.SKIP, + card_brand=APIHelper.SKIP, + card_expiration=APIHelper.SKIP, + last_four=APIHelper.SKIP, + masked_card_number=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoicePaymentMethod instance.""" # Initialize members of the class if details is not APIHelper.SKIP: - self.details = details + self.details = details if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if mtype is not APIHelper.SKIP: - self.mtype = mtype + self.mtype = mtype if card_brand is not APIHelper.SKIP: - self.card_brand = card_brand + self.card_brand = card_brand if card_expiration is not APIHelper.SKIP: - self.card_expiration = card_expiration + self.card_expiration = card_expiration if last_four is not APIHelper.SKIP: - self.last_four = last_four + self.last_four = last_four if masked_card_number is not APIHelper.SKIP: - self.masked_card_number = masked_card_number + self.masked_card_number = masked_card_number # Add additional model properties to the instance if additional_properties is None: @@ -92,7 +90,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -103,21 +101,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - details = dictionary.get("details") if dictionary.get("details") else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP - card_brand = dictionary.get("card_brand") if dictionary.get("card_brand") else APIHelper.SKIP - card_expiration = dictionary.get("card_expiration") if dictionary.get("card_expiration") else APIHelper.SKIP - last_four = dictionary.get("last_four") if "last_four" in dictionary.keys() else APIHelper.SKIP - masked_card_number = dictionary.get("masked_card_number") if dictionary.get("masked_card_number") else APIHelper.SKIP + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else APIHelper.SKIP + card_brand =\ + dictionary.get("card_brand")\ + if dictionary.get("card_brand")\ + else APIHelper.SKIP + card_expiration =\ + dictionary.get("card_expiration")\ + if dictionary.get("card_expiration")\ + else APIHelper.SKIP + last_four =\ + dictionary.get("last_four")\ + if "last_four" in dictionary.keys()\ + else APIHelper.SKIP + masked_card_number =\ + dictionary.get("masked_card_number")\ + if dictionary.get("masked_card_number")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(details, kind, @@ -131,7 +155,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -142,7 +166,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -152,25 +175,115 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'details={(self.details if hasattr(self, "details") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' - f'card_brand={(self.card_brand if hasattr(self, "card_brand") else None)!r}, ' - f'card_expiration={(self.card_expiration if hasattr(self, "card_expiration") else None)!r}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!r}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _details=( + self.details + if hasattr(self, "details") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _card_brand=( + self.card_brand + if hasattr(self, "card_brand") + else None + ) + _card_expiration=( + self.card_expiration + if hasattr(self, "card_expiration") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"details={_details!r}, " + f"kind={_kind!r}, " + f"memo={_memo!r}, " + f"mtype={_mtype!r}, " + f"card_brand={_card_brand!r}, " + f"card_expiration={_card_expiration!r}, " + f"last_four={_last_four!r}, " + f"masked_card_number={_masked_card_number!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'details={(self.details if hasattr(self, "details") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' - f'card_brand={(self.card_brand if hasattr(self, "card_brand") else None)!s}, ' - f'card_expiration={(self.card_expiration if hasattr(self, "card_expiration") else None)!s}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!s}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _details=( + self.details + if hasattr(self, "details") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _card_brand=( + self.card_brand + if hasattr(self, "card_brand") + else None + ) + _card_expiration=( + self.card_expiration + if hasattr(self, "card_expiration") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"details={_details!s}, " + f"kind={_kind!s}, " + f"memo={_memo!s}, " + f"mtype={_mtype!s}, " + f"card_brand={_card_brand!s}, " + f"card_expiration={_card_expiration!s}, " + f"last_four={_last_four!s}, " + f"masked_card_number={_masked_card_number!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_payment_method_type.py b/advancedbilling/models/invoice_payment_method_type.py index abacc239..9b2d49a1 100644 --- a/advancedbilling/models/invoice_payment_method_type.py +++ b/advancedbilling/models/invoice_payment_method_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoicePaymentMethodType(object): - """Implementation of the 'Invoice Payment Method Type' enum. The type of payment method used. Defaults to other. @@ -21,26 +18,28 @@ class InvoicePaymentMethodType(object): MONEY_ORDER: The enum member of type str. ACH: The enum member of type str. OTHER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['credit_card', 'check', 'cash', 'money_order', 'ach', 'other'] - CREDIT_CARD = 'credit_card' - CHECK = 'check' + _all_values = ["credit_card", "check", "cash", "money_order", "ach", + "other"] + CREDIT_CARD = "credit_card" - CASH = 'cash' + CHECK = "check" - MONEY_ORDER = 'money_order' + CASH = "cash" - ACH = 'ach' + MONEY_ORDER = "money_order" - OTHER = 'other' + ACH = "ach" + + OTHER = "other" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -50,9 +49,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_payment_type.py b/advancedbilling/models/invoice_payment_type.py index 76f10249..9e051520 100644 --- a/advancedbilling/models/invoice_payment_type.py +++ b/advancedbilling/models/invoice_payment_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoicePaymentType(object): - """Implementation of the 'Invoice Payment Type' enum. The type of payment to be applied to an Invoice. Defaults to external. @@ -19,20 +16,22 @@ class InvoicePaymentType(object): PREPAYMENT: The enum member of type str. SERVICE_CREDIT: The enum member of type str. PAYMENT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - EXTERNAL = 'external' - PREPAYMENT = 'prepayment' + EXTERNAL = "external" + + PREPAYMENT = "prepayment" - SERVICE_CREDIT = 'service_credit' + SERVICE_CREDIT = "service_credit" - PAYMENT = 'payment' + PAYMENT = "payment" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_pre_payment.py b/advancedbilling/models/invoice_pre_payment.py index e3a0e538..76145c69 100644 --- a/advancedbilling/models/invoice_pre_payment.py +++ b/advancedbilling/models/invoice_pre_payment.py @@ -1,56 +1,54 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoicePrePayment(object): - """Implementation of the 'Invoice PrePayment' model. Attributes: subscription_id (int): The subscription id for the prepayment account - amount_in_cents (int): The amount in cents of the prepayment that was - created as a result of this payment. - ending_balance_in_cents (int): The total balance of the prepayment - account for this subscription including any prior prepayments - additional_properties (Dict[str, object]): The additional properties - for the model. + amount_in_cents (int): The amount in cents of the prepayment that was created + as a result of this payment. + ending_balance_in_cents (int): The total balance of the prepayment account + for this subscription including any prior prepayments + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_id": 'subscription_id', - "amount_in_cents": 'amount_in_cents', - "ending_balance_in_cents": 'ending_balance_in_cents' + "subscription_id": "subscription_id", + "amount_in_cents": "amount_in_cents", + "ending_balance_in_cents": "ending_balance_in_cents", } _optionals = [ - 'subscription_id', - 'amount_in_cents', - 'ending_balance_in_cents', + "subscription_id", + "amount_in_cents", + "ending_balance_in_cents", ] - def __init__(self, - subscription_id=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - ending_balance_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoicePrePayment class""" - + def __init__( + self, + subscription_id=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + ending_balance_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoicePrePayment instance.""" # Initialize members of the class if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if ending_balance_in_cents is not APIHelper.SKIP: - self.ending_balance_in_cents = ending_balance_in_cents + self.ending_balance_in_cents = ending_balance_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -60,7 +58,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -71,16 +69,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - ending_balance_in_cents = dictionary.get("ending_balance_in_cents") if dictionary.get("ending_balance_in_cents") else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + ending_balance_in_cents =\ + dictionary.get("ending_balance_in_cents")\ + if dictionary.get("ending_balance_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_id, amount_in_cents, @@ -88,15 +97,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_id={_subscription_id!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"ending_balance_in_cents={_ending_balance_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_id={_subscription_id!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"ending_balance_in_cents={_ending_balance_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_previous_balance.py b/advancedbilling/models/invoice_previous_balance.py index 17cf67d7..f0037169 100644 --- a/advancedbilling/models/invoice_previous_balance.py +++ b/advancedbilling/models/invoice_previous_balance.py @@ -1,50 +1,53 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_balance_item import InvoiceBalanceItem +from advancedbilling.models.invoice_balance_item import ( + InvoiceBalanceItem, +) class InvoicePreviousBalance(object): - """Implementation of the 'Invoice Previous Balance' model. Attributes: captured_at (datetime): The model property of type datetime. invoices (List[InvoiceBalanceItem]): The model property of type List[InvoiceBalanceItem]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "captured_at": 'captured_at', - "invoices": 'invoices' + "captured_at": "captured_at", + "invoices": "invoices", } _optionals = [ - 'captured_at', - 'invoices', + "captured_at", + "invoices", ] - def __init__(self, - captured_at=APIHelper.SKIP, - invoices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoicePreviousBalance class""" - + def __init__( + self, + captured_at=APIHelper.SKIP, + invoices=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoicePreviousBalance instance.""" # Initialize members of the class if captured_at is not APIHelper.SKIP: - self.captured_at = APIHelper.apply_datetime_converter(captured_at, APIHelper.RFC3339DateTime) if captured_at else None + self.captured_at =\ + APIHelper.apply_datetime_converter( + captured_at, APIHelper.RFC3339DateTime)\ + if captured_at else None if invoices is not APIHelper.SKIP: - self.invoices = invoices + self.invoices = invoices # Add additional model properties to the instance if additional_properties is None: @@ -54,7 +57,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -65,19 +68,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - captured_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("captured_at")).datetime if dictionary.get("captured_at") else APIHelper.SKIP + captured_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("captured_at")).datetime\ + if dictionary.get("captured_at") else APIHelper.SKIP invoices = None - if dictionary.get('invoices') is not None: - invoices = [InvoiceBalanceItem.from_dictionary(x) for x in dictionary.get('invoices')] + if dictionary.get("invoices") is not None: + invoices = [ + InvoiceBalanceItem.from_dictionary(x) + for x in dictionary.get("invoices") + ] else: invoices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(captured_at, invoices, @@ -85,7 +95,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -96,7 +106,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -106,13 +115,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'captured_at={(self.captured_at if hasattr(self, "captured_at") else None)!r}, ' - f'invoices={(self.invoices if hasattr(self, "invoices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _captured_at=( + self.captured_at + if hasattr(self, "captured_at") + else None + ) + _invoices=( + self.invoices + if hasattr(self, "invoices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"captured_at={_captured_at!r}, " + f"invoices={_invoices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'captured_at={(self.captured_at if hasattr(self, "captured_at") else None)!s}, ' - f'invoices={(self.invoices if hasattr(self, "invoices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _captured_at=( + self.captured_at + if hasattr(self, "captured_at") + else None + ) + _invoices=( + self.invoices + if hasattr(self, "invoices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"captured_at={_captured_at!s}, " + f"invoices={_invoices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_refund.py b/advancedbilling/models/invoice_refund.py index 1608bff0..5140af6b 100644 --- a/advancedbilling/models/invoice_refund.py +++ b/advancedbilling/models/invoice_refund.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceRefund(object): - """Implementation of the 'Invoice Refund' model. Attributes: @@ -19,79 +17,79 @@ class InvoiceRefund(object): memo (str): The model property of type str. original_amount (str): The model property of type str. applied_amount (str): The model property of type str. - gateway_transaction_id (str): The transaction ID for the refund as - returned from the payment gateway + gateway_transaction_id (str): The transaction ID for the refund as returned + from the payment gateway gateway_used (str): The model property of type str. gateway_handle (str): The model property of type str. ach_late_reject (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "transaction_id": 'transaction_id', - "payment_id": 'payment_id', - "memo": 'memo', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount', - "gateway_transaction_id": 'gateway_transaction_id', - "gateway_used": 'gateway_used', - "gateway_handle": 'gateway_handle', - "ach_late_reject": 'ach_late_reject' + "transaction_id": "transaction_id", + "payment_id": "payment_id", + "memo": "memo", + "original_amount": "original_amount", + "applied_amount": "applied_amount", + "gateway_transaction_id": "gateway_transaction_id", + "gateway_used": "gateway_used", + "gateway_handle": "gateway_handle", + "ach_late_reject": "ach_late_reject", } _optionals = [ - 'transaction_id', - 'payment_id', - 'memo', - 'original_amount', - 'applied_amount', - 'gateway_transaction_id', - 'gateway_used', - 'gateway_handle', - 'ach_late_reject', + "transaction_id", + "payment_id", + "memo", + "original_amount", + "applied_amount", + "gateway_transaction_id", + "gateway_used", + "gateway_handle", + "ach_late_reject", ] _nullables = [ - 'gateway_transaction_id', - 'gateway_handle', - 'ach_late_reject', + "gateway_transaction_id", + "gateway_handle", + "ach_late_reject", ] - def __init__(self, - transaction_id=APIHelper.SKIP, - payment_id=APIHelper.SKIP, - memo=APIHelper.SKIP, - original_amount=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - gateway_transaction_id=APIHelper.SKIP, - gateway_used=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - ach_late_reject=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceRefund class""" - + def __init__( + self, + transaction_id=APIHelper.SKIP, + payment_id=APIHelper.SKIP, + memo=APIHelper.SKIP, + original_amount=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + gateway_transaction_id=APIHelper.SKIP, + gateway_used=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + ach_late_reject=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceRefund instance.""" # Initialize members of the class if transaction_id is not APIHelper.SKIP: - self.transaction_id = transaction_id + self.transaction_id = transaction_id if payment_id is not APIHelper.SKIP: - self.payment_id = payment_id + self.payment_id = payment_id if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount + self.original_amount = original_amount if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount if gateway_transaction_id is not APIHelper.SKIP: - self.gateway_transaction_id = gateway_transaction_id + self.gateway_transaction_id = gateway_transaction_id if gateway_used is not APIHelper.SKIP: - self.gateway_used = gateway_used + self.gateway_used = gateway_used if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if ach_late_reject is not APIHelper.SKIP: - self.ach_late_reject = ach_late_reject + self.ach_late_reject = ach_late_reject # Add additional model properties to the instance if additional_properties is None: @@ -101,7 +99,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -112,22 +110,51 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP - payment_id = dictionary.get("payment_id") if dictionary.get("payment_id") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP - gateway_transaction_id = dictionary.get("gateway_transaction_id") if "gateway_transaction_id" in dictionary.keys() else APIHelper.SKIP - gateway_used = dictionary.get("gateway_used") if dictionary.get("gateway_used") else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if "gateway_handle" in dictionary.keys() else APIHelper.SKIP - ach_late_reject = dictionary.get("ach_late_reject") if "ach_late_reject" in dictionary.keys() else APIHelper.SKIP + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else APIHelper.SKIP + payment_id =\ + dictionary.get("payment_id")\ + if dictionary.get("payment_id")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + gateway_transaction_id =\ + dictionary.get("gateway_transaction_id")\ + if "gateway_transaction_id" in dictionary.keys()\ + else APIHelper.SKIP + gateway_used =\ + dictionary.get("gateway_used")\ + if dictionary.get("gateway_used")\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + ach_late_reject =\ + dictionary.get("ach_late_reject")\ + if "ach_late_reject" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(transaction_id, payment_id, @@ -142,7 +169,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -153,7 +180,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -163,27 +189,127 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' - f'payment_id={(self.payment_id if hasattr(self, "payment_id") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'gateway_transaction_id={(self.gateway_transaction_id if hasattr(self, "gateway_transaction_id") else None)!r}, ' - f'gateway_used={(self.gateway_used if hasattr(self, "gateway_used") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'ach_late_reject={(self.ach_late_reject if hasattr(self, "ach_late_reject") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _payment_id=( + self.payment_id + if hasattr(self, "payment_id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _gateway_transaction_id=( + self.gateway_transaction_id + if hasattr(self, "gateway_transaction_id") + else None + ) + _gateway_used=( + self.gateway_used + if hasattr(self, "gateway_used") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _ach_late_reject=( + self.ach_late_reject + if hasattr(self, "ach_late_reject") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_id={_transaction_id!r}, " + f"payment_id={_payment_id!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"gateway_transaction_id={_gateway_transaction_id!r}, " + f"gateway_used={_gateway_used!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"ach_late_reject={_ach_late_reject!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' - f'payment_id={(self.payment_id if hasattr(self, "payment_id") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'gateway_transaction_id={(self.gateway_transaction_id if hasattr(self, "gateway_transaction_id") else None)!s}, ' - f'gateway_used={(self.gateway_used if hasattr(self, "gateway_used") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'ach_late_reject={(self.ach_late_reject if hasattr(self, "ach_late_reject") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _payment_id=( + self.payment_id + if hasattr(self, "payment_id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _gateway_transaction_id=( + self.gateway_transaction_id + if hasattr(self, "gateway_transaction_id") + else None + ) + _gateway_used=( + self.gateway_used + if hasattr(self, "gateway_used") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _ach_late_reject=( + self.ach_late_reject + if hasattr(self, "ach_late_reject") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_id={_transaction_id!s}, " + f"payment_id={_payment_id!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"gateway_transaction_id={_gateway_transaction_id!s}, " + f"gateway_used={_gateway_used!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"ach_late_reject={_ach_late_reject!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_response.py b/advancedbilling/models/invoice_response.py index 640cd4b1..3cf4a119 100644 --- a/advancedbilling/models/invoice_response.py +++ b/advancedbilling/models/invoice_response.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.models.invoice import Invoice class InvoiceResponse(object): - """Implementation of the 'Invoice Response' model. Attributes: invoice (Invoice): The model property of type Invoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "invoice": 'invoice' + "invoice": "invoice", } - def __init__(self, - invoice=None, - additional_properties=None): - """Constructor for the InvoiceResponse class""" - + def __init__( + self, + invoice=None, + additional_properties=None): + """Initialize a InvoiceResponse instance.""" # Initialize members of the class - self.invoice = invoice + self.invoice = invoice # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +50,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(invoice, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoice={self.invoice!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _invoice=self.invoice + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice={_invoice!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoice={self.invoice!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _invoice=self.invoice + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice={_invoice!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_role.py b/advancedbilling/models/invoice_role.py index a6a86960..091c07c1 100644 --- a/advancedbilling/models/invoice_role.py +++ b/advancedbilling/models/invoice_role.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceRole(object): - """Implementation of the 'Invoice Role' enum. Attributes: @@ -23,34 +20,37 @@ class InvoiceRole(object): ADHOC: The enum member of type str. BACKPORT: The enum member of type str. BACKPORTBALANCERECONCILIATION: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['unset', 'signup', 'renewal', 'usage', 'reactivation', 'proration', 'migration', 'adhoc', 'backport', 'backport-balance-reconciliation'] - UNSET = 'unset' - SIGNUP = 'signup' + _all_values = ["unset", "signup", "renewal", "usage", "reactivation", + "proration", "migration", "adhoc", "backport", + "backport-balance-reconciliation"] + UNSET = "unset" - RENEWAL = 'renewal' + SIGNUP = "signup" - USAGE = 'usage' + RENEWAL = "renewal" - REACTIVATION = 'reactivation' + USAGE = "usage" - PRORATION = 'proration' + REACTIVATION = "reactivation" - MIGRATION = 'migration' + PRORATION = "proration" - ADHOC = 'adhoc' + MIGRATION = "migration" - BACKPORT = 'backport' + ADHOC = "adhoc" - BACKPORTBALANCERECONCILIATION = 'backport-balance-reconciliation' + BACKPORT = "backport" + + BACKPORTBALANCERECONCILIATION = "backport-balance-reconciliation" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -60,9 +60,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_seller.py b/advancedbilling/models/invoice_seller.py index 7a8c7435..596da2a1 100644 --- a/advancedbilling/models/invoice_seller.py +++ b/advancedbilling/models/invoice_seller.py @@ -1,68 +1,67 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_address import InvoiceAddress +from advancedbilling.models.invoice_address import ( + InvoiceAddress, +) class InvoiceSeller(object): - """Implementation of the 'Invoice Seller' model. - Information about the seller (merchant) listed on the masthead of the - invoice. + Information about the seller (merchant) listed on the masthead of the invoice. Attributes: name (str): The model property of type str. address (InvoiceAddress): The model property of type InvoiceAddress. phone (str): The model property of type str. logo_url (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "address": 'address', - "phone": 'phone', - "logo_url": 'logo_url' + "name": "name", + "address": "address", + "phone": "phone", + "logo_url": "logo_url", } _optionals = [ - 'name', - 'address', - 'phone', - 'logo_url', + "name", + "address", + "phone", + "logo_url", ] _nullables = [ - 'logo_url', + "logo_url", ] - def __init__(self, - name=APIHelper.SKIP, - address=APIHelper.SKIP, - phone=APIHelper.SKIP, - logo_url=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceSeller class""" - + def __init__( + self, + name=APIHelper.SKIP, + address=APIHelper.SKIP, + phone=APIHelper.SKIP, + logo_url=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceSeller instance.""" # Initialize members of the class if name is not APIHelper.SKIP: - self.name = name + self.name = name if address is not APIHelper.SKIP: - self.address = address + self.address = address if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone if logo_url is not APIHelper.SKIP: - self.logo_url = logo_url + self.logo_url = logo_url # Add additional model properties to the instance if additional_properties is None: @@ -72,7 +71,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -83,17 +82,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - address = InvoiceAddress.from_dictionary(dictionary.get('address')) if 'address' in dictionary.keys() else APIHelper.SKIP - phone = dictionary.get("phone") if dictionary.get("phone") else APIHelper.SKIP - logo_url = dictionary.get("logo_url") if "logo_url" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + address =\ + InvoiceAddress.from_dictionary( + dictionary.get("address"))\ + if "address" in dictionary.keys()\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if dictionary.get("phone")\ + else APIHelper.SKIP + logo_url =\ + dictionary.get("logo_url")\ + if "logo_url" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, address, @@ -103,7 +117,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -114,7 +128,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -124,17 +137,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'logo_url={(self.logo_url if hasattr(self, "logo_url") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _logo_url=( + self.logo_url + if hasattr(self, "logo_url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"address={_address!r}, " + f"phone={_phone!r}, " + f"logo_url={_logo_url!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'logo_url={(self.logo_url if hasattr(self, "logo_url") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _logo_url=( + self.logo_url + if hasattr(self, "logo_url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"address={_address!s}, " + f"phone={_phone!s}, " + f"logo_url={_logo_url!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_sort_field.py b/advancedbilling/models/invoice_sort_field.py index 0f049138..86ce9da9 100644 --- a/advancedbilling/models/invoice_sort_field.py +++ b/advancedbilling/models/invoice_sort_field.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceSortField(object): - """Implementation of the 'Invoice Sort Field' enum. Attributes: @@ -21,28 +18,30 @@ class InvoiceSortField(object): ISSUE_DATE: The enum member of type str. DUE_DATE: The enum member of type str. NUMBER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - STATUS = 'status' - TOTAL_AMOUNT = 'total_amount' + STATUS = "status" + + TOTAL_AMOUNT = "total_amount" - DUE_AMOUNT = 'due_amount' + DUE_AMOUNT = "due_amount" - CREATED_AT = 'created_at' + CREATED_AT = "created_at" - UPDATED_AT = 'updated_at' + UPDATED_AT = "updated_at" - ISSUE_DATE = 'issue_date' + ISSUE_DATE = "issue_date" - DUE_DATE = 'due_date' + DUE_DATE = "due_date" - NUMBER = 'number' + NUMBER = "number" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_status.py b/advancedbilling/models/invoice_status.py index 38c5a6fd..8ed955b8 100644 --- a/advancedbilling/models/invoice_status.py +++ b/advancedbilling/models/invoice_status.py @@ -1,20 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class InvoiceStatus(object): - """Implementation of the 'Invoice Status' enum. The current status of the invoice. See [Invoice - Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanc - ed-Billing-Invoices-Overview#invoice-statuses) for more. + Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Bill + ing-Invoices-Overview#invoice-statuses) for more. Attributes: DRAFT: The enum member of type str. @@ -24,28 +21,30 @@ class InvoiceStatus(object): VOIDED: The enum member of type str. CANCELED: The enum member of type str. PROCESSING: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['draft', 'open', 'paid', 'pending', 'voided', 'canceled', 'processing'] - DRAFT = 'draft' - OPEN = 'open' + _all_values = ["draft", "open", "paid", "pending", "voided", "canceled", + "processing"] + DRAFT = "draft" - PAID = 'paid' + OPEN = "open" - PENDING = 'pending' + PAID = "paid" - VOIDED = 'voided' + PENDING = "pending" - CANCELED = 'canceled' + VOIDED = "voided" - PROCESSING = 'processing' + CANCELED = "canceled" + + PROCESSING = "processing" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -55,9 +54,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/invoice_tax.py b/advancedbilling/models/invoice_tax.py index 42bcadc1..935aeb1a 100644 --- a/advancedbilling/models/invoice_tax.py +++ b/advancedbilling/models/invoice_tax.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_tax_breakout import InvoiceTaxBreakout -from advancedbilling.models.invoice_tax_component_breakout import InvoiceTaxComponentBreakout +from advancedbilling.models.invoice_tax_breakout import ( + InvoiceTaxBreakout, +) +from advancedbilling.models.invoice_tax_component_breakout import ( + InvoiceTaxComponentBreakout, +) class InvoiceTax(object): - """Implementation of the 'Invoice Tax' model. Attributes: @@ -26,104 +28,104 @@ class InvoiceTax(object): taxable_amount (str): The model property of type str. tax_amount (str): The model property of type str. transaction_id (int): The model property of type int. - line_item_breakouts (List[InvoiceTaxBreakout]): The model property of - type List[InvoiceTaxBreakout]. + line_item_breakouts (List[InvoiceTaxBreakout]): The model property of type + List[InvoiceTaxBreakout]. tax_component_breakouts (List[InvoiceTaxComponentBreakout]): The model property of type List[InvoiceTaxComponentBreakout]. eu_vat (bool): The model property of type bool. mtype (str): The model property of type str. tax_exempt_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "title": 'title', - "description": 'description', - "source_type": 'source_type', - "source_id": 'source_id', - "percentage": 'percentage', - "taxable_amount": 'taxable_amount', - "tax_amount": 'tax_amount', - "transaction_id": 'transaction_id', - "line_item_breakouts": 'line_item_breakouts', - "tax_component_breakouts": 'tax_component_breakouts', - "eu_vat": 'eu_vat', - "mtype": 'type', - "tax_exempt_amount": 'tax_exempt_amount' + "uid": "uid", + "title": "title", + "description": "description", + "source_type": "source_type", + "source_id": "source_id", + "percentage": "percentage", + "taxable_amount": "taxable_amount", + "tax_amount": "tax_amount", + "transaction_id": "transaction_id", + "line_item_breakouts": "line_item_breakouts", + "tax_component_breakouts": "tax_component_breakouts", + "eu_vat": "eu_vat", + "mtype": "type", + "tax_exempt_amount": "tax_exempt_amount", } _optionals = [ - 'uid', - 'title', - 'description', - 'source_type', - 'source_id', - 'percentage', - 'taxable_amount', - 'tax_amount', - 'transaction_id', - 'line_item_breakouts', - 'tax_component_breakouts', - 'eu_vat', - 'mtype', - 'tax_exempt_amount', + "uid", + "title", + "description", + "source_type", + "source_id", + "percentage", + "taxable_amount", + "tax_amount", + "transaction_id", + "line_item_breakouts", + "tax_component_breakouts", + "eu_vat", + "mtype", + "tax_exempt_amount", ] _nullables = [ - 'description', + "description", ] - def __init__(self, - uid=APIHelper.SKIP, - title=APIHelper.SKIP, - description=APIHelper.SKIP, - source_type=APIHelper.SKIP, - source_id=APIHelper.SKIP, - percentage=APIHelper.SKIP, - taxable_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - transaction_id=APIHelper.SKIP, - line_item_breakouts=APIHelper.SKIP, - tax_component_breakouts=APIHelper.SKIP, - eu_vat=APIHelper.SKIP, - mtype=APIHelper.SKIP, - tax_exempt_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceTax class""" - + def __init__( + self, + uid=APIHelper.SKIP, + title=APIHelper.SKIP, + description=APIHelper.SKIP, + source_type=APIHelper.SKIP, + source_id=APIHelper.SKIP, + percentage=APIHelper.SKIP, + taxable_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + transaction_id=APIHelper.SKIP, + line_item_breakouts=APIHelper.SKIP, + tax_component_breakouts=APIHelper.SKIP, + eu_vat=APIHelper.SKIP, + mtype=APIHelper.SKIP, + tax_exempt_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceTax instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if title is not APIHelper.SKIP: - self.title = title + self.title = title if description is not APIHelper.SKIP: - self.description = description + self.description = description if source_type is not APIHelper.SKIP: - self.source_type = source_type + self.source_type = source_type if source_id is not APIHelper.SKIP: - self.source_id = source_id + self.source_id = source_id if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage if taxable_amount is not APIHelper.SKIP: - self.taxable_amount = taxable_amount + self.taxable_amount = taxable_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if transaction_id is not APIHelper.SKIP: - self.transaction_id = transaction_id + self.transaction_id = transaction_id if line_item_breakouts is not APIHelper.SKIP: - self.line_item_breakouts = line_item_breakouts + self.line_item_breakouts = line_item_breakouts if tax_component_breakouts is not APIHelper.SKIP: - self.tax_component_breakouts = tax_component_breakouts + self.tax_component_breakouts = tax_component_breakouts if eu_vat is not APIHelper.SKIP: - self.eu_vat = eu_vat + self.eu_vat = eu_vat if mtype is not APIHelper.SKIP: - self.mtype = mtype + self.mtype = mtype if tax_exempt_amount is not APIHelper.SKIP: - self.tax_exempt_amount = tax_exempt_amount + self.tax_exempt_amount = tax_exempt_amount # Add additional model properties to the instance if additional_properties is None: @@ -133,7 +135,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -144,35 +146,79 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - source_type = dictionary.get("source_type") if dictionary.get("source_type") else APIHelper.SKIP - source_id = dictionary.get("source_id") if dictionary.get("source_id") else APIHelper.SKIP - percentage = dictionary.get("percentage") if dictionary.get("percentage") else APIHelper.SKIP - taxable_amount = dictionary.get("taxable_amount") if dictionary.get("taxable_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + source_type =\ + dictionary.get("source_type")\ + if dictionary.get("source_type")\ + else APIHelper.SKIP + source_id =\ + dictionary.get("source_id")\ + if dictionary.get("source_id")\ + else APIHelper.SKIP + percentage =\ + dictionary.get("percentage")\ + if dictionary.get("percentage")\ + else APIHelper.SKIP + taxable_amount =\ + dictionary.get("taxable_amount")\ + if dictionary.get("taxable_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else APIHelper.SKIP line_item_breakouts = None - if dictionary.get('line_item_breakouts') is not None: - line_item_breakouts = [InvoiceTaxBreakout.from_dictionary(x) for x in dictionary.get('line_item_breakouts')] + if dictionary.get("line_item_breakouts") is not None: + line_item_breakouts = [ + InvoiceTaxBreakout.from_dictionary(x) + for x in dictionary.get("line_item_breakouts") + ] else: line_item_breakouts = APIHelper.SKIP tax_component_breakouts = None - if dictionary.get('tax_component_breakouts') is not None: - tax_component_breakouts = [InvoiceTaxComponentBreakout.from_dictionary(x) for x in dictionary.get('tax_component_breakouts')] + if dictionary.get("tax_component_breakouts") is not None: + tax_component_breakouts = [ + InvoiceTaxComponentBreakout.from_dictionary(x) + for x in dictionary.get("tax_component_breakouts") + ] else: tax_component_breakouts = APIHelper.SKIP - eu_vat = dictionary.get("eu_vat") if "eu_vat" in dictionary.keys() else APIHelper.SKIP - mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP - tax_exempt_amount = dictionary.get("tax_exempt_amount") if dictionary.get("tax_exempt_amount") else APIHelper.SKIP + eu_vat =\ + dictionary.get("eu_vat")\ + if "eu_vat" in dictionary.keys()\ + else APIHelper.SKIP + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else APIHelper.SKIP + tax_exempt_amount =\ + dictionary.get("tax_exempt_amount")\ + if dictionary.get("tax_exempt_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, title, @@ -192,7 +238,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -203,7 +249,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -213,37 +258,187 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!r}, ' - f'source_id={(self.source_id if hasattr(self, "source_id") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!r}, ' - f'tax_component_breakouts={(self.tax_component_breakouts if hasattr(self, "tax_component_breakouts") else None)!r}, ' - f'eu_vat={(self.eu_vat if hasattr(self, "eu_vat") else None)!r}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' - f'tax_exempt_amount={(self.tax_exempt_amount if hasattr(self, "tax_exempt_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _source_id=( + self.source_id + if hasattr(self, "source_id") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _tax_component_breakouts=( + self.tax_component_breakouts + if hasattr(self, "tax_component_breakouts") + else None + ) + _eu_vat=( + self.eu_vat + if hasattr(self, "eu_vat") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _tax_exempt_amount=( + self.tax_exempt_amount + if hasattr(self, "tax_exempt_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"title={_title!r}, " + f"description={_description!r}, " + f"source_type={_source_type!r}, " + f"source_id={_source_id!r}, " + f"percentage={_percentage!r}, " + f"taxable_amount={_taxable_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"transaction_id={_transaction_id!r}, " + f"line_item_breakouts={_line_item_breakouts!r}, " + f"tax_component_breakouts={_tax_component_breakouts!r}, " + f"eu_vat={_eu_vat!r}, " + f"mtype={_mtype!r}, " + f"tax_exempt_amount={_tax_exempt_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!s}, ' - f'source_id={(self.source_id if hasattr(self, "source_id") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!s}, ' - f'tax_component_breakouts={(self.tax_component_breakouts if hasattr(self, "tax_component_breakouts") else None)!s}, ' - f'eu_vat={(self.eu_vat if hasattr(self, "eu_vat") else None)!s}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' - f'tax_exempt_amount={(self.tax_exempt_amount if hasattr(self, "tax_exempt_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _source_id=( + self.source_id + if hasattr(self, "source_id") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _tax_component_breakouts=( + self.tax_component_breakouts + if hasattr(self, "tax_component_breakouts") + else None + ) + _eu_vat=( + self.eu_vat + if hasattr(self, "eu_vat") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _tax_exempt_amount=( + self.tax_exempt_amount + if hasattr(self, "tax_exempt_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"title={_title!s}, " + f"description={_description!s}, " + f"source_type={_source_type!s}, " + f"source_id={_source_id!s}, " + f"percentage={_percentage!s}, " + f"taxable_amount={_taxable_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"transaction_id={_transaction_id!s}, " + f"line_item_breakouts={_line_item_breakouts!s}, " + f"tax_component_breakouts={_tax_component_breakouts!s}, " + f"eu_vat={_eu_vat!s}, " + f"mtype={_mtype!s}, " + f"tax_exempt_amount={_tax_exempt_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_tax_breakout.py b/advancedbilling/models/invoice_tax_breakout.py index 8a34ab22..bab6220a 100644 --- a/advancedbilling/models/invoice_tax_breakout.py +++ b/advancedbilling/models/invoice_tax_breakout.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceTaxBreakout(object): - """Implementation of the 'Invoice Tax Breakout' model. Attributes: @@ -18,43 +16,43 @@ class InvoiceTaxBreakout(object): taxable_amount (str): The model property of type str. tax_amount (str): The model property of type str. tax_exempt_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "taxable_amount": 'taxable_amount', - "tax_amount": 'tax_amount', - "tax_exempt_amount": 'tax_exempt_amount' + "uid": "uid", + "taxable_amount": "taxable_amount", + "tax_amount": "tax_amount", + "tax_exempt_amount": "tax_exempt_amount", } _optionals = [ - 'uid', - 'taxable_amount', - 'tax_amount', - 'tax_exempt_amount', + "uid", + "taxable_amount", + "tax_amount", + "tax_exempt_amount", ] - def __init__(self, - uid=APIHelper.SKIP, - taxable_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - tax_exempt_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceTaxBreakout class""" - + def __init__( + self, + uid=APIHelper.SKIP, + taxable_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + tax_exempt_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceTaxBreakout instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if taxable_amount is not APIHelper.SKIP: - self.taxable_amount = taxable_amount + self.taxable_amount = taxable_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if tax_exempt_amount is not APIHelper.SKIP: - self.tax_exempt_amount = tax_exempt_amount + self.tax_exempt_amount = tax_exempt_amount # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - taxable_amount = dictionary.get("taxable_amount") if dictionary.get("taxable_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - tax_exempt_amount = dictionary.get("tax_exempt_amount") if dictionary.get("tax_exempt_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + taxable_amount =\ + dictionary.get("taxable_amount")\ + if dictionary.get("taxable_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + tax_exempt_amount =\ + dictionary.get("tax_exempt_amount")\ + if dictionary.get("tax_exempt_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, taxable_amount, @@ -95,7 +107,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,7 +118,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -116,17 +127,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'tax_exempt_amount={(self.tax_exempt_amount if hasattr(self, "tax_exempt_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _tax_exempt_amount=( + self.tax_exempt_amount + if hasattr(self, "tax_exempt_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"taxable_amount={_taxable_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"tax_exempt_amount={_tax_exempt_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'tax_exempt_amount={(self.tax_exempt_amount if hasattr(self, "tax_exempt_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _tax_exempt_amount=( + self.tax_exempt_amount + if hasattr(self, "tax_exempt_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"taxable_amount={_taxable_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"tax_exempt_amount={_tax_exempt_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/invoice_tax_component_breakout.py b/advancedbilling/models/invoice_tax_component_breakout.py index bd628d16..18230956 100644 --- a/advancedbilling/models/invoice_tax_component_breakout.py +++ b/advancedbilling/models/invoice_tax_component_breakout.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class InvoiceTaxComponentBreakout(object): - """Implementation of the 'Invoice Tax Component Breakout' model. Attributes: @@ -28,93 +26,93 @@ class InvoiceTaxComponentBreakout(object): tax_authority_type (int): The model property of type int. state_assigned_no (str): The model property of type str. tax_sub_type (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "tax_rule_id": 'tax_rule_id', - "percentage": 'percentage', - "country_code": 'country_code', - "subdivision_code": 'subdivision_code', - "tax_amount": 'tax_amount', - "taxable_amount": 'taxable_amount', - "tax_exempt_amount": 'tax_exempt_amount', - "non_taxable_amount": 'non_taxable_amount', - "tax_name": 'tax_name', - "tax_type": 'tax_type', - "rate_type": 'rate_type', - "tax_authority_type": 'tax_authority_type', - "state_assigned_no": 'state_assigned_no', - "tax_sub_type": 'tax_sub_type' + "tax_rule_id": "tax_rule_id", + "percentage": "percentage", + "country_code": "country_code", + "subdivision_code": "subdivision_code", + "tax_amount": "tax_amount", + "taxable_amount": "taxable_amount", + "tax_exempt_amount": "tax_exempt_amount", + "non_taxable_amount": "non_taxable_amount", + "tax_name": "tax_name", + "tax_type": "tax_type", + "rate_type": "rate_type", + "tax_authority_type": "tax_authority_type", + "state_assigned_no": "state_assigned_no", + "tax_sub_type": "tax_sub_type", } _optionals = [ - 'tax_rule_id', - 'percentage', - 'country_code', - 'subdivision_code', - 'tax_amount', - 'taxable_amount', - 'tax_exempt_amount', - 'non_taxable_amount', - 'tax_name', - 'tax_type', - 'rate_type', - 'tax_authority_type', - 'state_assigned_no', - 'tax_sub_type', + "tax_rule_id", + "percentage", + "country_code", + "subdivision_code", + "tax_amount", + "taxable_amount", + "tax_exempt_amount", + "non_taxable_amount", + "tax_name", + "tax_type", + "rate_type", + "tax_authority_type", + "state_assigned_no", + "tax_sub_type", ] - def __init__(self, - tax_rule_id=APIHelper.SKIP, - percentage=APIHelper.SKIP, - country_code=APIHelper.SKIP, - subdivision_code=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - taxable_amount=APIHelper.SKIP, - tax_exempt_amount=APIHelper.SKIP, - non_taxable_amount=APIHelper.SKIP, - tax_name=APIHelper.SKIP, - tax_type=APIHelper.SKIP, - rate_type=APIHelper.SKIP, - tax_authority_type=APIHelper.SKIP, - state_assigned_no=APIHelper.SKIP, - tax_sub_type=APIHelper.SKIP, - additional_properties=None): - """Constructor for the InvoiceTaxComponentBreakout class""" - + def __init__( + self, + tax_rule_id=APIHelper.SKIP, + percentage=APIHelper.SKIP, + country_code=APIHelper.SKIP, + subdivision_code=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + taxable_amount=APIHelper.SKIP, + tax_exempt_amount=APIHelper.SKIP, + non_taxable_amount=APIHelper.SKIP, + tax_name=APIHelper.SKIP, + tax_type=APIHelper.SKIP, + rate_type=APIHelper.SKIP, + tax_authority_type=APIHelper.SKIP, + state_assigned_no=APIHelper.SKIP, + tax_sub_type=APIHelper.SKIP, + additional_properties=None): + """Initialize a InvoiceTaxComponentBreakout instance.""" # Initialize members of the class if tax_rule_id is not APIHelper.SKIP: - self.tax_rule_id = tax_rule_id + self.tax_rule_id = tax_rule_id if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage if country_code is not APIHelper.SKIP: - self.country_code = country_code + self.country_code = country_code if subdivision_code is not APIHelper.SKIP: - self.subdivision_code = subdivision_code + self.subdivision_code = subdivision_code if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if taxable_amount is not APIHelper.SKIP: - self.taxable_amount = taxable_amount + self.taxable_amount = taxable_amount if tax_exempt_amount is not APIHelper.SKIP: - self.tax_exempt_amount = tax_exempt_amount + self.tax_exempt_amount = tax_exempt_amount if non_taxable_amount is not APIHelper.SKIP: - self.non_taxable_amount = non_taxable_amount + self.non_taxable_amount = non_taxable_amount if tax_name is not APIHelper.SKIP: - self.tax_name = tax_name + self.tax_name = tax_name if tax_type is not APIHelper.SKIP: - self.tax_type = tax_type + self.tax_type = tax_type if rate_type is not APIHelper.SKIP: - self.rate_type = rate_type + self.rate_type = rate_type if tax_authority_type is not APIHelper.SKIP: - self.tax_authority_type = tax_authority_type + self.tax_authority_type = tax_authority_type if state_assigned_no is not APIHelper.SKIP: - self.state_assigned_no = state_assigned_no + self.state_assigned_no = state_assigned_no if tax_sub_type is not APIHelper.SKIP: - self.tax_sub_type = tax_sub_type + self.tax_sub_type = tax_sub_type # Add additional model properties to the instance if additional_properties is None: @@ -124,7 +122,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -135,27 +133,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - tax_rule_id = dictionary.get("tax_rule_id") if dictionary.get("tax_rule_id") else APIHelper.SKIP - percentage = dictionary.get("percentage") if dictionary.get("percentage") else APIHelper.SKIP - country_code = dictionary.get("country_code") if dictionary.get("country_code") else APIHelper.SKIP - subdivision_code = dictionary.get("subdivision_code") if dictionary.get("subdivision_code") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - taxable_amount = dictionary.get("taxable_amount") if dictionary.get("taxable_amount") else APIHelper.SKIP - tax_exempt_amount = dictionary.get("tax_exempt_amount") if dictionary.get("tax_exempt_amount") else APIHelper.SKIP - non_taxable_amount = dictionary.get("non_taxable_amount") if dictionary.get("non_taxable_amount") else APIHelper.SKIP - tax_name = dictionary.get("tax_name") if dictionary.get("tax_name") else APIHelper.SKIP - tax_type = dictionary.get("tax_type") if dictionary.get("tax_type") else APIHelper.SKIP - rate_type = dictionary.get("rate_type") if dictionary.get("rate_type") else APIHelper.SKIP - tax_authority_type = dictionary.get("tax_authority_type") if dictionary.get("tax_authority_type") else APIHelper.SKIP - state_assigned_no = dictionary.get("state_assigned_no") if dictionary.get("state_assigned_no") else APIHelper.SKIP - tax_sub_type = dictionary.get("tax_sub_type") if dictionary.get("tax_sub_type") else APIHelper.SKIP + tax_rule_id =\ + dictionary.get("tax_rule_id")\ + if dictionary.get("tax_rule_id")\ + else APIHelper.SKIP + percentage =\ + dictionary.get("percentage")\ + if dictionary.get("percentage")\ + else APIHelper.SKIP + country_code =\ + dictionary.get("country_code")\ + if dictionary.get("country_code")\ + else APIHelper.SKIP + subdivision_code =\ + dictionary.get("subdivision_code")\ + if dictionary.get("subdivision_code")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + taxable_amount =\ + dictionary.get("taxable_amount")\ + if dictionary.get("taxable_amount")\ + else APIHelper.SKIP + tax_exempt_amount =\ + dictionary.get("tax_exempt_amount")\ + if dictionary.get("tax_exempt_amount")\ + else APIHelper.SKIP + non_taxable_amount =\ + dictionary.get("non_taxable_amount")\ + if dictionary.get("non_taxable_amount")\ + else APIHelper.SKIP + tax_name =\ + dictionary.get("tax_name")\ + if dictionary.get("tax_name")\ + else APIHelper.SKIP + tax_type =\ + dictionary.get("tax_type")\ + if dictionary.get("tax_type")\ + else APIHelper.SKIP + rate_type =\ + dictionary.get("rate_type")\ + if dictionary.get("rate_type")\ + else APIHelper.SKIP + tax_authority_type =\ + dictionary.get("tax_authority_type")\ + if dictionary.get("tax_authority_type")\ + else APIHelper.SKIP + state_assigned_no =\ + dictionary.get("state_assigned_no")\ + if dictionary.get("state_assigned_no")\ + else APIHelper.SKIP + tax_sub_type =\ + dictionary.get("tax_sub_type")\ + if dictionary.get("tax_sub_type")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(tax_rule_id, percentage, @@ -175,7 +217,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -186,7 +228,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -196,37 +237,187 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'tax_rule_id={(self.tax_rule_id if hasattr(self, "tax_rule_id") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'country_code={(self.country_code if hasattr(self, "country_code") else None)!r}, ' - f'subdivision_code={(self.subdivision_code if hasattr(self, "subdivision_code") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!r}, ' - f'tax_exempt_amount={(self.tax_exempt_amount if hasattr(self, "tax_exempt_amount") else None)!r}, ' - f'non_taxable_amount={(self.non_taxable_amount if hasattr(self, "non_taxable_amount") else None)!r}, ' - f'tax_name={(self.tax_name if hasattr(self, "tax_name") else None)!r}, ' - f'tax_type={(self.tax_type if hasattr(self, "tax_type") else None)!r}, ' - f'rate_type={(self.rate_type if hasattr(self, "rate_type") else None)!r}, ' - f'tax_authority_type={(self.tax_authority_type if hasattr(self, "tax_authority_type") else None)!r}, ' - f'state_assigned_no={(self.state_assigned_no if hasattr(self, "state_assigned_no") else None)!r}, ' - f'tax_sub_type={(self.tax_sub_type if hasattr(self, "tax_sub_type") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _tax_rule_id=( + self.tax_rule_id + if hasattr(self, "tax_rule_id") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _country_code=( + self.country_code + if hasattr(self, "country_code") + else None + ) + _subdivision_code=( + self.subdivision_code + if hasattr(self, "subdivision_code") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_exempt_amount=( + self.tax_exempt_amount + if hasattr(self, "tax_exempt_amount") + else None + ) + _non_taxable_amount=( + self.non_taxable_amount + if hasattr(self, "non_taxable_amount") + else None + ) + _tax_name=( + self.tax_name + if hasattr(self, "tax_name") + else None + ) + _tax_type=( + self.tax_type + if hasattr(self, "tax_type") + else None + ) + _rate_type=( + self.rate_type + if hasattr(self, "rate_type") + else None + ) + _tax_authority_type=( + self.tax_authority_type + if hasattr(self, "tax_authority_type") + else None + ) + _state_assigned_no=( + self.state_assigned_no + if hasattr(self, "state_assigned_no") + else None + ) + _tax_sub_type=( + self.tax_sub_type + if hasattr(self, "tax_sub_type") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"tax_rule_id={_tax_rule_id!r}, " + f"percentage={_percentage!r}, " + f"country_code={_country_code!r}, " + f"subdivision_code={_subdivision_code!r}, " + f"tax_amount={_tax_amount!r}, " + f"taxable_amount={_taxable_amount!r}, " + f"tax_exempt_amount={_tax_exempt_amount!r}, " + f"non_taxable_amount={_non_taxable_amount!r}, " + f"tax_name={_tax_name!r}, " + f"tax_type={_tax_type!r}, " + f"rate_type={_rate_type!r}, " + f"tax_authority_type={_tax_authority_type!r}, " + f"state_assigned_no={_state_assigned_no!r}, " + f"tax_sub_type={_tax_sub_type!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'tax_rule_id={(self.tax_rule_id if hasattr(self, "tax_rule_id") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'country_code={(self.country_code if hasattr(self, "country_code") else None)!s}, ' - f'subdivision_code={(self.subdivision_code if hasattr(self, "subdivision_code") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!s}, ' - f'tax_exempt_amount={(self.tax_exempt_amount if hasattr(self, "tax_exempt_amount") else None)!s}, ' - f'non_taxable_amount={(self.non_taxable_amount if hasattr(self, "non_taxable_amount") else None)!s}, ' - f'tax_name={(self.tax_name if hasattr(self, "tax_name") else None)!s}, ' - f'tax_type={(self.tax_type if hasattr(self, "tax_type") else None)!s}, ' - f'rate_type={(self.rate_type if hasattr(self, "rate_type") else None)!s}, ' - f'tax_authority_type={(self.tax_authority_type if hasattr(self, "tax_authority_type") else None)!s}, ' - f'state_assigned_no={(self.state_assigned_no if hasattr(self, "state_assigned_no") else None)!s}, ' - f'tax_sub_type={(self.tax_sub_type if hasattr(self, "tax_sub_type") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _tax_rule_id=( + self.tax_rule_id + if hasattr(self, "tax_rule_id") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _country_code=( + self.country_code + if hasattr(self, "country_code") + else None + ) + _subdivision_code=( + self.subdivision_code + if hasattr(self, "subdivision_code") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_exempt_amount=( + self.tax_exempt_amount + if hasattr(self, "tax_exempt_amount") + else None + ) + _non_taxable_amount=( + self.non_taxable_amount + if hasattr(self, "non_taxable_amount") + else None + ) + _tax_name=( + self.tax_name + if hasattr(self, "tax_name") + else None + ) + _tax_type=( + self.tax_type + if hasattr(self, "tax_type") + else None + ) + _rate_type=( + self.rate_type + if hasattr(self, "rate_type") + else None + ) + _tax_authority_type=( + self.tax_authority_type + if hasattr(self, "tax_authority_type") + else None + ) + _state_assigned_no=( + self.state_assigned_no + if hasattr(self, "state_assigned_no") + else None + ) + _tax_sub_type=( + self.tax_sub_type + if hasattr(self, "tax_sub_type") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"tax_rule_id={_tax_rule_id!s}, " + f"percentage={_percentage!s}, " + f"country_code={_country_code!s}, " + f"subdivision_code={_subdivision_code!s}, " + f"tax_amount={_tax_amount!s}, " + f"taxable_amount={_taxable_amount!s}, " + f"tax_exempt_amount={_tax_exempt_amount!s}, " + f"non_taxable_amount={_non_taxable_amount!s}, " + f"tax_name={_tax_name!s}, " + f"tax_type={_tax_type!s}, " + f"rate_type={_rate_type!s}, " + f"tax_authority_type={_tax_authority_type!s}, " + f"state_assigned_no={_state_assigned_no!s}, " + f"tax_sub_type={_tax_sub_type!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/issue_advance_invoice_request.py b/advancedbilling/models/issue_advance_invoice_request.py index f9256911..a99f10b0 100644 --- a/advancedbilling/models/issue_advance_invoice_request.py +++ b/advancedbilling/models/issue_advance_invoice_request.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class IssueAdvanceInvoiceRequest(object): - """Implementation of the 'Issue Advance Invoice Request' model. Attributes: force (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "force": 'force' + "force": "force", } _optionals = [ - 'force', + "force", ] - def __init__(self, - force=APIHelper.SKIP, - additional_properties=None): - """Constructor for the IssueAdvanceInvoiceRequest class""" - + def __init__( + self, + force=APIHelper.SKIP, + additional_properties=None): + """Initialize a IssueAdvanceInvoiceRequest instance.""" # Initialize members of the class if force is not APIHelper.SKIP: - self.force = force + self.force = force # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - force = dictionary.get("force") if "force" in dictionary.keys() else APIHelper.SKIP + force =\ + dictionary.get("force")\ + if "force" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(force, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'force={(self.force if hasattr(self, "force") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _force=( + self.force + if hasattr(self, "force") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"force={_force!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'force={(self.force if hasattr(self, "force") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _force=( + self.force + if hasattr(self, "force") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"force={_force!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/issue_invoice_event.py b/advancedbilling/models/issue_invoice_event.py index 6ac5a121..992b322c 100644 --- a/advancedbilling/models/issue_invoice_event.py +++ b/advancedbilling/models/issue_invoice_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType -from advancedbilling.models.issue_invoice_event_data import IssueInvoiceEventData +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) +from advancedbilling.models.issue_invoice_event_data import ( + IssueInvoiceEventData, +) class IssueInvoiceEvent(object): - """Implementation of the 'Issue Invoice Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (IssueInvoiceEventData): Example schema for an - `issue_invoice` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (IssueInvoiceEventData): Example schema for an `issue_invoice` + event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='issue_invoice', - event_data=None, - additional_properties=None): - """Constructor for the IssueInvoiceEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="issue_invoice", + event_data=None, + additional_properties=None): + """Initialize a IssueInvoiceEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'issue_invoice' - event_data = IssueInvoiceEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "issue_invoice" + event_data =\ + IssueInvoiceEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: IssueInvoiceEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + IssueInvoiceEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: IssueInvoiceEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + IssueInvoiceEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/issue_invoice_event_data.py b/advancedbilling/models/issue_invoice_event_data.py index afd35a2d..9ed1bb75 100644 --- a/advancedbilling/models/issue_invoice_event_data.py +++ b/advancedbilling/models/issue_invoice_event_data.py @@ -1,75 +1,76 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel -from advancedbilling.models.invoice_status import InvoiceStatus +from advancedbilling.models.invoice_consolidation_level import ( + InvoiceConsolidationLevel, +) +from advancedbilling.models.invoice_status import ( + InvoiceStatus, +) class IssueInvoiceEventData(object): - """Implementation of the 'Issue Invoice Event Data' model. Example schema for an `issue_invoice` event Attributes: - consolidation_level (InvoiceConsolidationLevel): Consolidation level - of the invoice, which is applicable to invoice consolidation. It - will hold one of the following values: * "none": A normal invoice - with no consolidation. * "child": An invoice segment which has - been combined into a consolidated invoice. * "parent": A - consolidated invoice, whose contents are composed of invoice - segments. "Parent" invoices do not have lines of their own, but - they have subtotals and totals which aggregate the member invoice - segments. See also the [invoice consolidation - documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269 - 909389-Invoice-Consolidation). + consolidation_level (InvoiceConsolidationLevel): Consolidation level of the + invoice, which is applicable to invoice consolidation. It will hold one + of the following values: * "none": A normal invoice with no + consolidation. * "child": An invoice segment which has been combined into + a consolidated invoice. * "parent": A consolidated invoice, whose + contents are composed of invoice segments. "Parent" invoices do not have + lines of their own, but they have subtotals and totals which aggregate + the member invoice segments. See also the [invoice consolidation + documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389- + Invoice-Consolidation). from_status (InvoiceStatus): The status of the invoice before event occurrence. See [Invoice - Statuses](https://maxio.zendesk.com/hc/en-us/articles/2425228782964 - 5-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. - to_status (InvoiceStatus): The status of the invoice after event - occurrence. See [Invoice - Statuses](https://maxio.zendesk.com/hc/en-us/articles/2425228782964 - 5-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. + Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advan + ced-Billing-Invoices-Overview#invoice-statuses) for more. + to_status (InvoiceStatus): The status of the invoice after event occurrence. + See [Invoice + Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advan + ced-Billing-Invoices-Overview#invoice-statuses) for more. due_amount (str): Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. total_amount (str): The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "consolidation_level": 'consolidation_level', - "from_status": 'from_status', - "to_status": 'to_status', - "due_amount": 'due_amount', - "total_amount": 'total_amount' + "consolidation_level": "consolidation_level", + "from_status": "from_status", + "to_status": "to_status", + "due_amount": "due_amount", + "total_amount": "total_amount", } - def __init__(self, - consolidation_level=None, - from_status=None, - to_status=None, - due_amount=None, - total_amount=None, - additional_properties=None): - """Constructor for the IssueInvoiceEventData class""" - + def __init__( + self, + consolidation_level=None, + from_status=None, + to_status=None, + due_amount=None, + total_amount=None, + additional_properties=None): + """Initialize a IssueInvoiceEventData instance.""" # Initialize members of the class - self.consolidation_level = consolidation_level - self.from_status = from_status - self.to_status = to_status - self.due_amount = due_amount - self.total_amount = total_amount + self.consolidation_level = consolidation_level + self.from_status = from_status + self.to_status = to_status + self.due_amount = due_amount + self.total_amount = total_amount # Add additional model properties to the instance if additional_properties is None: @@ -79,7 +80,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -90,18 +91,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - consolidation_level = dictionary.get("consolidation_level") if dictionary.get("consolidation_level") else None - from_status = dictionary.get("from_status") if dictionary.get("from_status") else None - to_status = dictionary.get("to_status") if dictionary.get("to_status") else None - due_amount = dictionary.get("due_amount") if dictionary.get("due_amount") else None - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else None + consolidation_level =\ + dictionary.get("consolidation_level")\ + if dictionary.get("consolidation_level")\ + else None + from_status =\ + dictionary.get("from_status")\ + if dictionary.get("from_status")\ + else None + to_status =\ + dictionary.get("to_status")\ + if dictionary.get("to_status")\ + else None + due_amount =\ + dictionary.get("due_amount")\ + if dictionary.get("due_amount")\ + else None + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(consolidation_level, from_status, @@ -112,7 +130,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -123,47 +141,98 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.consolidation_level, - type_callable=lambda value: InvoiceConsolidationLevel.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.from_status, - type_callable=lambda value: InvoiceStatus.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.to_status, - type_callable=lambda value: InvoiceStatus.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.due_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.total_amount, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.consolidation_level, + type_callable=lambda value: + InvoiceConsolidationLevel.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.from_status, + type_callable=lambda value: + InvoiceStatus.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.to_status, + type_callable=lambda value: + InvoiceStatus.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.due_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.total_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('consolidation_level'), - type_callable=lambda value: InvoiceConsolidationLevel.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('from_status'), - type_callable=lambda value: InvoiceStatus.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('to_status'), - type_callable=lambda value: InvoiceStatus.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('due_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('total_amount'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("consolidation_level"), + type_callable=lambda value: + InvoiceConsolidationLevel.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("from_status"), + type_callable=lambda value: + InvoiceStatus.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("to_status"), + type_callable=lambda value: + InvoiceStatus.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("due_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("total_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'consolidation_level={self.consolidation_level!r}, ' - f'from_status={self.from_status!r}, ' - f'to_status={self.to_status!r}, ' - f'due_amount={self.due_amount!r}, ' - f'total_amount={self.total_amount!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _consolidation_level=self.consolidation_level + _from_status=self.from_status + _to_status=self.to_status + _due_amount=self.due_amount + _total_amount=self.total_amount + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"consolidation_level={_consolidation_level!r}, " + f"from_status={_from_status!r}, " + f"to_status={_to_status!r}, " + f"due_amount={_due_amount!r}, " + f"total_amount={_total_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'consolidation_level={self.consolidation_level!s}, ' - f'from_status={self.from_status!s}, ' - f'to_status={self.to_status!s}, ' - f'due_amount={self.due_amount!s}, ' - f'total_amount={self.total_amount!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _consolidation_level=self.consolidation_level + _from_status=self.from_status + _to_status=self.to_status + _due_amount=self.due_amount + _total_amount=self.total_amount + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"consolidation_level={_consolidation_level!s}, " + f"from_status={_from_status!s}, " + f"to_status={_to_status!s}, " + f"due_amount={_due_amount!s}, " + f"total_amount={_total_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/issue_invoice_request.py b/advancedbilling/models/issue_invoice_request.py index dedc3804..ab4dcee0 100644 --- a/advancedbilling/models/issue_invoice_request.py +++ b/advancedbilling/models/issue_invoice_request.py @@ -1,54 +1,47 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper - +# ruff: noqa: E501 class IssueInvoiceRequest(object): - """Implementation of the 'Issue Invoice Request' model. Attributes: - on_failed_payment (FailedPaymentAction): Action taken when payment for - an invoice fails: - `leave_open_invoice` - prepayments and credits - applied to invoice; invoice status set to "open"; email sent to - the customer for the issued invoice (if setting applies); payment - failure recorded in the invoice history. This is the default - option. - `rollback_to_pending` - prepayments and credits not - applied; invoice remains in "pending" status; no email sent to the - customer; payment failure recorded in the invoice history. - - `initiate_dunning` - prepayments and credits applied to the - invoice; invoice status set to "open"; email sent to the customer - for the issued invoice (if setting applies); payment failure - recorded in the invoice history; subscription will most likely go - into "past_due" or "canceled" state (depending upon net terms and - dunning settings). - additional_properties (Dict[str, object]): The additional properties - for the model. + on_failed_payment (FailedPaymentAction): Action taken when payment for an + invoice fails: - `leave_open_invoice` - prepayments and credits applied + to invoice; invoice status set to "open"; email sent to the customer for + the issued invoice (if setting applies); payment failure recorded in the + invoice history. This is the default option. - `rollback_to_pending` - + prepayments and credits not applied; invoice remains in "pending" status; + no email sent to the customer; payment failure recorded in the invoice + history. - `initiate_dunning` - prepayments and credits applied to the + invoice; invoice status set to "open"; email sent to the customer for the + issued invoice (if setting applies); payment failure recorded in the + invoice history; subscription will most likely go into "past_due" or + "canceled" state (depending upon net terms and dunning settings). + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "on_failed_payment": 'on_failed_payment' + "on_failed_payment": "on_failed_payment", } _optionals = [ - 'on_failed_payment', + "on_failed_payment", ] - def __init__(self, - on_failed_payment='leave_open_invoice', - additional_properties=None): - """Constructor for the IssueInvoiceRequest class""" - + def __init__( + self, + on_failed_payment="leave_open_invoice", + additional_properties=None): + """Initialize a IssueInvoiceRequest instance.""" # Initialize members of the class - self.on_failed_payment = on_failed_payment + self.on_failed_payment = on_failed_payment # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +51,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,24 +62,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - on_failed_payment = dictionary.get("on_failed_payment") if dictionary.get("on_failed_payment") else 'leave_open_invoice' + on_failed_payment =\ + dictionary.get("on_failed_payment")\ + if dictionary.get("on_failed_payment")\ + else "leave_open_invoice" + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(on_failed_payment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'on_failed_payment={(self.on_failed_payment if hasattr(self, "on_failed_payment") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _on_failed_payment=( + self.on_failed_payment + if hasattr(self, "on_failed_payment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"on_failed_payment={_on_failed_payment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'on_failed_payment={(self.on_failed_payment if hasattr(self, "on_failed_payment") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _on_failed_payment=( + self.on_failed_payment + if hasattr(self, "on_failed_payment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"on_failed_payment={_on_failed_payment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/issue_service_credit.py b/advancedbilling/models/issue_service_credit.py index 1cb4f9d5..cbd030a9 100644 --- a/advancedbilling/models/issue_service_credit.py +++ b/advancedbilling/models/issue_service_credit.py @@ -1,46 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class IssueServiceCredit(object): - """Implementation of the 'Issue Service Credit' model. Attributes: amount (float | str): The model property of type float | str. memo (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "memo": 'memo' + "amount": "amount", + "memo": "memo", } _optionals = [ - 'memo', + "memo", ] - def __init__(self, - amount=None, - memo=APIHelper.SKIP, - additional_properties=None): - """Constructor for the IssueServiceCredit class""" - + def __init__( + self, + amount=None, + memo=APIHelper.SKIP, + additional_properties=None): + """Initialize a IssueServiceCredit instance.""" # Initialize members of the class - self.amount = amount + self.amount = amount if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo # Add additional model properties to the instance if additional_properties is None: @@ -50,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -61,16 +59,29 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = APIHelper.deserialize_union_type(UnionTypeLookUp.get('IssueServiceCreditAmount'), dictionary.get('amount'), False) if dictionary.get('amount') is not None else None - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP + amount = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("IssueServiceCreditAmount"), + dictionary.get("amount"), + False)\ + if dictionary.get("amount") is not None\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, memo, @@ -78,7 +89,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -89,24 +100,50 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('IssueServiceCreditAmount').validate(dictionary.amount).is_valid + return (UnionTypeLookUp.get("IssueServiceCreditAmount") + .validate(dictionary.amount).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('IssueServiceCreditAmount').validate(dictionary.get('amount')).is_valid + return (UnionTypeLookUp.get("IssueServiceCreditAmount") + .validate(dictionary.get("amount")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=self.amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"memo={_memo!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=self.amount + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"memo={_memo!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/issue_service_credit_request.py b/advancedbilling/models/issue_service_credit_request.py index 5b11032b..bf53ef1e 100644 --- a/advancedbilling/models/issue_service_credit_request.py +++ b/advancedbilling/models/issue_service_credit_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.issue_service_credit import IssueServiceCredit +# ruff: noqa: E501 +from advancedbilling.models.issue_service_credit import ( + IssueServiceCredit, +) -class IssueServiceCreditRequest(object): +class IssueServiceCreditRequest(object): """Implementation of the 'Issue Service Credit Request' model. Attributes: service_credit (IssueServiceCredit): The model property of type IssueServiceCredit. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "service_credit": 'service_credit' + "service_credit": "service_credit", } - def __init__(self, - service_credit=None, - additional_properties=None): - """Constructor for the IssueServiceCreditRequest class""" - + def __init__( + self, + service_credit=None, + additional_properties=None): + """Initialize a IssueServiceCreditRequest instance.""" # Initialize members of the class - self.service_credit = service_credit + self.service_credit = service_credit # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - service_credit = IssueServiceCredit.from_dictionary(dictionary.get('service_credit')) if dictionary.get('service_credit') else None + service_credit =\ + IssueServiceCredit.from_dictionary( + dictionary.get("service_credit"))\ + if dictionary.get("service_credit") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(service_credit, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'service_credit={self.service_credit!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _service_credit=self.service_credit + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"service_credit={_service_credit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'service_credit={self.service_credit!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _service_credit=self.service_credit + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"service_credit={_service_credit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/item_category.py b/advancedbilling/models/item_category.py index 61e77d80..b6e90661 100644 --- a/advancedbilling/models/item_category.py +++ b/advancedbilling/models/item_category.py @@ -1,19 +1,16 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ItemCategory(object): - """Implementation of the 'Item Category' enum. - One of the following: Business Software, Consumer Software, Digital - Services, Physical Goods, Other + One of the following: Business Software, Consumer Software, Digital Services, + Physical Goods, Other Attributes: ENUM_BUSINESS SOFTWARE: The enum member of type str. @@ -21,22 +18,24 @@ class ItemCategory(object): ENUM_DIGITAL SERVICES: The enum member of type str. ENUM_PHYSICAL GOODS: The enum member of type str. OTHER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - ENUM_BUSINESS_SOFTWARE = 'Business Software' - ENUM_CONSUMER_SOFTWARE = 'Consumer Software' + ENUM_BUSINESS_SOFTWARE = "Business Software" + + ENUM_CONSUMER_SOFTWARE = "Consumer Software" - ENUM_DIGITAL_SERVICES = 'Digital Services' + ENUM_DIGITAL_SERVICES = "Digital Services" - ENUM_PHYSICAL_GOODS = 'Physical Goods' + ENUM_PHYSICAL_GOODS = "Physical Goods" - OTHER = 'Other' + OTHER = "Other" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/item_price_point_changed.py b/advancedbilling/models/item_price_point_changed.py index 46320086..970d4901 100644 --- a/advancedbilling/models/item_price_point_changed.py +++ b/advancedbilling/models/item_price_point_changed.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.item_price_point_data import ItemPricePointData +from advancedbilling.models.item_price_point_data import ( + ItemPricePointData, +) class ItemPricePointChanged(object): - """Implementation of the 'Item Price Point Changed' model. Attributes: @@ -23,38 +23,38 @@ class ItemPricePointChanged(object): ItemPricePointData. current_price_point (ItemPricePointData): The model property of type ItemPricePointData. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "item_id": 'item_id', - "item_type": 'item_type', - "item_handle": 'item_handle', - "item_name": 'item_name', - "previous_price_point": 'previous_price_point', - "current_price_point": 'current_price_point' + "item_id": "item_id", + "item_type": "item_type", + "item_handle": "item_handle", + "item_name": "item_name", + "previous_price_point": "previous_price_point", + "current_price_point": "current_price_point", } - def __init__(self, - item_id=None, - item_type=None, - item_handle=None, - item_name=None, - previous_price_point=None, - current_price_point=None, - additional_properties=None): - """Constructor for the ItemPricePointChanged class""" - + def __init__( + self, + item_id=None, + item_type=None, + item_handle=None, + item_name=None, + previous_price_point=None, + current_price_point=None, + additional_properties=None): + """Initialize a ItemPricePointChanged instance.""" # Initialize members of the class - self.item_id = item_id - self.item_type = item_type - self.item_handle = item_handle - self.item_name = item_name - self.previous_price_point = previous_price_point - self.current_price_point = current_price_point + self.item_id = item_id + self.item_type = item_type + self.item_handle = item_handle + self.item_name = item_name + self.previous_price_point = previous_price_point + self.current_price_point = current_price_point # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +64,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,19 +75,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - item_id = dictionary.get("item_id") if dictionary.get("item_id") else None - item_type = dictionary.get("item_type") if dictionary.get("item_type") else None - item_handle = dictionary.get("item_handle") if dictionary.get("item_handle") else None - item_name = dictionary.get("item_name") if dictionary.get("item_name") else None - previous_price_point = ItemPricePointData.from_dictionary(dictionary.get('previous_price_point')) if dictionary.get('previous_price_point') else None - current_price_point = ItemPricePointData.from_dictionary(dictionary.get('current_price_point')) if dictionary.get('current_price_point') else None + item_id =\ + dictionary.get("item_id")\ + if dictionary.get("item_id")\ + else None + item_type =\ + dictionary.get("item_type")\ + if dictionary.get("item_type")\ + else None + item_handle =\ + dictionary.get("item_handle")\ + if dictionary.get("item_handle")\ + else None + item_name =\ + dictionary.get("item_name")\ + if dictionary.get("item_name")\ + else None + previous_price_point =\ + ItemPricePointData.from_dictionary( + dictionary.get("previous_price_point"))\ + if dictionary.get("previous_price_point") else None + current_price_point =\ + ItemPricePointData.from_dictionary( + dictionary.get("current_price_point"))\ + if dictionary.get("current_price_point") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(item_id, item_type, @@ -99,7 +119,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -110,57 +130,126 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.item_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.item_type, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.item_handle, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.item_name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.previous_price_point, - type_callable=lambda value: ItemPricePointData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.current_price_point, - type_callable=lambda value: ItemPricePointData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.item_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.item_type, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.item_handle, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.item_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.previous_price_point, + type_callable=lambda value: + ItemPricePointData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.current_price_point, + type_callable=lambda value: + ItemPricePointData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('item_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('item_type'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('item_handle'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('item_name'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('previous_price_point'), - type_callable=lambda value: ItemPricePointData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('current_price_point'), - type_callable=lambda value: ItemPricePointData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("item_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("item_type"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("item_handle"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("item_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("previous_price_point"), + type_callable=lambda value: + ItemPricePointData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("current_price_point"), + type_callable=lambda value: + ItemPricePointData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'item_id={self.item_id!r}, ' - f'item_type={self.item_type!r}, ' - f'item_handle={self.item_handle!r}, ' - f'item_name={self.item_name!r}, ' - f'previous_price_point={self.previous_price_point!r}, ' - f'current_price_point={self.current_price_point!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _item_id=self.item_id + _item_type=self.item_type + _item_handle=self.item_handle + _item_name=self.item_name + _previous_price_point=self.previous_price_point + _current_price_point=self.current_price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"item_id={_item_id!r}, " + f"item_type={_item_type!r}, " + f"item_handle={_item_handle!r}, " + f"item_name={_item_name!r}, " + f"previous_price_point={_previous_price_point!r}, " + f"current_price_point={_current_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'item_id={self.item_id!s}, ' - f'item_type={self.item_type!s}, ' - f'item_handle={self.item_handle!s}, ' - f'item_name={self.item_name!s}, ' - f'previous_price_point={self.previous_price_point!s}, ' - f'current_price_point={self.current_price_point!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _item_id=self.item_id + _item_type=self.item_type + _item_handle=self.item_handle + _item_name=self.item_name + _previous_price_point=self.previous_price_point + _current_price_point=self.current_price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"item_id={_item_id!s}, " + f"item_type={_item_type!s}, " + f"item_handle={_item_handle!s}, " + f"item_name={_item_name!s}, " + f"previous_price_point={_previous_price_point!s}, " + f"current_price_point={_current_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/item_price_point_data.py b/advancedbilling/models/item_price_point_data.py index 3dddb453..3af3c03e 100644 --- a/advancedbilling/models/item_price_point_data.py +++ b/advancedbilling/models/item_price_point_data.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ItemPricePointData(object): - """Implementation of the 'Item Price Point Data' model. Attributes: id (int): The model property of type int. handle (str): The model property of type str. name (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "handle": 'handle', - "name": 'name' + "id": "id", + "handle": "handle", + "name": "name", } _optionals = [ - 'id', - 'handle', - 'name', + "id", + "handle", + "name", ] - def __init__(self, - id=APIHelper.SKIP, - handle=APIHelper.SKIP, - name=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ItemPricePointData class""" - + def __init__( + self, + id=APIHelper.SKIP, + handle=APIHelper.SKIP, + name=APIHelper.SKIP, + additional_properties=None): + """Initialize a ItemPricePointData instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if name is not APIHelper.SKIP: - self.name = name + self.name = name # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, handle, @@ -87,7 +96,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -98,7 +107,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -108,15 +116,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"handle={_handle!r}, " + f"name={_name!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"handle={_handle!s}, " + f"name={_name!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/line_item_kind.py b/advancedbilling/models/line_item_kind.py index 1d71d6b2..13c16145 100644 --- a/advancedbilling/models/line_item_kind.py +++ b/advancedbilling/models/line_item_kind.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class LineItemKind(object): - """Implementation of the 'Line Item Kind' enum. A handle for the line item kind @@ -25,32 +22,34 @@ class LineItemKind(object): EVENT_BASED_COMPONENT: The enum member of type str. COUPON: The enum member of type str. TAX: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - BASELINE = 'baseline' - INITIAL = 'initial' + BASELINE = "baseline" + + INITIAL = "initial" - TRIAL = 'trial' + TRIAL = "trial" - QUANTITY_BASED_COMPONENT = 'quantity_based_component' + QUANTITY_BASED_COMPONENT = "quantity_based_component" - PREPAID_USAGE_COMPONENT = 'prepaid_usage_component' + PREPAID_USAGE_COMPONENT = "prepaid_usage_component" - ON_OFF_COMPONENT = 'on_off_component' + ON_OFF_COMPONENT = "on_off_component" - METERED_COMPONENT = 'metered_component' + METERED_COMPONENT = "metered_component" - EVENT_BASED_COMPONENT = 'event_based_component' + EVENT_BASED_COMPONENT = "event_based_component" - COUPON = 'coupon' + COUPON = "coupon" - TAX = 'tax' + TAX = "tax" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/line_item_transaction_type.py b/advancedbilling/models/line_item_transaction_type.py index ce11870c..35a2189c 100644 --- a/advancedbilling/models/line_item_transaction_type.py +++ b/advancedbilling/models/line_item_transaction_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class LineItemTransactionType(object): - """Implementation of the 'Line Item Transaction Type' enum. A handle for the line item transaction type @@ -22,26 +19,28 @@ class LineItemTransactionType(object): REFUND: The enum member of type str. INFO_TRANSACTION: The enum member of type str. PAYMENT_AUTHORIZATION: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CHARGE = 'charge' - CREDIT = 'credit' + CHARGE = "charge" + + CREDIT = "credit" - ADJUSTMENT = 'adjustment' + ADJUSTMENT = "adjustment" - PAYMENT = 'payment' + PAYMENT = "payment" - REFUND = 'refund' + REFUND = "refund" - INFO_TRANSACTION = 'info_transaction' + INFO_TRANSACTION = "info_transaction" - PAYMENT_AUTHORIZATION = 'payment_authorization' + PAYMENT_AUTHORIZATION = "payment_authorization" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_components_filter.py b/advancedbilling/models/list_components_filter.py index a2b91191..d4b7547e 100644 --- a/advancedbilling/models/list_components_filter.py +++ b/advancedbilling/models/list_components_filter.py @@ -1,52 +1,49 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListComponentsFilter(object): - """Implementation of the 'List Components Filter' model. Attributes: ids (List[int]): Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`. - use_site_exchange_rate (bool): Allows fetching components with - matching use_site_exchange_rate based on provided value (refers to - default price point). Use in query - `filter[use_site_exchange_rate]=true`. - additional_properties (Dict[str, object]): The additional properties - for the model. + use_site_exchange_rate (bool): Allows fetching components with matching + use_site_exchange_rate based on provided value (refers to default price + point). Use in query `filter[use_site_exchange_rate]=true`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "ids": 'ids', - "use_site_exchange_rate": 'use_site_exchange_rate' + "ids": "ids", + "use_site_exchange_rate": "use_site_exchange_rate", } _optionals = [ - 'ids', - 'use_site_exchange_rate', + "ids", + "use_site_exchange_rate", ] - def __init__(self, - ids=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListComponentsFilter class""" - + def __init__( + self, + ids=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListComponentsFilter instance.""" # Initialize members of the class if ids is not APIHelper.SKIP: - self.ids = ids + self.ids = ids if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance if additional_properties is None: @@ -56,7 +53,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -67,28 +64,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - ids = dictionary.get("ids") if dictionary.get("ids") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP + ids =\ + dictionary.get("ids")\ + if dictionary.get("ids")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(ids, use_site_exchange_rate, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'ids={(self.ids if hasattr(self, "ids") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ids={_ids!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'ids={(self.ids if hasattr(self, "ids") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ids={_ids!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_components_price_points_include.py b/advancedbilling/models/list_components_price_points_include.py index b3b3a062..4afbbaf3 100644 --- a/advancedbilling/models/list_components_price_points_include.py +++ b/advancedbilling/models/list_components_price_points_include.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ListComponentsPricePointsInclude(object): - """Implementation of the 'List Components Price Points Include' enum. Attributes: CURRENCY_PRICES: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CURRENCY_PRICES = 'currency_prices' + + CURRENCY_PRICES = "currency_prices" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_components_price_points_response.py b/advancedbilling/models/list_components_price_points_response.py index 8b912896..dcad1705 100644 --- a/advancedbilling/models/list_components_price_points_response.py +++ b/advancedbilling/models/list_components_price_points_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.component_price_point import ComponentPricePoint +# ruff: noqa: E501 +from advancedbilling.models.component_price_point import ( + ComponentPricePoint, +) -class ListComponentsPricePointsResponse(object): +class ListComponentsPricePointsResponse(object): """Implementation of the 'List Components Price Points Response' model. Attributes: price_points (List[ComponentPricePoint]): The model property of type List[ComponentPricePoint]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_points": 'price_points' + "price_points": "price_points", } - def __init__(self, - price_points=None, - additional_properties=None): - """Constructor for the ListComponentsPricePointsResponse class""" - + def __init__( + self, + price_points=None, + additional_properties=None): + """Initialize a ListComponentsPricePointsResponse instance.""" # Initialize members of the class - self.price_points = price_points + self.price_points = price_points # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary price_points = None - if dictionary.get('price_points') is not None: - price_points = [ComponentPricePoint.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ComponentPricePoint.from_dictionary(x) + for x in dictionary.get("price_points") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_points, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_coupons_filter.py b/advancedbilling/models/list_coupons_filter.py index 15b58ecf..35c8bea3 100644 --- a/advancedbilling/models/list_coupons_filter.py +++ b/advancedbilling/models/list_coupons_filter.py @@ -1,120 +1,121 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class ListCouponsFilter(object): - """Implementation of the 'List Coupons Filter' model. Attributes: - date_field (BasicDateField): The type of filter you would like to - apply to your search. Use in query `filter[date_field]=created_at`. - start_date (date): The start date (format YYYY-MM-DD) with which to - filter the date_field. Returns coupons with a timestamp at or - after midnight (12:00:00 AM) in your site’s time zone on the date - specified. Use in query `filter[start_date]=2011-12-17`. - end_date (date): The end date (format YYYY-MM-DD) with which to filter - the date_field. Returns coupons with a timestamp up to and - including 11:59:59PM in your site’s time zone on the date - specified. Use in query `filter[end_date]=2011-12-15`. + date_field (BasicDateField): The type of filter you would like to apply to + your search. Use in query `filter[date_field]=created_at`. + start_date (date): The start date (format YYYY-MM-DD) with which to filter + the date_field. Returns coupons with a timestamp at or after midnight + (12:00:00 AM) in your site’s time zone on the date specified. Use in + query `filter[start_date]=2011-12-17`. + end_date (date): The end date (format YYYY-MM-DD) with which to filter the + date_field. Returns coupons with a timestamp up to and including + 11:59:59PM in your site’s time zone on the date specified. Use in query + `filter[end_date]=2011-12-15`. start_datetime (datetime): The start date and time (format YYYY-MM-DD - HH:MM:SS) with which to filter the date_field. Returns coupons - with a timestamp at or after exact time provided in query. You can - specify timezone in query - otherwise your site's time zone will - be used. If provided, this parameter will be used instead of - start_date. Use in query + HH:MM:SS) with which to filter the date_field. Returns coupons with a + timestamp at or after exact time provided in query. You can specify + timezone in query - otherwise your site's time zone will be used. If + provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. - end_datetime (datetime): The end date and time (format YYYY-MM-DD - HH:MM:SS) with which to filter the date_field. Returns coupons - with a timestamp at or before exact time provided in query. You - can specify timezone in query - otherwise your site's time zone - will be used. If provided, this parameter will be used instead of - end_date. Use in query + end_datetime (datetime): The end date and time (format YYYY-MM-DD HH:MM:SS) + with which to filter the date_field. Returns coupons with a timestamp at + or before exact time provided in query. You can specify timezone in query + - otherwise your site's time zone will be used. If provided, this + parameter will be used instead of end_date. Use in query `filter[end_datetime]=2011-12-1T10:15:30+01:00`. - ids (List[int]): Allows fetching coupons with matching id based on - provided values. Use in query `filter[ids]=1,2,3`. - codes (List[str]): Allows fetching coupons with matching codes based - on provided values. Use in query `filter[codes]=free,free_trial`. - use_site_exchange_rate (bool): If true, restricts the list to coupons - whose pricing is recalculated from the site’s current exchange - rates, so their currency_prices array contains on-the-fly - conversions rather than stored price records. If false, restricts - the list to coupons that have manually defined amounts for each - currency, ensuring the response includes the saved currency_prices - entries instead of exchange-rate-derived values. Use in query - `filter[use_site_exchange_rate]=true`. + ids (List[int]): Allows fetching coupons with matching id based on provided + values. Use in query `filter[ids]=1,2,3`. + codes (List[str]): Allows fetching coupons with matching codes based on + provided values. Use in query `filter[codes]=free,free_trial`. + use_site_exchange_rate (bool): If true, restricts the list to coupons whose + pricing is recalculated from the site’s current exchange rates, so their + currency_prices array contains on-the-fly conversions rather than stored + price records. If false, restricts the list to coupons that have manually + defined amounts for each currency, ensuring the response includes the + saved currency_prices entries instead of exchange-rate-derived values. + Use in query `filter[use_site_exchange_rate]=true`. include_archived (bool): Controls returning archived coupons. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "date_field": 'date_field', - "start_date": 'start_date', - "end_date": 'end_date', - "start_datetime": 'start_datetime', - "end_datetime": 'end_datetime', - "ids": 'ids', - "codes": 'codes', - "use_site_exchange_rate": 'use_site_exchange_rate', - "include_archived": 'include_archived' + "date_field": "date_field", + "start_date": "start_date", + "end_date": "end_date", + "start_datetime": "start_datetime", + "end_datetime": "end_datetime", + "ids": "ids", + "codes": "codes", + "use_site_exchange_rate": "use_site_exchange_rate", + "include_archived": "include_archived", } _optionals = [ - 'date_field', - 'start_date', - 'end_date', - 'start_datetime', - 'end_datetime', - 'ids', - 'codes', - 'use_site_exchange_rate', - 'include_archived', + "date_field", + "start_date", + "end_date", + "start_datetime", + "end_datetime", + "ids", + "codes", + "use_site_exchange_rate", + "include_archived", ] - def __init__(self, - date_field=APIHelper.SKIP, - start_date=APIHelper.SKIP, - end_date=APIHelper.SKIP, - start_datetime=APIHelper.SKIP, - end_datetime=APIHelper.SKIP, - ids=APIHelper.SKIP, - codes=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - include_archived=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListCouponsFilter class""" - + def __init__( + self, + date_field=APIHelper.SKIP, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + start_datetime=APIHelper.SKIP, + end_datetime=APIHelper.SKIP, + ids=APIHelper.SKIP, + codes=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + include_archived=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListCouponsFilter instance.""" # Initialize members of the class if date_field is not APIHelper.SKIP: - self.date_field = date_field + self.date_field = date_field if start_date is not APIHelper.SKIP: - self.start_date = start_date + self.start_date = start_date if end_date is not APIHelper.SKIP: - self.end_date = end_date + self.end_date = end_date if start_datetime is not APIHelper.SKIP: - self.start_datetime = APIHelper.apply_datetime_converter(start_datetime, APIHelper.RFC3339DateTime) if start_datetime else None + self.start_datetime =\ + APIHelper.apply_datetime_converter( + start_datetime, APIHelper.RFC3339DateTime)\ + if start_datetime else None if end_datetime is not APIHelper.SKIP: - self.end_datetime = APIHelper.apply_datetime_converter(end_datetime, APIHelper.RFC3339DateTime) if end_datetime else None + self.end_datetime =\ + APIHelper.apply_datetime_converter( + end_datetime, APIHelper.RFC3339DateTime)\ + if end_datetime else None if ids is not APIHelper.SKIP: - self.ids = ids + self.ids = ids if codes is not APIHelper.SKIP: - self.codes = codes + self.codes = codes if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if include_archived is not APIHelper.SKIP: - self.include_archived = include_archived + self.include_archived = include_archived # Add additional model properties to the instance if additional_properties is None: @@ -124,7 +125,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -135,22 +136,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - date_field = dictionary.get("date_field") if dictionary.get("date_field") else APIHelper.SKIP - start_date = dateutil.parser.parse(dictionary.get('start_date')).date() if dictionary.get('start_date') else APIHelper.SKIP - end_date = dateutil.parser.parse(dictionary.get('end_date')).date() if dictionary.get('end_date') else APIHelper.SKIP - start_datetime = APIHelper.RFC3339DateTime.from_value(dictionary.get("start_datetime")).datetime if dictionary.get("start_datetime") else APIHelper.SKIP - end_datetime = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_datetime")).datetime if dictionary.get("end_datetime") else APIHelper.SKIP - ids = dictionary.get("ids") if dictionary.get("ids") else APIHelper.SKIP - codes = dictionary.get("codes") if dictionary.get("codes") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - include_archived = dictionary.get("include_archived") if "include_archived" in dictionary.keys() else APIHelper.SKIP + date_field =\ + dictionary.get("date_field")\ + if dictionary.get("date_field")\ + else APIHelper.SKIP + start_date = dateutil.parser.parse( + dictionary.get("start_date")).date()\ + if dictionary.get("start_date") else APIHelper.SKIP + end_date = dateutil.parser.parse( + dictionary.get("end_date")).date()\ + if dictionary.get("end_date") else APIHelper.SKIP + start_datetime = APIHelper.RFC3339DateTime.from_value( + dictionary.get("start_datetime")).datetime\ + if dictionary.get("start_datetime") else APIHelper.SKIP + end_datetime = APIHelper.RFC3339DateTime.from_value( + dictionary.get("end_datetime")).datetime\ + if dictionary.get("end_datetime") else APIHelper.SKIP + ids =\ + dictionary.get("ids")\ + if dictionary.get("ids")\ + else APIHelper.SKIP + codes =\ + dictionary.get("codes")\ + if dictionary.get("codes")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + include_archived =\ + dictionary.get("include_archived")\ + if "include_archived" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(date_field, start_date, @@ -164,27 +190,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!r}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'start_datetime={(self.start_datetime if hasattr(self, "start_datetime") else None)!r}, ' - f'end_datetime={(self.end_datetime if hasattr(self, "end_datetime") else None)!r}, ' - f'ids={(self.ids if hasattr(self, "ids") else None)!r}, ' - f'codes={(self.codes if hasattr(self, "codes") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'include_archived={(self.include_archived if hasattr(self, "include_archived") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _start_datetime=( + self.start_datetime + if hasattr(self, "start_datetime") + else None + ) + _end_datetime=( + self.end_datetime + if hasattr(self, "end_datetime") + else None + ) + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _codes=( + self.codes + if hasattr(self, "codes") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _include_archived=( + self.include_archived + if hasattr(self, "include_archived") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"date_field={_date_field!r}, " + f"start_date={_start_date!r}, " + f"end_date={_end_date!r}, " + f"start_datetime={_start_datetime!r}, " + f"end_datetime={_end_datetime!r}, " + f"ids={_ids!r}, " + f"codes={_codes!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"include_archived={_include_archived!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!s}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'start_datetime={(self.start_datetime if hasattr(self, "start_datetime") else None)!s}, ' - f'end_datetime={(self.end_datetime if hasattr(self, "end_datetime") else None)!s}, ' - f'ids={(self.ids if hasattr(self, "ids") else None)!s}, ' - f'codes={(self.codes if hasattr(self, "codes") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'include_archived={(self.include_archived if hasattr(self, "include_archived") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _start_datetime=( + self.start_datetime + if hasattr(self, "start_datetime") + else None + ) + _end_datetime=( + self.end_datetime + if hasattr(self, "end_datetime") + else None + ) + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _codes=( + self.codes + if hasattr(self, "codes") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _include_archived=( + self.include_archived + if hasattr(self, "include_archived") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"date_field={_date_field!s}, " + f"start_date={_start_date!s}, " + f"end_date={_end_date!s}, " + f"start_datetime={_start_datetime!s}, " + f"end_datetime={_end_datetime!s}, " + f"ids={_ids!s}, " + f"codes={_codes!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"include_archived={_include_archived!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_credit_notes_response.py b/advancedbilling/models/list_credit_notes_response.py index aae7153d..828ce5d1 100644 --- a/advancedbilling/models/list_credit_notes_response.py +++ b/advancedbilling/models/list_credit_notes_response.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.credit_note import CreditNote +# ruff: noqa: E501 +from advancedbilling.models.credit_note import ( + CreditNote, +) -class ListCreditNotesResponse(object): +class ListCreditNotesResponse(object): """Implementation of the 'List Credit Notes Response' model. Attributes: - credit_notes (List[CreditNote]): The model property of type - List[CreditNote]. - additional_properties (Dict[str, object]): The additional properties - for the model. + credit_notes (List[CreditNote]): The model property of type List[CreditNote]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "credit_notes": 'credit_notes' + "credit_notes": "credit_notes", } - def __init__(self, - credit_notes=None, - additional_properties=None): - """Constructor for the ListCreditNotesResponse class""" - + def __init__( + self, + credit_notes=None, + additional_properties=None): + """Initialize a ListCreditNotesResponse instance.""" # Initialize members of the class - self.credit_notes = credit_notes + self.credit_notes = credit_notes # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +52,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary credit_notes = None - if dictionary.get('credit_notes') is not None: - credit_notes = [CreditNote.from_dictionary(x) for x in dictionary.get('credit_notes')] + if dictionary.get("credit_notes") is not None: + credit_notes = [ + CreditNote.from_dictionary(x) + for x in dictionary.get("credit_notes") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(credit_notes, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'credit_notes={self.credit_notes!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _credit_notes=self.credit_notes + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_notes={_credit_notes!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'credit_notes={self.credit_notes!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _credit_notes=self.credit_notes + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_notes={_credit_notes!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_events_date_field.py b/advancedbilling/models/list_events_date_field.py index ae627323..43fdd56f 100644 --- a/advancedbilling/models/list_events_date_field.py +++ b/advancedbilling/models/list_events_date_field.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ListEventsDateField(object): - """Implementation of the 'List Events Date Field' enum. Attributes: CREATED_AT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CREATED_AT = 'created_at' + + CREATED_AT = "created_at" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_invoice_events_response.py b/advancedbilling/models/list_invoice_events_response.py index 2e2cc51a..8ee9d9b3 100644 --- a/advancedbilling/models/list_invoice_events_response.py +++ b/advancedbilling/models/list_invoice_events_response.py @@ -1,73 +1,69 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListInvoiceEventsResponse(object): - """Implementation of the 'List Invoice Events Response' model. Attributes: - events (List[ApplyCreditNoteEvent | ApplyDebitNoteEvent | - ApplyPaymentEvent | BackportInvoiceEvent | - ChangeChargebackStatusEvent | ChangeInvoiceCollectionMethodEvent | - ChangeInvoiceStatusEvent | CreateCreditNoteEvent | - CreateDebitNoteEvent | FailedPaymentEvent | IssueInvoiceEvent | - RefundInvoiceEvent | RemovePaymentEvent | VoidInvoiceEvent | - VoidRemainderEvent] | None): The model property of type - List[ApplyCreditNoteEvent | ApplyDebitNoteEvent | - ApplyPaymentEvent | BackportInvoiceEvent | - ChangeChargebackStatusEvent | ChangeInvoiceCollectionMethodEvent | - ChangeInvoiceStatusEvent | CreateCreditNoteEvent | - CreateDebitNoteEvent | FailedPaymentEvent | IssueInvoiceEvent | - RefundInvoiceEvent | RemovePaymentEvent | VoidInvoiceEvent | - VoidRemainderEvent] | None. + events (List[ApplyCreditNoteEvent | ApplyDebitNoteEvent | ApplyPaymentEvent | + BackportInvoiceEvent | ChangeChargebackStatusEvent | + ChangeInvoiceCollectionMethodEvent | ChangeInvoiceStatusEvent | + CreateCreditNoteEvent | CreateDebitNoteEvent | FailedPaymentEvent | + IssueInvoiceEvent | RefundInvoiceEvent | RemovePaymentEvent | + VoidInvoiceEvent | VoidRemainderEvent] | None): The model property of + type List[ApplyCreditNoteEvent | ApplyDebitNoteEvent | ApplyPaymentEvent + | BackportInvoiceEvent | ChangeChargebackStatusEvent | + ChangeInvoiceCollectionMethodEvent | ChangeInvoiceStatusEvent | + CreateCreditNoteEvent | CreateDebitNoteEvent | FailedPaymentEvent | + IssueInvoiceEvent | RefundInvoiceEvent | RemovePaymentEvent | + VoidInvoiceEvent | VoidRemainderEvent] | None. page (int): The model property of type int. per_page (int): The model property of type int. total_pages (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "events": 'events', - "page": 'page', - "per_page": 'per_page', - "total_pages": 'total_pages' + "events": "events", + "page": "page", + "per_page": "per_page", + "total_pages": "total_pages", } _optionals = [ - 'events', - 'page', - 'per_page', - 'total_pages', + "events", + "page", + "per_page", + "total_pages", ] - def __init__(self, - events=APIHelper.SKIP, - page=APIHelper.SKIP, - per_page=APIHelper.SKIP, - total_pages=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListInvoiceEventsResponse class""" - + def __init__( + self, + events=APIHelper.SKIP, + page=APIHelper.SKIP, + per_page=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListInvoiceEventsResponse instance.""" # Initialize members of the class if events is not APIHelper.SKIP: - self.events = events + self.events = events if page is not APIHelper.SKIP: - self.page = page + self.page = page if per_page is not APIHelper.SKIP: - self.per_page = per_page + self.per_page = per_page if total_pages is not APIHelper.SKIP: - self.total_pages = total_pages + self.total_pages = total_pages # Add additional model properties to the instance if additional_properties is None: @@ -77,7 +73,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -88,18 +84,37 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - events = APIHelper.deserialize_union_type(UnionTypeLookUp.get('Invoice-Event'), dictionary.get('events'), False) if dictionary.get('events') is not None else APIHelper.SKIP - page = dictionary.get("page") if dictionary.get("page") else APIHelper.SKIP - per_page = dictionary.get("per_page") if dictionary.get("per_page") else APIHelper.SKIP - total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP + events = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("Invoice-Event"), + dictionary.get("events"), + False)\ + if dictionary.get("events") is not None\ + else APIHelper.SKIP + page =\ + dictionary.get("page")\ + if dictionary.get("page")\ + else APIHelper.SKIP + per_page =\ + dictionary.get("per_page")\ + if dictionary.get("per_page")\ + else APIHelper.SKIP + total_pages =\ + dictionary.get("total_pages")\ + if dictionary.get("total_pages")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(events, page, @@ -108,17 +123,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'events={(self.events if hasattr(self, "events") else None)!r}, ' - f'page={(self.page if hasattr(self, "page") else None)!r}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!r}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _events=( + self.events + if hasattr(self, "events") + else None + ) + _page=( + self.page + if hasattr(self, "page") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"events={_events!r}, " + f"page={_page!r}, " + f"per_page={_per_page!r}, " + f"total_pages={_total_pages!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'events={(self.events if hasattr(self, "events") else None)!s}, ' - f'page={(self.page if hasattr(self, "page") else None)!s}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!s}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _events=( + self.events + if hasattr(self, "events") + else None + ) + _page=( + self.page + if hasattr(self, "page") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"events={_events!s}, " + f"page={_page!s}, " + f"per_page={_per_page!s}, " + f"total_pages={_total_pages!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_invoices_response.py b/advancedbilling/models/list_invoices_response.py index ad3d3cb4..dd3c93e3 100644 --- a/advancedbilling/models/list_invoices_response.py +++ b/advancedbilling/models/list_invoices_response.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.models.invoice import Invoice class ListInvoicesResponse(object): - """Implementation of the 'List Invoices Response' model. Attributes: invoices (List[Invoice]): The model property of type List[Invoice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "invoices": 'invoices' + "invoices": "invoices", } - def __init__(self, - invoices=None, - additional_properties=None): - """Constructor for the ListInvoicesResponse class""" - + def __init__( + self, + invoices=None, + additional_properties=None): + """Initialize a ListInvoicesResponse instance.""" # Initialize members of the class - self.invoices = invoices + self.invoices = invoices # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,26 +50,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary invoices = None - if dictionary.get('invoices') is not None: - invoices = [Invoice.from_dictionary(x) for x in dictionary.get('invoices')] + if dictionary.get("invoices") is not None: + invoices = [ + Invoice.from_dictionary(x) + for x in dictionary.get("invoices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(invoices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoices={self.invoices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _invoices=self.invoices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoices={_invoices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoices={self.invoices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _invoices=self.invoices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoices={_invoices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_metafields_response.py b/advancedbilling/models/list_metafields_response.py index 01cbe6d6..678c62ee 100644 --- a/advancedbilling/models/list_metafields_response.py +++ b/advancedbilling/models/list_metafields_response.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.metafield import Metafield +from advancedbilling.models.metafield import ( + Metafield, +) class ListMetafieldsResponse(object): - """Implementation of the 'List Metafields Response' model. Attributes: @@ -19,50 +19,49 @@ class ListMetafieldsResponse(object): current_page (int): The model property of type int. total_pages (int): The model property of type int. per_page (int): The model property of type int. - metafields (List[Metafield]): The model property of type - List[Metafield]. - additional_properties (Dict[str, object]): The additional properties - for the model. + metafields (List[Metafield]): The model property of type List[Metafield]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "total_count": 'total_count', - "current_page": 'current_page', - "total_pages": 'total_pages', - "per_page": 'per_page', - "metafields": 'metafields' + "total_count": "total_count", + "current_page": "current_page", + "total_pages": "total_pages", + "per_page": "per_page", + "metafields": "metafields", } _optionals = [ - 'total_count', - 'current_page', - 'total_pages', - 'per_page', - 'metafields', + "total_count", + "current_page", + "total_pages", + "per_page", + "metafields", ] - def __init__(self, - total_count=APIHelper.SKIP, - current_page=APIHelper.SKIP, - total_pages=APIHelper.SKIP, - per_page=APIHelper.SKIP, - metafields=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListMetafieldsResponse class""" - + def __init__( + self, + total_count=APIHelper.SKIP, + current_page=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + per_page=APIHelper.SKIP, + metafields=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListMetafieldsResponse instance.""" # Initialize members of the class if total_count is not APIHelper.SKIP: - self.total_count = total_count + self.total_count = total_count if current_page is not APIHelper.SKIP: - self.current_page = current_page + self.current_page = current_page if total_pages is not APIHelper.SKIP: - self.total_pages = total_pages + self.total_pages = total_pages if per_page is not APIHelper.SKIP: - self.per_page = per_page + self.per_page = per_page if metafields is not APIHelper.SKIP: - self.metafields = metafields + self.metafields = metafields # Add additional model properties to the instance if additional_properties is None: @@ -72,7 +71,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -83,22 +82,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - total_count = dictionary.get("total_count") if dictionary.get("total_count") else APIHelper.SKIP - current_page = dictionary.get("current_page") if dictionary.get("current_page") else APIHelper.SKIP - total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP - per_page = dictionary.get("per_page") if dictionary.get("per_page") else APIHelper.SKIP + total_count =\ + dictionary.get("total_count")\ + if dictionary.get("total_count")\ + else APIHelper.SKIP + current_page =\ + dictionary.get("current_page")\ + if dictionary.get("current_page")\ + else APIHelper.SKIP + total_pages =\ + dictionary.get("total_pages")\ + if dictionary.get("total_pages")\ + else APIHelper.SKIP + per_page =\ + dictionary.get("per_page")\ + if dictionary.get("per_page")\ + else APIHelper.SKIP metafields = None - if dictionary.get('metafields') is not None: - metafields = [Metafield.from_dictionary(x) for x in dictionary.get('metafields')] + if dictionary.get("metafields") is not None: + metafields = [ + Metafield.from_dictionary(x) + for x in dictionary.get("metafields") + ] else: metafields = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(total_count, current_page, @@ -108,19 +124,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!r}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!r}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!r}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!r}, " + f"current_page={_current_page!r}, " + f"total_pages={_total_pages!r}, " + f"per_page={_per_page!r}, " + f"metafields={_metafields!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!s}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!s}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!s}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!s}, " + f"current_page={_current_page!s}, " + f"total_pages={_total_pages!s}, " + f"per_page={_per_page!s}, " + f"metafields={_metafields!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_mrr_filter.py b/advancedbilling/models/list_mrr_filter.py index 46a26944..a3f1fc38 100644 --- a/advancedbilling/models/list_mrr_filter.py +++ b/advancedbilling/models/list_mrr_filter.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListMrrFilter(object): - """Implementation of the 'List Mrr Filter' model. Attributes: - subscription_ids (List[int]): Submit ids in order to limit results. - Use in query: `filter[subscription_ids]=1,2,3`. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscription_ids (List[int]): Submit ids in order to limit results. Use in + query: `filter[subscription_ids]=1,2,3`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_ids": 'subscription_ids' + "subscription_ids": "subscription_ids", } _optionals = [ - 'subscription_ids', + "subscription_ids", ] - def __init__(self, - subscription_ids=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListMrrFilter class""" - + def __init__( + self, + subscription_ids=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListMrrFilter instance.""" # Initialize members of the class if subscription_ids is not APIHelper.SKIP: - self.subscription_ids = subscription_ids + self.subscription_ids = subscription_ids # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +56,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_ids = dictionary.get("subscription_ids") if dictionary.get("subscription_ids") else APIHelper.SKIP + subscription_ids =\ + dictionary.get("subscription_ids")\ + if dictionary.get("subscription_ids")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_ids, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_ids={_subscription_ids!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_ids={_subscription_ids!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_mrr_response.py b/advancedbilling/models/list_mrr_response.py index a40991be..6d802050 100644 --- a/advancedbilling/models/list_mrr_response.py +++ b/advancedbilling/models/list_mrr_response.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.list_mrr_response_result import ListMRRResponseResult +# ruff: noqa: E501 +from advancedbilling.models.list_mrr_response_result import ( + ListMRRResponseResult, +) -class ListMRRResponse(object): +class ListMRRResponse(object): """Implementation of the 'List MRR Response' model. Attributes: - mrr (ListMRRResponseResult): The model property of type - ListMRRResponseResult. - additional_properties (Dict[str, object]): The additional properties - for the model. + mrr (ListMRRResponseResult): The model property of type ListMRRResponseResult. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "mrr": 'mrr' + "mrr": "mrr", } - def __init__(self, - mrr=None, - additional_properties=None): - """Constructor for the ListMRRResponse class""" - + def __init__( + self, + mrr=None, + additional_properties=None): + """Initialize a ListMRRResponse instance.""" # Initialize members of the class - self.mrr = mrr + self.mrr = mrr # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - mrr = ListMRRResponseResult.from_dictionary(dictionary.get('mrr')) if dictionary.get('mrr') else None + mrr =\ + ListMRRResponseResult.from_dictionary( + dictionary.get("mrr"))\ + if dictionary.get("mrr") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(mrr, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'mrr={self.mrr!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _mrr=self.mrr + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mrr={_mrr!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'mrr={self.mrr!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _mrr=self.mrr + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mrr={_mrr!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_mrr_response_result.py b/advancedbilling/models/list_mrr_response_result.py index 67f9e150..b3a79962 100644 --- a/advancedbilling/models/list_mrr_response_result.py +++ b/advancedbilling/models/list_mrr_response_result.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.movement import Movement +from advancedbilling.models.movement import ( + Movement, +) class ListMRRResponseResult(object): - """Implementation of the 'List MRR Response Result' model. Attributes: @@ -22,58 +22,58 @@ class ListMRRResponseResult(object): currency (str): The model property of type str. currency_symbol (str): The model property of type str. movements (List[Movement]): The model property of type List[Movement]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "page": 'page', - "per_page": 'per_page', - "total_pages": 'total_pages', - "total_entries": 'total_entries', - "currency": 'currency', - "currency_symbol": 'currency_symbol', - "movements": 'movements' + "page": "page", + "per_page": "per_page", + "total_pages": "total_pages", + "total_entries": "total_entries", + "currency": "currency", + "currency_symbol": "currency_symbol", + "movements": "movements", } _optionals = [ - 'page', - 'per_page', - 'total_pages', - 'total_entries', - 'currency', - 'currency_symbol', - 'movements', + "page", + "per_page", + "total_pages", + "total_entries", + "currency", + "currency_symbol", + "movements", ] - def __init__(self, - page=APIHelper.SKIP, - per_page=APIHelper.SKIP, - total_pages=APIHelper.SKIP, - total_entries=APIHelper.SKIP, - currency=APIHelper.SKIP, - currency_symbol=APIHelper.SKIP, - movements=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListMRRResponseResult class""" - + def __init__( + self, + page=APIHelper.SKIP, + per_page=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + total_entries=APIHelper.SKIP, + currency=APIHelper.SKIP, + currency_symbol=APIHelper.SKIP, + movements=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListMRRResponseResult instance.""" # Initialize members of the class if page is not APIHelper.SKIP: - self.page = page + self.page = page if per_page is not APIHelper.SKIP: - self.per_page = per_page + self.per_page = per_page if total_pages is not APIHelper.SKIP: - self.total_pages = total_pages + self.total_pages = total_pages if total_entries is not APIHelper.SKIP: - self.total_entries = total_entries + self.total_entries = total_entries if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if currency_symbol is not APIHelper.SKIP: - self.currency_symbol = currency_symbol + self.currency_symbol = currency_symbol if movements is not APIHelper.SKIP: - self.movements = movements + self.movements = movements # Add additional model properties to the instance if additional_properties is None: @@ -83,7 +83,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -94,24 +94,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - page = dictionary.get("page") if dictionary.get("page") else APIHelper.SKIP - per_page = dictionary.get("per_page") if dictionary.get("per_page") else APIHelper.SKIP - total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP - total_entries = dictionary.get("total_entries") if dictionary.get("total_entries") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - currency_symbol = dictionary.get("currency_symbol") if dictionary.get("currency_symbol") else APIHelper.SKIP + page =\ + dictionary.get("page")\ + if dictionary.get("page")\ + else APIHelper.SKIP + per_page =\ + dictionary.get("per_page")\ + if dictionary.get("per_page")\ + else APIHelper.SKIP + total_pages =\ + dictionary.get("total_pages")\ + if dictionary.get("total_pages")\ + else APIHelper.SKIP + total_entries =\ + dictionary.get("total_entries")\ + if dictionary.get("total_entries")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + currency_symbol =\ + dictionary.get("currency_symbol")\ + if dictionary.get("currency_symbol")\ + else APIHelper.SKIP movements = None - if dictionary.get('movements') is not None: - movements = [Movement.from_dictionary(x) for x in dictionary.get('movements')] + if dictionary.get("movements") is not None: + movements = [ + Movement.from_dictionary(x) + for x in dictionary.get("movements") + ] else: movements = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(page, per_page, @@ -123,23 +146,103 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'page={(self.page if hasattr(self, "page") else None)!r}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!r}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' - f'total_entries={(self.total_entries if hasattr(self, "total_entries") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'currency_symbol={(self.currency_symbol if hasattr(self, "currency_symbol") else None)!r}, ' - f'movements={(self.movements if hasattr(self, "movements") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _page=( + self.page + if hasattr(self, "page") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _total_entries=( + self.total_entries + if hasattr(self, "total_entries") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _currency_symbol=( + self.currency_symbol + if hasattr(self, "currency_symbol") + else None + ) + _movements=( + self.movements + if hasattr(self, "movements") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"page={_page!r}, " + f"per_page={_per_page!r}, " + f"total_pages={_total_pages!r}, " + f"total_entries={_total_entries!r}, " + f"currency={_currency!r}, " + f"currency_symbol={_currency_symbol!r}, " + f"movements={_movements!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'page={(self.page if hasattr(self, "page") else None)!s}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!s}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' - f'total_entries={(self.total_entries if hasattr(self, "total_entries") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'currency_symbol={(self.currency_symbol if hasattr(self, "currency_symbol") else None)!s}, ' - f'movements={(self.movements if hasattr(self, "movements") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _page=( + self.page + if hasattr(self, "page") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _total_entries=( + self.total_entries + if hasattr(self, "total_entries") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _currency_symbol=( + self.currency_symbol + if hasattr(self, "currency_symbol") + else None + ) + _movements=( + self.movements + if hasattr(self, "movements") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"page={_page!s}, " + f"per_page={_per_page!s}, " + f"total_pages={_total_pages!s}, " + f"total_entries={_total_entries!s}, " + f"currency={_currency!s}, " + f"currency_symbol={_currency_symbol!s}, " + f"movements={_movements!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_offers_response.py b/advancedbilling/models/list_offers_response.py index de928405..9d7d48ba 100644 --- a/advancedbilling/models/list_offers_response.py +++ b/advancedbilling/models/list_offers_response.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.offer import Offer class ListOffersResponse(object): - """Implementation of the 'List Offers Response' model. Attributes: offers (List[Offer]): The model property of type List[Offer]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "offers": 'offers' + "offers": "offers", } _optionals = [ - 'offers', + "offers", ] - def __init__(self, - offers=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListOffersResponse class""" - + def __init__( + self, + offers=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListOffersResponse instance.""" # Initialize members of the class if offers is not APIHelper.SKIP: - self.offers = offers + self.offers = offers # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,28 +56,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary offers = None - if dictionary.get('offers') is not None: - offers = [Offer.from_dictionary(x) for x in dictionary.get('offers')] + if dictionary.get("offers") is not None: + offers = [ + Offer.from_dictionary(x) + for x in dictionary.get("offers") + ] else: offers = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(offers, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'offers={(self.offers if hasattr(self, "offers") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _offers=( + self.offers + if hasattr(self, "offers") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"offers={_offers!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'offers={(self.offers if hasattr(self, "offers") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _offers=( + self.offers + if hasattr(self, "offers") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"offers={_offers!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_prepayment_date_field.py b/advancedbilling/models/list_prepayment_date_field.py index 085f5a5e..5f244c39 100644 --- a/advancedbilling/models/list_prepayment_date_field.py +++ b/advancedbilling/models/list_prepayment_date_field.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ListPrepaymentDateField(object): - """Implementation of the 'List Prepayment Date Field' enum. Attributes: CREATED_AT: The enum member of type str. APPLICATION_AT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CREATED_AT = 'created_at' - APPLICATION_AT = 'application_at' + CREATED_AT = "created_at" + + APPLICATION_AT = "application_at" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_prepayments_filter.py b/advancedbilling/models/list_prepayments_filter.py index 2954519f..b0db5104 100644 --- a/advancedbilling/models/list_prepayments_filter.py +++ b/advancedbilling/models/list_prepayments_filter.py @@ -1,65 +1,63 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class ListPrepaymentsFilter(object): - """Implementation of the 'List Prepayments Filter' model. Attributes: - date_field (ListPrepaymentDateField): The type of filter you would - like to apply to your search. `created_at` - Time when prepayment - was created. `application_at` - Time when prepayment was applied - to invoice. Use in query `filter[date_field]=created_at`. - start_date (date): The start date (format YYYY-MM-DD) with which to - filter the date_field. Returns prepayments with a timestamp at or - after midnight (12:00:00 AM) in your site's time zone on the date - specified. Use in query: `filter[start_date]=2011-12-15`. - end_date (date): The end date (format YYYY-MM-DD) with which to filter - the date_field. Returns prepayments with a timestamp up to and - including 11:59:59PM in your site's time zone on the date - specified. Use in query: `filter[end_date]=2011-12-15`. - additional_properties (Dict[str, object]): The additional properties - for the model. + date_field (ListPrepaymentDateField): The type of filter you would like to + apply to your search. `created_at` - Time when prepayment was created. + `application_at` - Time when prepayment was applied to invoice. Use in + query `filter[date_field]=created_at`. + start_date (date): The start date (format YYYY-MM-DD) with which to filter + the date_field. Returns prepayments with a timestamp at or after midnight + (12:00:00 AM) in your site's time zone on the date specified. Use in + query: `filter[start_date]=2011-12-15`. + end_date (date): The end date (format YYYY-MM-DD) with which to filter the + date_field. Returns prepayments with a timestamp up to and including + 11:59:59PM in your site's time zone on the date specified. Use in query: + `filter[end_date]=2011-12-15`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "date_field": 'date_field', - "start_date": 'start_date', - "end_date": 'end_date' + "date_field": "date_field", + "start_date": "start_date", + "end_date": "end_date", } _optionals = [ - 'date_field', - 'start_date', - 'end_date', + "date_field", + "start_date", + "end_date", ] - def __init__(self, - date_field=APIHelper.SKIP, - start_date=APIHelper.SKIP, - end_date=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListPrepaymentsFilter class""" - + def __init__( + self, + date_field=APIHelper.SKIP, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListPrepaymentsFilter instance.""" # Initialize members of the class if date_field is not APIHelper.SKIP: - self.date_field = date_field + self.date_field = date_field if start_date is not APIHelper.SKIP: - self.start_date = start_date + self.start_date = start_date if end_date is not APIHelper.SKIP: - self.end_date = end_date + self.end_date = end_date # Add additional model properties to the instance if additional_properties is None: @@ -69,7 +67,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -80,16 +78,25 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - date_field = dictionary.get("date_field") if dictionary.get("date_field") else APIHelper.SKIP - start_date = dateutil.parser.parse(dictionary.get('start_date')).date() if dictionary.get('start_date') else APIHelper.SKIP - end_date = dateutil.parser.parse(dictionary.get('end_date')).date() if dictionary.get('end_date') else APIHelper.SKIP + date_field =\ + dictionary.get("date_field")\ + if dictionary.get("date_field")\ + else APIHelper.SKIP + start_date = dateutil.parser.parse( + dictionary.get("start_date")).date()\ + if dictionary.get("start_date") else APIHelper.SKIP + end_date = dateutil.parser.parse( + dictionary.get("end_date")).date()\ + if dictionary.get("end_date") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(date_field, start_date, @@ -97,15 +104,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!r}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"date_field={_date_field!r}, " + f"start_date={_start_date!r}, " + f"end_date={_end_date!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!s}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"date_field={_date_field!s}, " + f"start_date={_start_date!s}, " + f"end_date={_end_date!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_price_points_filter.py b/advancedbilling/models/list_price_points_filter.py index a5467909..470645c8 100644 --- a/advancedbilling/models/list_price_points_filter.py +++ b/advancedbilling/models/list_price_points_filter.py @@ -1,108 +1,107 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class ListPricePointsFilter(object): - """Implementation of the 'List PricePoints Filter' model. Attributes: - date_field (BasicDateField): The type of filter you would like to - apply to your search. Use in query: - `filter[date_field]=created_at`. - start_date (date): The start date (format YYYY-MM-DD) with which to - filter the date_field. Returns price points with a timestamp at or - after midnight (12:00:00 AM) in your site’s time zone on the date - specified. - end_date (date): The end date (format YYYY-MM-DD) with which to filter - the date_field. Returns price points with a timestamp up to and - including 11:59:59PM in your site’s time zone on the date - specified. + date_field (BasicDateField): The type of filter you would like to apply to + your search. Use in query: `filter[date_field]=created_at`. + start_date (date): The start date (format YYYY-MM-DD) with which to filter + the date_field. Returns price points with a timestamp at or after + midnight (12:00:00 AM) in your site’s time zone on the date specified. + end_date (date): The end date (format YYYY-MM-DD) with which to filter the + date_field. Returns price points with a timestamp up to and including + 11:59:59PM in your site’s time zone on the date specified. start_datetime (datetime): The start date and time (format YYYY-MM-DD - HH:MM:SS) with which to filter the date_field. Returns price - points with a timestamp at or after exact time provided in query. - You can specify timezone in query - otherwise your site's time - zone will be used. If provided, this parameter will be used - instead of start_date. - end_datetime (datetime): The end date and time (format YYYY-MM-DD - HH:MM:SS) with which to filter the date_field. Returns price - points with a timestamp at or before exact time provided in query. - You can specify timezone in query - otherwise your site's time - zone will be used. If provided, this parameter will be used - instead of end_date. - mtype (List[PricePointType]): Allows fetching price points with - matching type. Use in query: `filter[type]=custom,catalog`. - ids (List[int]): Allows fetching price points with matching id based - on provided values. Use in query: `filter[ids]=1,2,3`. - archived_at (IncludeNullOrNotNull): Allows fetching price points only - if archived_at is present or not. Use in query: + HH:MM:SS) with which to filter the date_field. Returns price points with + a timestamp at or after exact time provided in query. You can specify + timezone in query - otherwise your site's time zone will be used. If + provided, this parameter will be used instead of start_date. + end_datetime (datetime): The end date and time (format YYYY-MM-DD HH:MM:SS) + with which to filter the date_field. Returns price points with a + timestamp at or before exact time provided in query. You can specify + timezone in query - otherwise your site's time zone will be used. If + provided, this parameter will be used instead of end_date. + mtype (List[PricePointType]): Allows fetching price points with matching + type. Use in query: `filter[type]=custom,catalog`. + ids (List[int]): Allows fetching price points with matching id based on + provided values. Use in query: `filter[ids]=1,2,3`. + archived_at (IncludeNullOrNotNull): Allows fetching price points only if + archived_at is present or not. Use in query: `filter[archived_at]=not_null`. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "date_field": 'date_field', - "start_date": 'start_date', - "end_date": 'end_date', - "start_datetime": 'start_datetime', - "end_datetime": 'end_datetime', - "mtype": 'type', - "ids": 'ids', - "archived_at": 'archived_at' + "date_field": "date_field", + "start_date": "start_date", + "end_date": "end_date", + "start_datetime": "start_datetime", + "end_datetime": "end_datetime", + "mtype": "type", + "ids": "ids", + "archived_at": "archived_at", } _optionals = [ - 'date_field', - 'start_date', - 'end_date', - 'start_datetime', - 'end_datetime', - 'mtype', - 'ids', - 'archived_at', + "date_field", + "start_date", + "end_date", + "start_datetime", + "end_datetime", + "mtype", + "ids", + "archived_at", ] - def __init__(self, - date_field=APIHelper.SKIP, - start_date=APIHelper.SKIP, - end_date=APIHelper.SKIP, - start_datetime=APIHelper.SKIP, - end_datetime=APIHelper.SKIP, - mtype=APIHelper.SKIP, - ids=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListPricePointsFilter class""" - + def __init__( + self, + date_field=APIHelper.SKIP, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + start_datetime=APIHelper.SKIP, + end_datetime=APIHelper.SKIP, + mtype=APIHelper.SKIP, + ids=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListPricePointsFilter instance.""" # Initialize members of the class if date_field is not APIHelper.SKIP: - self.date_field = date_field + self.date_field = date_field if start_date is not APIHelper.SKIP: - self.start_date = start_date + self.start_date = start_date if end_date is not APIHelper.SKIP: - self.end_date = end_date + self.end_date = end_date if start_datetime is not APIHelper.SKIP: - self.start_datetime = APIHelper.apply_datetime_converter(start_datetime, APIHelper.RFC3339DateTime) if start_datetime else None + self.start_datetime =\ + APIHelper.apply_datetime_converter( + start_datetime, APIHelper.RFC3339DateTime)\ + if start_datetime else None if end_datetime is not APIHelper.SKIP: - self.end_datetime = APIHelper.apply_datetime_converter(end_datetime, APIHelper.RFC3339DateTime) if end_datetime else None + self.end_datetime =\ + APIHelper.apply_datetime_converter( + end_datetime, APIHelper.RFC3339DateTime)\ + if end_datetime else None if mtype is not APIHelper.SKIP: - self.mtype = mtype + self.mtype = mtype if ids is not APIHelper.SKIP: - self.ids = ids + self.ids = ids if archived_at is not APIHelper.SKIP: - self.archived_at = archived_at + self.archived_at = archived_at # Add additional model properties to the instance if additional_properties is None: @@ -112,7 +111,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -123,21 +122,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - date_field = dictionary.get("date_field") if dictionary.get("date_field") else APIHelper.SKIP - start_date = dateutil.parser.parse(dictionary.get('start_date')).date() if dictionary.get('start_date') else APIHelper.SKIP - end_date = dateutil.parser.parse(dictionary.get('end_date')).date() if dictionary.get('end_date') else APIHelper.SKIP - start_datetime = APIHelper.RFC3339DateTime.from_value(dictionary.get("start_datetime")).datetime if dictionary.get("start_datetime") else APIHelper.SKIP - end_datetime = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_datetime")).datetime if dictionary.get("end_datetime") else APIHelper.SKIP - mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP - ids = dictionary.get("ids") if dictionary.get("ids") else APIHelper.SKIP - archived_at = dictionary.get("archived_at") if dictionary.get("archived_at") else APIHelper.SKIP + date_field =\ + dictionary.get("date_field")\ + if dictionary.get("date_field")\ + else APIHelper.SKIP + start_date = dateutil.parser.parse( + dictionary.get("start_date")).date()\ + if dictionary.get("start_date") else APIHelper.SKIP + end_date = dateutil.parser.parse( + dictionary.get("end_date")).date()\ + if dictionary.get("end_date") else APIHelper.SKIP + start_datetime = APIHelper.RFC3339DateTime.from_value( + dictionary.get("start_datetime")).datetime\ + if dictionary.get("start_datetime") else APIHelper.SKIP + end_datetime = APIHelper.RFC3339DateTime.from_value( + dictionary.get("end_datetime")).datetime\ + if dictionary.get("end_datetime") else APIHelper.SKIP + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else APIHelper.SKIP + ids =\ + dictionary.get("ids")\ + if dictionary.get("ids")\ + else APIHelper.SKIP + archived_at =\ + dictionary.get("archived_at")\ + if dictionary.get("archived_at")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(date_field, start_date, @@ -150,25 +171,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!r}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'start_datetime={(self.start_datetime if hasattr(self, "start_datetime") else None)!r}, ' - f'end_datetime={(self.end_datetime if hasattr(self, "end_datetime") else None)!r}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' - f'ids={(self.ids if hasattr(self, "ids") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _start_datetime=( + self.start_datetime + if hasattr(self, "start_datetime") + else None + ) + _end_datetime=( + self.end_datetime + if hasattr(self, "end_datetime") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"date_field={_date_field!r}, " + f"start_date={_start_date!r}, " + f"end_date={_end_date!r}, " + f"start_datetime={_start_datetime!r}, " + f"end_datetime={_end_datetime!r}, " + f"mtype={_mtype!r}, " + f"ids={_ids!r}, " + f"archived_at={_archived_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!s}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'start_datetime={(self.start_datetime if hasattr(self, "start_datetime") else None)!s}, ' - f'end_datetime={(self.end_datetime if hasattr(self, "end_datetime") else None)!s}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' - f'ids={(self.ids if hasattr(self, "ids") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _start_datetime=( + self.start_datetime + if hasattr(self, "start_datetime") + else None + ) + _end_datetime=( + self.end_datetime + if hasattr(self, "end_datetime") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"date_field={_date_field!s}, " + f"start_date={_start_date!s}, " + f"end_date={_end_date!s}, " + f"start_datetime={_start_datetime!s}, " + f"end_datetime={_end_datetime!s}, " + f"mtype={_mtype!s}, " + f"ids={_ids!s}, " + f"archived_at={_archived_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_product_price_points_response.py b/advancedbilling/models/list_product_price_points_response.py index 6ff2b240..ddb1e960 100644 --- a/advancedbilling/models/list_product_price_points_response.py +++ b/advancedbilling/models/list_product_price_points_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.product_price_point import ProductPricePoint +# ruff: noqa: E501 +from advancedbilling.models.product_price_point import ( + ProductPricePoint, +) -class ListProductPricePointsResponse(object): +class ListProductPricePointsResponse(object): """Implementation of the 'List Product Price Points Response' model. Attributes: price_points (List[ProductPricePoint]): The model property of type List[ProductPricePoint]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_points": 'price_points' + "price_points": "price_points", } - def __init__(self, - price_points=None, - additional_properties=None): - """Constructor for the ListProductPricePointsResponse class""" - + def __init__( + self, + price_points=None, + additional_properties=None): + """Initialize a ListProductPricePointsResponse instance.""" # Initialize members of the class - self.price_points = price_points + self.price_points = price_points # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary price_points = None - if dictionary.get('price_points') is not None: - price_points = [ProductPricePoint.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ProductPricePoint.from_dictionary(x) + for x in dictionary.get("price_points") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_points, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_points={self.price_points!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_points=self.price_points + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_points={_price_points!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_products_filter.py b/advancedbilling/models/list_products_filter.py index b32fff0e..63b2db5e 100644 --- a/advancedbilling/models/list_products_filter.py +++ b/advancedbilling/models/list_products_filter.py @@ -1,64 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.prepaid_product_price_point_filter import PrepaidProductPricePointFilter +from advancedbilling.models.prepaid_product_price_point_filter import ( + PrepaidProductPricePointFilter, +) class ListProductsFilter(object): - """Implementation of the 'List Products Filter' model. Attributes: - ids (List[int]): Allows fetching products with matching id based on - provided values. Use in query `filter[ids]=1,2,3`. - prepaid_product_price_point (PrepaidProductPricePointFilter): Allows - fetching products only if a prepaid product price point is present - or not. To use this filter you also have to include the following - param in the request `include=prepaid_product_price_point`. Use in - query - `filter[prepaid_product_price_point][product_price_point_id]=not_nu - ll`. + ids (List[int]): Allows fetching products with matching id based on provided + values. Use in query `filter[ids]=1,2,3`. + prepaid_product_price_point (PrepaidProductPricePointFilter): Allows fetching + products only if a prepaid product price point is present or not. To use + this filter you also have to include the following param in the request + `include=prepaid_product_price_point`. Use in query + `filter[prepaid_product_price_point][product_price_point_id]=not_null`. use_site_exchange_rate (bool): Allows fetching products with matching - use_site_exchange_rate based on provided value (refers to default - price point). Use in query `filter[use_site_exchange_rate]=true`. - additional_properties (Dict[str, object]): The additional properties - for the model. + use_site_exchange_rate based on provided value (refers to default price + point). Use in query `filter[use_site_exchange_rate]=true`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "ids": 'ids', - "prepaid_product_price_point": 'prepaid_product_price_point', - "use_site_exchange_rate": 'use_site_exchange_rate' + "ids": "ids", + "prepaid_product_price_point": "prepaid_product_price_point", + "use_site_exchange_rate": "use_site_exchange_rate", } _optionals = [ - 'ids', - 'prepaid_product_price_point', - 'use_site_exchange_rate', + "ids", + "prepaid_product_price_point", + "use_site_exchange_rate", ] - def __init__(self, - ids=APIHelper.SKIP, - prepaid_product_price_point=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListProductsFilter class""" - + def __init__( + self, + ids=APIHelper.SKIP, + prepaid_product_price_point=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListProductsFilter instance.""" # Initialize members of the class if ids is not APIHelper.SKIP: - self.ids = ids + self.ids = ids if prepaid_product_price_point is not APIHelper.SKIP: - self.prepaid_product_price_point = prepaid_product_price_point + self.prepaid_product_price_point = prepaid_product_price_point if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance if additional_properties is None: @@ -68,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -79,16 +77,28 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - ids = dictionary.get("ids") if dictionary.get("ids") else APIHelper.SKIP - prepaid_product_price_point = PrepaidProductPricePointFilter.from_dictionary(dictionary.get('prepaid_product_price_point')) if 'prepaid_product_price_point' in dictionary.keys() else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP + ids =\ + dictionary.get("ids")\ + if dictionary.get("ids")\ + else APIHelper.SKIP + prepaid_product_price_point =\ + PrepaidProductPricePointFilter.from_dictionary( + dictionary.get("prepaid_product_price_point"))\ + if "prepaid_product_price_point" in dictionary.keys()\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(ids, prepaid_product_price_point, @@ -96,15 +106,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'ids={(self.ids if hasattr(self, "ids") else None)!r}, ' - f'prepaid_product_price_point={(self.prepaid_product_price_point if hasattr(self, "prepaid_product_price_point") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _prepaid_product_price_point=( + self.prepaid_product_price_point + if hasattr(self, "prepaid_product_price_point") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ids={_ids!r}, " + f"prepaid_product_price_point={_prepaid_product_price_point!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'ids={(self.ids if hasattr(self, "ids") else None)!s}, ' - f'prepaid_product_price_point={(self.prepaid_product_price_point if hasattr(self, "prepaid_product_price_point") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _ids=( + self.ids + if hasattr(self, "ids") + else None + ) + _prepaid_product_price_point=( + self.prepaid_product_price_point + if hasattr(self, "prepaid_product_price_point") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ids={_ids!s}, " + f"prepaid_product_price_point={_prepaid_product_price_point!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_products_include.py b/advancedbilling/models/list_products_include.py index 405a5c1c..b9b00ad2 100644 --- a/advancedbilling/models/list_products_include.py +++ b/advancedbilling/models/list_products_include.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ListProductsInclude(object): - """Implementation of the 'List Products Include' enum. Attributes: PREPAID_PRODUCT_PRICE_POINT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - PREPAID_PRODUCT_PRICE_POINT = 'prepaid_product_price_point' + + PREPAID_PRODUCT_PRICE_POINT = "prepaid_product_price_point" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_products_price_points_include.py b/advancedbilling/models/list_products_price_points_include.py index 5434c550..121d12f3 100644 --- a/advancedbilling/models/list_products_price_points_include.py +++ b/advancedbilling/models/list_products_price_points_include.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ListProductsPricePointsInclude(object): - """Implementation of the 'List Products Price Points Include' enum. Attributes: CURRENCY_PRICES: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CURRENCY_PRICES = 'currency_prices' + + CURRENCY_PRICES = "currency_prices" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_proforma_invoices_meta.py b/advancedbilling/models/list_proforma_invoices_meta.py index 07e441f9..5b7969c6 100644 --- a/advancedbilling/models/list_proforma_invoices_meta.py +++ b/advancedbilling/models/list_proforma_invoices_meta.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListProformaInvoicesMeta(object): - """Implementation of the 'List Proforma Invoices Meta' model. Attributes: @@ -18,43 +16,43 @@ class ListProformaInvoicesMeta(object): current_page (int): The model property of type int. total_pages (int): The model property of type int. status_code (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "total_count": 'total_count', - "current_page": 'current_page', - "total_pages": 'total_pages', - "status_code": 'status_code' + "total_count": "total_count", + "current_page": "current_page", + "total_pages": "total_pages", + "status_code": "status_code", } _optionals = [ - 'total_count', - 'current_page', - 'total_pages', - 'status_code', + "total_count", + "current_page", + "total_pages", + "status_code", ] - def __init__(self, - total_count=APIHelper.SKIP, - current_page=APIHelper.SKIP, - total_pages=APIHelper.SKIP, - status_code=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListProformaInvoicesMeta class""" - + def __init__( + self, + total_count=APIHelper.SKIP, + current_page=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + status_code=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListProformaInvoicesMeta instance.""" # Initialize members of the class if total_count is not APIHelper.SKIP: - self.total_count = total_count + self.total_count = total_count if current_page is not APIHelper.SKIP: - self.current_page = current_page + self.current_page = current_page if total_pages is not APIHelper.SKIP: - self.total_pages = total_pages + self.total_pages = total_pages if status_code is not APIHelper.SKIP: - self.status_code = status_code + self.status_code = status_code # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - total_count = dictionary.get("total_count") if dictionary.get("total_count") else APIHelper.SKIP - current_page = dictionary.get("current_page") if dictionary.get("current_page") else APIHelper.SKIP - total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP - status_code = dictionary.get("status_code") if dictionary.get("status_code") else APIHelper.SKIP + total_count =\ + dictionary.get("total_count")\ + if dictionary.get("total_count")\ + else APIHelper.SKIP + current_page =\ + dictionary.get("current_page")\ + if dictionary.get("current_page")\ + else APIHelper.SKIP + total_pages =\ + dictionary.get("total_pages")\ + if dictionary.get("total_pages")\ + else APIHelper.SKIP + status_code =\ + dictionary.get("status_code")\ + if dictionary.get("status_code")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(total_count, current_page, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!r}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!r}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' - f'status_code={(self.status_code if hasattr(self, "status_code") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _status_code=( + self.status_code + if hasattr(self, "status_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!r}, " + f"current_page={_current_page!r}, " + f"total_pages={_total_pages!r}, " + f"status_code={_status_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!s}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!s}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' - f'status_code={(self.status_code if hasattr(self, "status_code") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _status_code=( + self.status_code + if hasattr(self, "status_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!s}, " + f"current_page={_current_page!s}, " + f"total_pages={_total_pages!s}, " + f"status_code={_status_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_proforma_invoices_response.py b/advancedbilling/models/list_proforma_invoices_response.py index 55a4a449..eba80de8 100644 --- a/advancedbilling/models/list_proforma_invoices_response.py +++ b/advancedbilling/models/list_proforma_invoices_response.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.list_proforma_invoices_meta import ListProformaInvoicesMeta -from advancedbilling.models.proforma_invoice import ProformaInvoice +from advancedbilling.models.list_proforma_invoices_meta import ( + ListProformaInvoicesMeta, +) +from advancedbilling.models.proforma_invoice import ( + ProformaInvoice, +) class ListProformaInvoicesResponse(object): - """Implementation of the 'List Proforma Invoices Response' model. Attributes: @@ -20,33 +22,33 @@ class ListProformaInvoicesResponse(object): List[ProformaInvoice]. meta (ListProformaInvoicesMeta): The model property of type ListProformaInvoicesMeta. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "proforma_invoices": 'proforma_invoices', - "meta": 'meta' + "proforma_invoices": "proforma_invoices", + "meta": "meta", } _optionals = [ - 'proforma_invoices', - 'meta', + "proforma_invoices", + "meta", ] - def __init__(self, - proforma_invoices=APIHelper.SKIP, - meta=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListProformaInvoicesResponse class""" - + def __init__( + self, + proforma_invoices=APIHelper.SKIP, + meta=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListProformaInvoicesResponse instance.""" # Initialize members of the class if proforma_invoices is not APIHelper.SKIP: - self.proforma_invoices = proforma_invoices + self.proforma_invoices = proforma_invoices if meta is not APIHelper.SKIP: - self.meta = meta + self.meta = meta # Add additional model properties to the instance if additional_properties is None: @@ -56,7 +58,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -67,32 +69,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary proforma_invoices = None - if dictionary.get('proforma_invoices') is not None: - proforma_invoices = [ProformaInvoice.from_dictionary(x) for x in dictionary.get('proforma_invoices')] + if dictionary.get("proforma_invoices") is not None: + proforma_invoices = [ + ProformaInvoice.from_dictionary(x) + for x in dictionary.get("proforma_invoices") + ] else: proforma_invoices = APIHelper.SKIP - meta = ListProformaInvoicesMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP + meta =\ + ListProformaInvoicesMeta.from_dictionary( + dictionary.get("meta"))\ + if "meta" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(proforma_invoices, meta, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'proforma_invoices={(self.proforma_invoices if hasattr(self, "proforma_invoices") else None)!r}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _proforma_invoices=( + self.proforma_invoices + if hasattr(self, "proforma_invoices") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"proforma_invoices={_proforma_invoices!r}, " + f"meta={_meta!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'proforma_invoices={(self.proforma_invoices if hasattr(self, "proforma_invoices") else None)!s}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _proforma_invoices=( + self.proforma_invoices + if hasattr(self, "proforma_invoices") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"proforma_invoices={_proforma_invoices!s}, " + f"meta={_meta!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_public_keys_meta.py b/advancedbilling/models/list_public_keys_meta.py index 1d0ce5f2..8483ef00 100644 --- a/advancedbilling/models/list_public_keys_meta.py +++ b/advancedbilling/models/list_public_keys_meta.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListPublicKeysMeta(object): - """Implementation of the 'List Public Keys Meta' model. Attributes: @@ -18,43 +16,43 @@ class ListPublicKeysMeta(object): current_page (int): The model property of type int. total_pages (int): The model property of type int. per_page (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "total_count": 'total_count', - "current_page": 'current_page', - "total_pages": 'total_pages', - "per_page": 'per_page' + "total_count": "total_count", + "current_page": "current_page", + "total_pages": "total_pages", + "per_page": "per_page", } _optionals = [ - 'total_count', - 'current_page', - 'total_pages', - 'per_page', + "total_count", + "current_page", + "total_pages", + "per_page", ] - def __init__(self, - total_count=APIHelper.SKIP, - current_page=APIHelper.SKIP, - total_pages=APIHelper.SKIP, - per_page=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListPublicKeysMeta class""" - + def __init__( + self, + total_count=APIHelper.SKIP, + current_page=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + per_page=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListPublicKeysMeta instance.""" # Initialize members of the class if total_count is not APIHelper.SKIP: - self.total_count = total_count + self.total_count = total_count if current_page is not APIHelper.SKIP: - self.current_page = current_page + self.current_page = current_page if total_pages is not APIHelper.SKIP: - self.total_pages = total_pages + self.total_pages = total_pages if per_page is not APIHelper.SKIP: - self.per_page = per_page + self.per_page = per_page # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - total_count = dictionary.get("total_count") if dictionary.get("total_count") else APIHelper.SKIP - current_page = dictionary.get("current_page") if dictionary.get("current_page") else APIHelper.SKIP - total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP - per_page = dictionary.get("per_page") if dictionary.get("per_page") else APIHelper.SKIP + total_count =\ + dictionary.get("total_count")\ + if dictionary.get("total_count")\ + else APIHelper.SKIP + current_page =\ + dictionary.get("current_page")\ + if dictionary.get("current_page")\ + else APIHelper.SKIP + total_pages =\ + dictionary.get("total_pages")\ + if dictionary.get("total_pages")\ + else APIHelper.SKIP + per_page =\ + dictionary.get("per_page")\ + if dictionary.get("per_page")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(total_count, current_page, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!r}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!r}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!r}, " + f"current_page={_current_page!r}, " + f"total_pages={_total_pages!r}, " + f"per_page={_per_page!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!s}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!s}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!s}, " + f"current_page={_current_page!s}, " + f"total_pages={_total_pages!s}, " + f"per_page={_per_page!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_public_keys_response.py b/advancedbilling/models/list_public_keys_response.py index 076ed94b..eb70164e 100644 --- a/advancedbilling/models/list_public_keys_response.py +++ b/advancedbilling/models/list_public_keys_response.py @@ -1,52 +1,53 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.list_public_keys_meta import ListPublicKeysMeta -from advancedbilling.models.public_key import PublicKey +from advancedbilling.models.list_public_keys_meta import ( + ListPublicKeysMeta, +) +from advancedbilling.models.public_key import ( + PublicKey, +) class ListPublicKeysResponse(object): - """Implementation of the 'List Public Keys Response' model. Attributes: chargify_js_keys (List[PublicKey]): The model property of type List[PublicKey]. - meta (ListPublicKeysMeta): The model property of type - ListPublicKeysMeta. - additional_properties (Dict[str, object]): The additional properties - for the model. + meta (ListPublicKeysMeta): The model property of type ListPublicKeysMeta. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify_js_keys": 'chargify_js_keys', - "meta": 'meta' + "chargify_js_keys": "chargify_js_keys", + "meta": "meta", } _optionals = [ - 'chargify_js_keys', - 'meta', + "chargify_js_keys", + "meta", ] - def __init__(self, - chargify_js_keys=APIHelper.SKIP, - meta=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListPublicKeysResponse class""" - + def __init__( + self, + chargify_js_keys=APIHelper.SKIP, + meta=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListPublicKeysResponse instance.""" # Initialize members of the class if chargify_js_keys is not APIHelper.SKIP: - self.chargify_js_keys = chargify_js_keys + self.chargify_js_keys = chargify_js_keys if meta is not APIHelper.SKIP: - self.meta = meta + self.meta = meta # Add additional model properties to the instance if additional_properties is None: @@ -56,7 +57,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -67,32 +68,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary chargify_js_keys = None - if dictionary.get('chargify_js_keys') is not None: - chargify_js_keys = [PublicKey.from_dictionary(x) for x in dictionary.get('chargify_js_keys')] + if dictionary.get("chargify_js_keys") is not None: + chargify_js_keys = [ + PublicKey.from_dictionary(x) + for x in dictionary.get("chargify_js_keys") + ] else: chargify_js_keys = APIHelper.SKIP - meta = ListPublicKeysMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP + meta =\ + ListPublicKeysMeta.from_dictionary( + dictionary.get("meta"))\ + if "meta" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify_js_keys, meta, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify_js_keys={(self.chargify_js_keys if hasattr(self, "chargify_js_keys") else None)!r}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify_js_keys=( + self.chargify_js_keys + if hasattr(self, "chargify_js_keys") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_js_keys={_chargify_js_keys!r}, " + f"meta={_meta!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify_js_keys={(self.chargify_js_keys if hasattr(self, "chargify_js_keys") else None)!s}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify_js_keys=( + self.chargify_js_keys + if hasattr(self, "chargify_js_keys") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_js_keys={_chargify_js_keys!s}, " + f"meta={_meta!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_sale_rep_item.py b/advancedbilling/models/list_sale_rep_item.py index a9e136fe..98663a6e 100644 --- a/advancedbilling/models/list_sale_rep_item.py +++ b/advancedbilling/models/list_sale_rep_item.py @@ -1,68 +1,68 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.sale_rep_item_mrr import SaleRepItemMrr +from advancedbilling.models.sale_rep_item_mrr import ( + SaleRepItemMrr, +) class ListSaleRepItem(object): - """Implementation of the 'List Sale Rep Item' model. Attributes: id (int): The model property of type int. full_name (str): The model property of type str. subscriptions_count (int): The model property of type int. - mrr_data (Dict[str, SaleRepItemMrr]): The model property of type - Dict[str, SaleRepItemMrr]. + mrr_data (Dict[str, SaleRepItemMrr]): The model property of type Dict[str, + SaleRepItemMrr]. test_mode (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "full_name": 'full_name', - "subscriptions_count": 'subscriptions_count', - "mrr_data": 'mrr_data', - "test_mode": 'test_mode' + "id": "id", + "full_name": "full_name", + "subscriptions_count": "subscriptions_count", + "mrr_data": "mrr_data", + "test_mode": "test_mode", } _optionals = [ - 'id', - 'full_name', - 'subscriptions_count', - 'mrr_data', - 'test_mode', + "id", + "full_name", + "subscriptions_count", + "mrr_data", + "test_mode", ] - def __init__(self, - id=APIHelper.SKIP, - full_name=APIHelper.SKIP, - subscriptions_count=APIHelper.SKIP, - mrr_data=APIHelper.SKIP, - test_mode=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSaleRepItem class""" - + def __init__( + self, + id=APIHelper.SKIP, + full_name=APIHelper.SKIP, + subscriptions_count=APIHelper.SKIP, + mrr_data=APIHelper.SKIP, + test_mode=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSaleRepItem instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if full_name is not APIHelper.SKIP: - self.full_name = full_name + self.full_name = full_name if subscriptions_count is not APIHelper.SKIP: - self.subscriptions_count = subscriptions_count + self.subscriptions_count = subscriptions_count if mrr_data is not APIHelper.SKIP: - self.mrr_data = mrr_data + self.mrr_data = mrr_data if test_mode is not APIHelper.SKIP: - self.test_mode = test_mode + self.test_mode = test_mode # Add additional model properties to the instance if additional_properties is None: @@ -72,7 +72,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -83,18 +83,36 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - full_name = dictionary.get("full_name") if dictionary.get("full_name") else APIHelper.SKIP - subscriptions_count = dictionary.get("subscriptions_count") if dictionary.get("subscriptions_count") else APIHelper.SKIP - mrr_data = SaleRepItemMrr.from_dictionary(dictionary.get('mrr_data')) if 'mrr_data' in dictionary.keys() else APIHelper.SKIP - test_mode = dictionary.get("test_mode") if "test_mode" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + full_name =\ + dictionary.get("full_name")\ + if dictionary.get("full_name")\ + else APIHelper.SKIP + subscriptions_count =\ + dictionary.get("subscriptions_count")\ + if dictionary.get("subscriptions_count")\ + else APIHelper.SKIP + mrr_data =\ + SaleRepItemMrr.from_dictionary( + dictionary.get("mrr_data"))\ + if "mrr_data" in dictionary.keys()\ + else APIHelper.SKIP + test_mode =\ + dictionary.get("test_mode")\ + if "test_mode" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, full_name, @@ -104,19 +122,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'full_name={(self.full_name if hasattr(self, "full_name") else None)!r}, ' - f'subscriptions_count={(self.subscriptions_count if hasattr(self, "subscriptions_count") else None)!r}, ' - f'mrr_data={(self.mrr_data if hasattr(self, "mrr_data") else None)!r}, ' - f'test_mode={(self.test_mode if hasattr(self, "test_mode") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _full_name=( + self.full_name + if hasattr(self, "full_name") + else None + ) + _subscriptions_count=( + self.subscriptions_count + if hasattr(self, "subscriptions_count") + else None + ) + _mrr_data=( + self.mrr_data + if hasattr(self, "mrr_data") + else None + ) + _test_mode=( + self.test_mode + if hasattr(self, "test_mode") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"full_name={_full_name!r}, " + f"subscriptions_count={_subscriptions_count!r}, " + f"mrr_data={_mrr_data!r}, " + f"test_mode={_test_mode!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'full_name={(self.full_name if hasattr(self, "full_name") else None)!s}, ' - f'subscriptions_count={(self.subscriptions_count if hasattr(self, "subscriptions_count") else None)!s}, ' - f'mrr_data={(self.mrr_data if hasattr(self, "mrr_data") else None)!s}, ' - f'test_mode={(self.test_mode if hasattr(self, "test_mode") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _full_name=( + self.full_name + if hasattr(self, "full_name") + else None + ) + _subscriptions_count=( + self.subscriptions_count + if hasattr(self, "subscriptions_count") + else None + ) + _mrr_data=( + self.mrr_data + if hasattr(self, "mrr_data") + else None + ) + _test_mode=( + self.test_mode + if hasattr(self, "test_mode") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"full_name={_full_name!s}, " + f"subscriptions_count={_subscriptions_count!s}, " + f"mrr_data={_mrr_data!s}, " + f"test_mode={_test_mode!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_segments_filter.py b/advancedbilling/models/list_segments_filter.py index 6b301b44..713a9195 100644 --- a/advancedbilling/models/list_segments_filter.py +++ b/advancedbilling/models/list_segments_filter.py @@ -1,72 +1,67 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListSegmentsFilter(object): - """Implementation of the 'List Segments Filter' model. Attributes: - segment_property_1_value (str): The value passed here would be used to - filter segments. Pass a value related to `segment_property_1` on - attached Metric. If empty string is passed, this filter would be - rejected. Use in query `filter[segment_property_1_value]=EU`. - segment_property_2_value (str): The value passed here would be used to - filter segments. Pass a value related to `segment_property_2` on - attached Metric. If empty string is passed, this filter would be - rejected. - segment_property_3_value (str): The value passed here would be used to - filter segments. Pass a value related to `segment_property_3` on - attached Metric. If empty string is passed, this filter would be - rejected. - segment_property_4_value (str): The value passed here would be used to - filter segments. Pass a value related to `segment_property_4` on - attached Metric. If empty string is passed, this filter would be - rejected. - additional_properties (Dict[str, object]): The additional properties - for the model. + segment_property_1_value (str): The value passed here would be used to filter + segments. Pass a value related to `segment_property_1` on attached + Metric. If empty string is passed, this filter would be rejected. Use in + query `filter[segment_property_1_value]=EU`. + segment_property_2_value (str): The value passed here would be used to filter + segments. Pass a value related to `segment_property_2` on attached + Metric. If empty string is passed, this filter would be rejected. + segment_property_3_value (str): The value passed here would be used to filter + segments. Pass a value related to `segment_property_3` on attached + Metric. If empty string is passed, this filter would be rejected. + segment_property_4_value (str): The value passed here would be used to filter + segments. Pass a value related to `segment_property_4` on attached + Metric. If empty string is passed, this filter would be rejected. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segment_property_1_value": 'segment_property_1_value', - "segment_property_2_value": 'segment_property_2_value', - "segment_property_3_value": 'segment_property_3_value', - "segment_property_4_value": 'segment_property_4_value' + "segment_property_1_value": "segment_property_1_value", + "segment_property_2_value": "segment_property_2_value", + "segment_property_3_value": "segment_property_3_value", + "segment_property_4_value": "segment_property_4_value", } _optionals = [ - 'segment_property_1_value', - 'segment_property_2_value', - 'segment_property_3_value', - 'segment_property_4_value', + "segment_property_1_value", + "segment_property_2_value", + "segment_property_3_value", + "segment_property_4_value", ] - def __init__(self, - segment_property_1_value=APIHelper.SKIP, - segment_property_2_value=APIHelper.SKIP, - segment_property_3_value=APIHelper.SKIP, - segment_property_4_value=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSegmentsFilter class""" - + def __init__( + self, + segment_property_1_value=APIHelper.SKIP, + segment_property_2_value=APIHelper.SKIP, + segment_property_3_value=APIHelper.SKIP, + segment_property_4_value=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSegmentsFilter instance.""" # Initialize members of the class if segment_property_1_value is not APIHelper.SKIP: - self.segment_property_1_value = segment_property_1_value + self.segment_property_1_value = segment_property_1_value if segment_property_2_value is not APIHelper.SKIP: - self.segment_property_2_value = segment_property_2_value + self.segment_property_2_value = segment_property_2_value if segment_property_3_value is not APIHelper.SKIP: - self.segment_property_3_value = segment_property_3_value + self.segment_property_3_value = segment_property_3_value if segment_property_4_value is not APIHelper.SKIP: - self.segment_property_4_value = segment_property_4_value + self.segment_property_4_value = segment_property_4_value # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +71,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,17 +82,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - segment_property_1_value = dictionary.get("segment_property_1_value") if dictionary.get("segment_property_1_value") else APIHelper.SKIP - segment_property_2_value = dictionary.get("segment_property_2_value") if dictionary.get("segment_property_2_value") else APIHelper.SKIP - segment_property_3_value = dictionary.get("segment_property_3_value") if dictionary.get("segment_property_3_value") else APIHelper.SKIP - segment_property_4_value = dictionary.get("segment_property_4_value") if dictionary.get("segment_property_4_value") else APIHelper.SKIP + segment_property_1_value =\ + dictionary.get("segment_property_1_value")\ + if dictionary.get("segment_property_1_value")\ + else APIHelper.SKIP + segment_property_2_value =\ + dictionary.get("segment_property_2_value")\ + if dictionary.get("segment_property_2_value")\ + else APIHelper.SKIP + segment_property_3_value =\ + dictionary.get("segment_property_3_value")\ + if dictionary.get("segment_property_3_value")\ + else APIHelper.SKIP + segment_property_4_value =\ + dictionary.get("segment_property_4_value")\ + if dictionary.get("segment_property_4_value")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segment_property_1_value, segment_property_2_value, @@ -106,17 +115,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segment_property_1_value={(self.segment_property_1_value if hasattr(self, "segment_property_1_value") else None)!r}, ' - f'segment_property_2_value={(self.segment_property_2_value if hasattr(self, "segment_property_2_value") else None)!r}, ' - f'segment_property_3_value={(self.segment_property_3_value if hasattr(self, "segment_property_3_value") else None)!r}, ' - f'segment_property_4_value={(self.segment_property_4_value if hasattr(self, "segment_property_4_value") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segment_property_1_value=( + self.segment_property_1_value + if hasattr(self, "segment_property_1_value") + else None + ) + _segment_property_2_value=( + self.segment_property_2_value + if hasattr(self, "segment_property_2_value") + else None + ) + _segment_property_3_value=( + self.segment_property_3_value + if hasattr(self, "segment_property_3_value") + else None + ) + _segment_property_4_value=( + self.segment_property_4_value + if hasattr(self, "segment_property_4_value") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment_property_1_value={_segment_property_1_value!r}, " + f"segment_property_2_value={_segment_property_2_value!r}, " + f"segment_property_3_value={_segment_property_3_value!r}, " + f"segment_property_4_value={_segment_property_4_value!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segment_property_1_value={(self.segment_property_1_value if hasattr(self, "segment_property_1_value") else None)!s}, ' - f'segment_property_2_value={(self.segment_property_2_value if hasattr(self, "segment_property_2_value") else None)!s}, ' - f'segment_property_3_value={(self.segment_property_3_value if hasattr(self, "segment_property_3_value") else None)!s}, ' - f'segment_property_4_value={(self.segment_property_4_value if hasattr(self, "segment_property_4_value") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segment_property_1_value=( + self.segment_property_1_value + if hasattr(self, "segment_property_1_value") + else None + ) + _segment_property_2_value=( + self.segment_property_2_value + if hasattr(self, "segment_property_2_value") + else None + ) + _segment_property_3_value=( + self.segment_property_3_value + if hasattr(self, "segment_property_3_value") + else None + ) + _segment_property_4_value=( + self.segment_property_4_value + if hasattr(self, "segment_property_4_value") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment_property_1_value={_segment_property_1_value!s}, " + f"segment_property_2_value={_segment_property_2_value!s}, " + f"segment_property_3_value={_segment_property_3_value!s}, " + f"segment_property_4_value={_segment_property_4_value!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_segments_response.py b/advancedbilling/models/list_segments_response.py index 774cd7fc..433a86fd 100644 --- a/advancedbilling/models/list_segments_response.py +++ b/advancedbilling/models/list_segments_response.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.segment import Segment class ListSegmentsResponse(object): - """Implementation of the 'List Segments Response' model. Attributes: segments (List[Segment]): The model property of type List[Segment]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segments": 'segments' + "segments": "segments", } _optionals = [ - 'segments', + "segments", ] - def __init__(self, - segments=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSegmentsResponse class""" - + def __init__( + self, + segments=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSegmentsResponse instance.""" # Initialize members of the class if segments is not APIHelper.SKIP: - self.segments = segments + self.segments = segments # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,28 +56,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary segments = None - if dictionary.get('segments') is not None: - segments = [Segment.from_dictionary(x) for x in dictionary.get('segments')] + if dictionary.get("segments") is not None: + segments = [ + Segment.from_dictionary(x) + for x in dictionary.get("segments") + ] else: segments = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segments, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segments={(self.segments if hasattr(self, "segments") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segments=( + self.segments + if hasattr(self, "segments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segments={(self.segments if hasattr(self, "segments") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segments=( + self.segments + if hasattr(self, "segments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segments={_segments!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_service_credits_response.py b/advancedbilling/models/list_service_credits_response.py index f1a1703b..5459b7bd 100644 --- a/advancedbilling/models/list_service_credits_response.py +++ b/advancedbilling/models/list_service_credits_response.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.service_credit_1 import ServiceCredit1 +from advancedbilling.models.service_credit_1 import ( + ServiceCredit1, +) class ListServiceCreditsResponse(object): - """Implementation of the 'List Service Credits Response' model. Attributes: service_credits (List[ServiceCredit1]): The model property of type List[ServiceCredit1]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "service_credits": 'service_credits' + "service_credits": "service_credits", } _optionals = [ - 'service_credits', + "service_credits", ] - def __init__(self, - service_credits=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListServiceCreditsResponse class""" - + def __init__( + self, + service_credits=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListServiceCreditsResponse instance.""" # Initialize members of the class if service_credits is not APIHelper.SKIP: - self.service_credits = service_credits + self.service_credits = service_credits # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,28 +59,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary service_credits = None - if dictionary.get('service_credits') is not None: - service_credits = [ServiceCredit1.from_dictionary(x) for x in dictionary.get('service_credits')] + if dictionary.get("service_credits") is not None: + service_credits = [ + ServiceCredit1.from_dictionary(x) + for x in dictionary.get("service_credits") + ] else: service_credits = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(service_credits, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'service_credits={(self.service_credits if hasattr(self, "service_credits") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _service_credits=( + self.service_credits + if hasattr(self, "service_credits") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"service_credits={_service_credits!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'service_credits={(self.service_credits if hasattr(self, "service_credits") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _service_credits=( + self.service_credits + if hasattr(self, "service_credits") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"service_credits={_service_credits!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subcription_group_prepayment_item.py b/advancedbilling/models/list_subcription_group_prepayment_item.py index a9b4e878..5450390c 100644 --- a/advancedbilling/models/list_subcription_group_prepayment_item.py +++ b/advancedbilling/models/list_subcription_group_prepayment_item.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListSubcriptionGroupPrepaymentItem(object): - """Implementation of the 'List Subcription Group Prepayment Item' model. Attributes: @@ -21,71 +19,73 @@ class ListSubcriptionGroupPrepaymentItem(object): details (str): The model property of type str. external (bool): The model property of type bool. memo (str): The model property of type str. - payment_type (PrepaymentMethod): The model property of type - PrepaymentMethod. + payment_type (PrepaymentMethod): The model property of type PrepaymentMethod. created_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "subscription_group_uid": 'subscription_group_uid', - "amount_in_cents": 'amount_in_cents', - "remaining_amount_in_cents": 'remaining_amount_in_cents', - "details": 'details', - "external": 'external', - "memo": 'memo', - "payment_type": 'payment_type', - "created_at": 'created_at' + "id": "id", + "subscription_group_uid": "subscription_group_uid", + "amount_in_cents": "amount_in_cents", + "remaining_amount_in_cents": "remaining_amount_in_cents", + "details": "details", + "external": "external", + "memo": "memo", + "payment_type": "payment_type", + "created_at": "created_at", } _optionals = [ - 'id', - 'subscription_group_uid', - 'amount_in_cents', - 'remaining_amount_in_cents', - 'details', - 'external', - 'memo', - 'payment_type', - 'created_at', + "id", + "subscription_group_uid", + "amount_in_cents", + "remaining_amount_in_cents", + "details", + "external", + "memo", + "payment_type", + "created_at", ] - def __init__(self, - id=APIHelper.SKIP, - subscription_group_uid=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - remaining_amount_in_cents=APIHelper.SKIP, - details=APIHelper.SKIP, - external=APIHelper.SKIP, - memo=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - created_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSubcriptionGroupPrepaymentItem class""" - + def __init__( + self, + id=APIHelper.SKIP, + subscription_group_uid=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + remaining_amount_in_cents=APIHelper.SKIP, + details=APIHelper.SKIP, + external=APIHelper.SKIP, + memo=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + created_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSubcriptionGroupPrepaymentItem instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if subscription_group_uid is not APIHelper.SKIP: - self.subscription_group_uid = subscription_group_uid + self.subscription_group_uid = subscription_group_uid if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if remaining_amount_in_cents is not APIHelper.SKIP: - self.remaining_amount_in_cents = remaining_amount_in_cents + self.remaining_amount_in_cents = remaining_amount_in_cents if details is not APIHelper.SKIP: - self.details = details + self.details = details if external is not APIHelper.SKIP: - self.external = external + self.external = external if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type + self.payment_type = payment_type if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None # Add additional model properties to the instance if additional_properties is None: @@ -95,7 +95,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -106,22 +106,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - subscription_group_uid = dictionary.get("subscription_group_uid") if dictionary.get("subscription_group_uid") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - remaining_amount_in_cents = dictionary.get("remaining_amount_in_cents") if dictionary.get("remaining_amount_in_cents") else APIHelper.SKIP - details = dictionary.get("details") if dictionary.get("details") else APIHelper.SKIP - external = dictionary.get("external") if "external" in dictionary.keys() else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + subscription_group_uid =\ + dictionary.get("subscription_group_uid")\ + if dictionary.get("subscription_group_uid")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + remaining_amount_in_cents =\ + dictionary.get("remaining_amount_in_cents")\ + if dictionary.get("remaining_amount_in_cents")\ + else APIHelper.SKIP + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else APIHelper.SKIP + external =\ + dictionary.get("external")\ + if "external" in dictionary.keys()\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, subscription_group_uid, @@ -135,27 +163,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'subscription_group_uid={(self.subscription_group_uid if hasattr(self, "subscription_group_uid") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'remaining_amount_in_cents={(self.remaining_amount_in_cents if hasattr(self, "remaining_amount_in_cents") else None)!r}, ' - f'details={(self.details if hasattr(self, "details") else None)!r}, ' - f'external={(self.external if hasattr(self, "external") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _subscription_group_uid=( + self.subscription_group_uid + if hasattr(self, "subscription_group_uid") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _remaining_amount_in_cents=( + self.remaining_amount_in_cents + if hasattr(self, "remaining_amount_in_cents") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _external=( + self.external + if hasattr(self, "external") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"subscription_group_uid={_subscription_group_uid!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"remaining_amount_in_cents={_remaining_amount_in_cents!r}, " + f"details={_details!r}, " + f"external={_external!r}, " + f"memo={_memo!r}, " + f"payment_type={_payment_type!r}, " + f"created_at={_created_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'subscription_group_uid={(self.subscription_group_uid if hasattr(self, "subscription_group_uid") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'remaining_amount_in_cents={(self.remaining_amount_in_cents if hasattr(self, "remaining_amount_in_cents") else None)!s}, ' - f'details={(self.details if hasattr(self, "details") else None)!s}, ' - f'external={(self.external if hasattr(self, "external") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _subscription_group_uid=( + self.subscription_group_uid + if hasattr(self, "subscription_group_uid") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _remaining_amount_in_cents=( + self.remaining_amount_in_cents + if hasattr(self, "remaining_amount_in_cents") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _external=( + self.external + if hasattr(self, "external") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"subscription_group_uid={_subscription_group_uid!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"remaining_amount_in_cents={_remaining_amount_in_cents!s}, " + f"details={_details!s}, " + f"external={_external!s}, " + f"memo={_memo!s}, " + f"payment_type={_payment_type!s}, " + f"created_at={_created_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_components_filter.py b/advancedbilling/models/list_subscription_components_filter.py index d808f374..98218d3d 100644 --- a/advancedbilling/models/list_subscription_components_filter.py +++ b/advancedbilling/models/list_subscription_components_filter.py @@ -1,52 +1,50 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListSubscriptionComponentsFilter(object): - """Implementation of the 'List Subscription Components Filter' model. Attributes: - currencies (List[str]): Allows fetching components allocation with - matching currency based on provided values. Use in query + currencies (List[str]): Allows fetching components allocation with matching + currency based on provided values. Use in query `filter[currencies]=EUR,USD`. - use_site_exchange_rate (bool): Allows fetching components allocation - with matching use_site_exchange_rate based on provided value. Use - in query `filter[use_site_exchange_rate]=true`. - additional_properties (Dict[str, object]): The additional properties - for the model. + use_site_exchange_rate (bool): Allows fetching components allocation with + matching use_site_exchange_rate based on provided value. Use in query + `filter[use_site_exchange_rate]=true`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currencies": 'currencies', - "use_site_exchange_rate": 'use_site_exchange_rate' + "currencies": "currencies", + "use_site_exchange_rate": "use_site_exchange_rate", } _optionals = [ - 'currencies', - 'use_site_exchange_rate', + "currencies", + "use_site_exchange_rate", ] - def __init__(self, - currencies=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSubscriptionComponentsFilter class""" - + def __init__( + self, + currencies=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSubscriptionComponentsFilter instance.""" # Initialize members of the class if currencies is not APIHelper.SKIP: - self.currencies = currencies + self.currencies = currencies if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance if additional_properties is None: @@ -56,7 +54,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -67,28 +65,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - currencies = dictionary.get("currencies") if dictionary.get("currencies") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP + currencies =\ + dictionary.get("currencies")\ + if dictionary.get("currencies")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currencies, use_site_exchange_rate, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currencies={(self.currencies if hasattr(self, "currencies") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currencies=( + self.currencies + if hasattr(self, "currencies") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currencies={_currencies!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currencies={(self.currencies if hasattr(self, "currencies") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currencies=( + self.currencies + if hasattr(self, "currencies") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currencies={_currencies!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_components_for_site_filter.py b/advancedbilling/models/list_subscription_components_for_site_filter.py index cd0af032..a1650006 100644 --- a/advancedbilling/models/list_subscription_components_for_site_filter.py +++ b/advancedbilling/models/list_subscription_components_for_site_filter.py @@ -1,60 +1,60 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_filter import SubscriptionFilter +from advancedbilling.models.subscription_filter import ( + SubscriptionFilter, +) class ListSubscriptionComponentsForSiteFilter(object): - """Implementation of the 'List Subscription Components For Site Filter' model. Attributes: - currencies (List[str]): Allows fetching components allocation with - matching currency based on provided values. Use in query + currencies (List[str]): Allows fetching components allocation with matching + currency based on provided values. Use in query `filter[currencies]=USD,EUR`. - use_site_exchange_rate (bool): Allows fetching components allocation - with matching use_site_exchange_rate based on provided value. Use - in query `filter[use_site_exchange_rate]=true`. - subscription (SubscriptionFilter): Nested filter used for List - Subscription Components For Site Filter - additional_properties (Dict[str, object]): The additional properties - for the model. + use_site_exchange_rate (bool): Allows fetching components allocation with + matching use_site_exchange_rate based on provided value. Use in query + `filter[use_site_exchange_rate]=true`. + subscription (SubscriptionFilter): Nested filter used for List Subscription + Components For Site Filter + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currencies": 'currencies', - "use_site_exchange_rate": 'use_site_exchange_rate', - "subscription": 'subscription' + "currencies": "currencies", + "use_site_exchange_rate": "use_site_exchange_rate", + "subscription": "subscription", } _optionals = [ - 'currencies', - 'use_site_exchange_rate', - 'subscription', + "currencies", + "use_site_exchange_rate", + "subscription", ] - def __init__(self, - currencies=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - subscription=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSubscriptionComponentsForSiteFilter class""" - + def __init__( + self, + currencies=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + subscription=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSubscriptionComponentsForSiteFilter instance.""" # Initialize members of the class if currencies is not APIHelper.SKIP: - self.currencies = currencies + self.currencies = currencies if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if subscription is not APIHelper.SKIP: - self.subscription = subscription + self.subscription = subscription # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +64,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,16 +75,28 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - currencies = dictionary.get("currencies") if dictionary.get("currencies") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - subscription = SubscriptionFilter.from_dictionary(dictionary.get('subscription')) if 'subscription' in dictionary.keys() else APIHelper.SKIP + currencies =\ + dictionary.get("currencies")\ + if dictionary.get("currencies")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + subscription =\ + SubscriptionFilter.from_dictionary( + dictionary.get("subscription"))\ + if "subscription" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currencies, use_site_exchange_rate, @@ -92,15 +104,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currencies={(self.currencies if hasattr(self, "currencies") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currencies=( + self.currencies + if hasattr(self, "currencies") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currencies={_currencies!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"subscription={_subscription!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currencies={(self.currencies if hasattr(self, "currencies") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currencies=( + self.currencies + if hasattr(self, "currencies") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currencies={_currencies!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"subscription={_subscription!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_components_include.py b/advancedbilling/models/list_subscription_components_include.py index 752d9caa..c0ea86af 100644 --- a/advancedbilling/models/list_subscription_components_include.py +++ b/advancedbilling/models/list_subscription_components_include.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ListSubscriptionComponentsInclude(object): - """Implementation of the 'List Subscription Components Include' enum. Attributes: SUBSCRIPTION: The enum member of type str. HISTORIC_USAGES: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - SUBSCRIPTION = 'subscription' - HISTORIC_USAGES = 'historic_usages' + SUBSCRIPTION = "subscription" + + HISTORIC_USAGES = "historic_usages" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_subscription_components_response.py b/advancedbilling/models/list_subscription_components_response.py index a3d0e646..64768b0f 100644 --- a/advancedbilling/models/list_subscription_components_response.py +++ b/advancedbilling/models/list_subscription_components_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_component import SubscriptionComponent +# ruff: noqa: E501 +from advancedbilling.models.subscription_component import ( + SubscriptionComponent, +) -class ListSubscriptionComponentsResponse(object): +class ListSubscriptionComponentsResponse(object): """Implementation of the 'List Subscription Components Response' model. Attributes: - subscriptions_components (List[SubscriptionComponent]): The model - property of type List[SubscriptionComponent]. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscriptions_components (List[SubscriptionComponent]): The model property of + type List[SubscriptionComponent]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscriptions_components": 'subscriptions_components' + "subscriptions_components": "subscriptions_components", } - def __init__(self, - subscriptions_components=None, - additional_properties=None): - """Constructor for the ListSubscriptionComponentsResponse class""" - + def __init__( + self, + subscriptions_components=None, + additional_properties=None): + """Initialize a ListSubscriptionComponentsResponse instance.""" # Initialize members of the class - self.subscriptions_components = subscriptions_components + self.subscriptions_components = subscriptions_components # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary subscriptions_components = None - if dictionary.get('subscriptions_components') is not None: - subscriptions_components = [SubscriptionComponent.from_dictionary(x) for x in dictionary.get('subscriptions_components')] + if dictionary.get("subscriptions_components") is not None: + subscriptions_components = [ + SubscriptionComponent.from_dictionary(x) + for x in dictionary.get("subscriptions_components") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscriptions_components, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscriptions_components={self.subscriptions_components!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscriptions_components=self.subscriptions_components + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscriptions_components={_subscriptions_components!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscriptions_components={self.subscriptions_components!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscriptions_components=self.subscriptions_components + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscriptions_components={_subscriptions_components!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_components_sort.py b/advancedbilling/models/list_subscription_components_sort.py index 83605e01..45e8c2ff 100644 --- a/advancedbilling/models/list_subscription_components_sort.py +++ b/advancedbilling/models/list_subscription_components_sort.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ListSubscriptionComponentsSort(object): - """Implementation of the 'List Subscription Components Sort' enum. Attributes: ID: The enum member of type str. UPDATED_AT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - ID = 'id' - UPDATED_AT = 'updated_at' + ID = "id" + + UPDATED_AT = "updated_at" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/list_subscription_group_prepayment.py b/advancedbilling/models/list_subscription_group_prepayment.py index 01a26f3e..bba51724 100644 --- a/advancedbilling/models/list_subscription_group_prepayment.py +++ b/advancedbilling/models/list_subscription_group_prepayment.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.list_subcription_group_prepayment_item import ListSubcriptionGroupPrepaymentItem +# ruff: noqa: E501 +from advancedbilling.models.list_subcription_group_prepayment_item import ( + ListSubcriptionGroupPrepaymentItem, +) -class ListSubscriptionGroupPrepayment(object): +class ListSubscriptionGroupPrepayment(object): """Implementation of the 'List Subscription Group Prepayment' model. Attributes: - prepayment (ListSubcriptionGroupPrepaymentItem): The model property of - type ListSubcriptionGroupPrepaymentItem. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayment (ListSubcriptionGroupPrepaymentItem): The model property of type + ListSubcriptionGroupPrepaymentItem. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayment": 'prepayment' + "prepayment": "prepayment", } - def __init__(self, - prepayment=None, - additional_properties=None): - """Constructor for the ListSubscriptionGroupPrepayment class""" - + def __init__( + self, + prepayment=None, + additional_properties=None): + """Initialize a ListSubscriptionGroupPrepayment instance.""" # Initialize members of the class - self.prepayment = prepayment + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepayment = ListSubcriptionGroupPrepaymentItem.from_dictionary(dictionary.get('prepayment')) if dictionary.get('prepayment') else None + prepayment =\ + ListSubcriptionGroupPrepaymentItem.from_dictionary( + dictionary.get("prepayment"))\ + if dictionary.get("prepayment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_group_prepayment_response.py b/advancedbilling/models/list_subscription_group_prepayment_response.py index 56987390..11eb4c96 100644 --- a/advancedbilling/models/list_subscription_group_prepayment_response.py +++ b/advancedbilling/models/list_subscription_group_prepayment_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.list_subscription_group_prepayment import ListSubscriptionGroupPrepayment +# ruff: noqa: E501 +from advancedbilling.models.list_subscription_group_prepayment import ( + ListSubscriptionGroupPrepayment, +) -class ListSubscriptionGroupPrepaymentResponse(object): +class ListSubscriptionGroupPrepaymentResponse(object): """Implementation of the 'List Subscription Group Prepayment Response' model. Attributes: - prepayments (List[ListSubscriptionGroupPrepayment]): The model - property of type List[ListSubscriptionGroupPrepayment]. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayments (List[ListSubscriptionGroupPrepayment]): The model property of + type List[ListSubscriptionGroupPrepayment]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayments": 'prepayments' + "prepayments": "prepayments", } - def __init__(self, - prepayments=None, - additional_properties=None): - """Constructor for the ListSubscriptionGroupPrepaymentResponse class""" - + def __init__( + self, + prepayments=None, + additional_properties=None): + """Initialize a ListSubscriptionGroupPrepaymentResponse instance.""" # Initialize members of the class - self.prepayments = prepayments + self.prepayments = prepayments # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary prepayments = None - if dictionary.get('prepayments') is not None: - prepayments = [ListSubscriptionGroupPrepayment.from_dictionary(x) for x in dictionary.get('prepayments')] + if dictionary.get("prepayments") is not None: + prepayments = [ + ListSubscriptionGroupPrepayment.from_dictionary(x) + for x in dictionary.get("prepayments") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayments, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayments={self.prepayments!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayments=self.prepayments + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayments={_prepayments!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayments={self.prepayments!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayments=self.prepayments + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayments={_prepayments!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_groups_item.py b/advancedbilling/models/list_subscription_groups_item.py index 5ab83a12..e1345fbf 100644 --- a/advancedbilling/models/list_subscription_groups_item.py +++ b/advancedbilling/models/list_subscription_groups_item.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_group_balances import SubscriptionGroupBalances +from advancedbilling.models.subscription_group_balances import ( + SubscriptionGroupBalances, +) class ListSubscriptionGroupsItem(object): - """Implementation of the 'List Subscription Groups Item' model. Attributes: @@ -24,81 +24,84 @@ class ListSubscriptionGroupsItem(object): next_assessment_at (datetime): The model property of type datetime. state (str): The model property of type str. cancel_at_end_of_period (bool): The model property of type bool. - account_balances (SubscriptionGroupBalances): The model property of - type SubscriptionGroupBalances. + account_balances (SubscriptionGroupBalances): The model property of type + SubscriptionGroupBalances. group_type (GroupType): The model property of type GroupType. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "scheme": 'scheme', - "customer_id": 'customer_id', - "payment_profile_id": 'payment_profile_id', - "subscription_ids": 'subscription_ids', - "primary_subscription_id": 'primary_subscription_id', - "next_assessment_at": 'next_assessment_at', - "state": 'state', - "cancel_at_end_of_period": 'cancel_at_end_of_period', - "account_balances": 'account_balances', - "group_type": 'group_type' + "uid": "uid", + "scheme": "scheme", + "customer_id": "customer_id", + "payment_profile_id": "payment_profile_id", + "subscription_ids": "subscription_ids", + "primary_subscription_id": "primary_subscription_id", + "next_assessment_at": "next_assessment_at", + "state": "state", + "cancel_at_end_of_period": "cancel_at_end_of_period", + "account_balances": "account_balances", + "group_type": "group_type", } _optionals = [ - 'uid', - 'scheme', - 'customer_id', - 'payment_profile_id', - 'subscription_ids', - 'primary_subscription_id', - 'next_assessment_at', - 'state', - 'cancel_at_end_of_period', - 'account_balances', - 'group_type', + "uid", + "scheme", + "customer_id", + "payment_profile_id", + "subscription_ids", + "primary_subscription_id", + "next_assessment_at", + "state", + "cancel_at_end_of_period", + "account_balances", + "group_type", ] - def __init__(self, - uid=APIHelper.SKIP, - scheme=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - subscription_ids=APIHelper.SKIP, - primary_subscription_id=APIHelper.SKIP, - next_assessment_at=APIHelper.SKIP, - state=APIHelper.SKIP, - cancel_at_end_of_period=APIHelper.SKIP, - account_balances=APIHelper.SKIP, - group_type=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSubscriptionGroupsItem class""" - + def __init__( + self, + uid=APIHelper.SKIP, + scheme=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + subscription_ids=APIHelper.SKIP, + primary_subscription_id=APIHelper.SKIP, + next_assessment_at=APIHelper.SKIP, + state=APIHelper.SKIP, + cancel_at_end_of_period=APIHelper.SKIP, + account_balances=APIHelper.SKIP, + group_type=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSubscriptionGroupsItem instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if scheme is not APIHelper.SKIP: - self.scheme = scheme + self.scheme = scheme if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if subscription_ids is not APIHelper.SKIP: - self.subscription_ids = subscription_ids + self.subscription_ids = subscription_ids if primary_subscription_id is not APIHelper.SKIP: - self.primary_subscription_id = primary_subscription_id + self.primary_subscription_id = primary_subscription_id if next_assessment_at is not APIHelper.SKIP: - self.next_assessment_at = APIHelper.apply_datetime_converter(next_assessment_at, APIHelper.RFC3339DateTime) if next_assessment_at else None + self.next_assessment_at =\ + APIHelper.apply_datetime_converter( + next_assessment_at, APIHelper.RFC3339DateTime)\ + if next_assessment_at else None if state is not APIHelper.SKIP: - self.state = state + self.state = state if cancel_at_end_of_period is not APIHelper.SKIP: - self.cancel_at_end_of_period = cancel_at_end_of_period + self.cancel_at_end_of_period = cancel_at_end_of_period if account_balances is not APIHelper.SKIP: - self.account_balances = account_balances + self.account_balances = account_balances if group_type is not APIHelper.SKIP: - self.group_type = group_type + self.group_type = group_type # Add additional model properties to the instance if additional_properties is None: @@ -108,7 +111,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -119,24 +122,59 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - scheme = dictionary.get("scheme") if dictionary.get("scheme") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - subscription_ids = dictionary.get("subscription_ids") if dictionary.get("subscription_ids") else APIHelper.SKIP - primary_subscription_id = dictionary.get("primary_subscription_id") if dictionary.get("primary_subscription_id") else APIHelper.SKIP - next_assessment_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_assessment_at")).datetime if dictionary.get("next_assessment_at") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - cancel_at_end_of_period = dictionary.get("cancel_at_end_of_period") if "cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP - account_balances = SubscriptionGroupBalances.from_dictionary(dictionary.get('account_balances')) if 'account_balances' in dictionary.keys() else APIHelper.SKIP - group_type = dictionary.get("group_type") if dictionary.get("group_type") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + scheme =\ + dictionary.get("scheme")\ + if dictionary.get("scheme")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + subscription_ids =\ + dictionary.get("subscription_ids")\ + if dictionary.get("subscription_ids")\ + else APIHelper.SKIP + primary_subscription_id =\ + dictionary.get("primary_subscription_id")\ + if dictionary.get("primary_subscription_id")\ + else APIHelper.SKIP + next_assessment_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_assessment_at")).datetime\ + if dictionary.get("next_assessment_at") else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + cancel_at_end_of_period =\ + dictionary.get("cancel_at_end_of_period")\ + if "cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP + account_balances =\ + SubscriptionGroupBalances.from_dictionary( + dictionary.get("account_balances"))\ + if "account_balances" in dictionary.keys()\ + else APIHelper.SKIP + group_type =\ + dictionary.get("group_type")\ + if dictionary.get("group_type")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, scheme, @@ -152,31 +190,151 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!r}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!r}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!r}, ' - f'account_balances={(self.account_balances if hasattr(self, "account_balances") else None)!r}, ' - f'group_type={(self.group_type if hasattr(self, "group_type") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _account_balances=( + self.account_balances + if hasattr(self, "account_balances") + else None + ) + _group_type=( + self.group_type + if hasattr(self, "group_type") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"scheme={_scheme!r}, " + f"customer_id={_customer_id!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"subscription_ids={_subscription_ids!r}, " + f"primary_subscription_id={_primary_subscription_id!r}, " + f"next_assessment_at={_next_assessment_at!r}, " + f"state={_state!r}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!r}, " + f"account_balances={_account_balances!r}, " + f"group_type={_group_type!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!s}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!s}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!s}, ' - f'account_balances={(self.account_balances if hasattr(self, "account_balances") else None)!s}, ' - f'group_type={(self.group_type if hasattr(self, "group_type") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _account_balances=( + self.account_balances + if hasattr(self, "account_balances") + else None + ) + _group_type=( + self.group_type + if hasattr(self, "group_type") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"scheme={_scheme!s}, " + f"customer_id={_customer_id!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"subscription_ids={_subscription_ids!s}, " + f"primary_subscription_id={_primary_subscription_id!s}, " + f"next_assessment_at={_next_assessment_at!s}, " + f"state={_state!s}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!s}, " + f"account_balances={_account_balances!s}, " + f"group_type={_group_type!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_groups_meta.py b/advancedbilling/models/list_subscription_groups_meta.py index 8cd298a1..958d398a 100644 --- a/advancedbilling/models/list_subscription_groups_meta.py +++ b/advancedbilling/models/list_subscription_groups_meta.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ListSubscriptionGroupsMeta(object): - """Implementation of the 'List Subscription Groups Meta' model. Attributes: current_page (int): The model property of type int. total_count (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "current_page": 'current_page', - "total_count": 'total_count' + "current_page": "current_page", + "total_count": "total_count", } _optionals = [ - 'current_page', - 'total_count', + "current_page", + "total_count", ] - def __init__(self, - current_page=APIHelper.SKIP, - total_count=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSubscriptionGroupsMeta class""" - + def __init__( + self, + current_page=APIHelper.SKIP, + total_count=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSubscriptionGroupsMeta instance.""" # Initialize members of the class if current_page is not APIHelper.SKIP: - self.current_page = current_page + self.current_page = current_page if total_count is not APIHelper.SKIP: - self.total_count = total_count + self.total_count = total_count # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - current_page = dictionary.get("current_page") if dictionary.get("current_page") else APIHelper.SKIP - total_count = dictionary.get("total_count") if dictionary.get("total_count") else APIHelper.SKIP + current_page =\ + dictionary.get("current_page")\ + if dictionary.get("current_page")\ + else APIHelper.SKIP + total_count =\ + dictionary.get("total_count")\ + if dictionary.get("total_count")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(current_page, total_count, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!r}, ' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_page={_current_page!r}, " + f"total_count={_total_count!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!s}, ' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_page={_current_page!s}, " + f"total_count={_total_count!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/list_subscription_groups_response.py b/advancedbilling/models/list_subscription_groups_response.py index 82f79966..b1c77b20 100644 --- a/advancedbilling/models/list_subscription_groups_response.py +++ b/advancedbilling/models/list_subscription_groups_response.py @@ -1,52 +1,54 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.list_subscription_groups_item import ListSubscriptionGroupsItem -from advancedbilling.models.list_subscription_groups_meta import ListSubscriptionGroupsMeta +from advancedbilling.models.list_subscription_groups_item import ( + ListSubscriptionGroupsItem, +) +from advancedbilling.models.list_subscription_groups_meta import ( + ListSubscriptionGroupsMeta, +) class ListSubscriptionGroupsResponse(object): - """Implementation of the 'List Subscription Groups Response' model. Attributes: - subscription_groups (List[ListSubscriptionGroupsItem]): The model - property of type List[ListSubscriptionGroupsItem]. + subscription_groups (List[ListSubscriptionGroupsItem]): The model property of + type List[ListSubscriptionGroupsItem]. meta (ListSubscriptionGroupsMeta): The model property of type ListSubscriptionGroupsMeta. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_groups": 'subscription_groups', - "meta": 'meta' + "subscription_groups": "subscription_groups", + "meta": "meta", } _optionals = [ - 'subscription_groups', - 'meta', + "subscription_groups", + "meta", ] - def __init__(self, - subscription_groups=APIHelper.SKIP, - meta=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ListSubscriptionGroupsResponse class""" - + def __init__( + self, + subscription_groups=APIHelper.SKIP, + meta=APIHelper.SKIP, + additional_properties=None): + """Initialize a ListSubscriptionGroupsResponse instance.""" # Initialize members of the class if subscription_groups is not APIHelper.SKIP: - self.subscription_groups = subscription_groups + self.subscription_groups = subscription_groups if meta is not APIHelper.SKIP: - self.meta = meta + self.meta = meta # Add additional model properties to the instance if additional_properties is None: @@ -56,7 +58,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -67,32 +69,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary subscription_groups = None - if dictionary.get('subscription_groups') is not None: - subscription_groups = [ListSubscriptionGroupsItem.from_dictionary(x) for x in dictionary.get('subscription_groups')] + if dictionary.get("subscription_groups") is not None: + subscription_groups = [ + ListSubscriptionGroupsItem.from_dictionary(x) + for x in dictionary.get("subscription_groups") + ] else: subscription_groups = APIHelper.SKIP - meta = ListSubscriptionGroupsMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP + meta =\ + ListSubscriptionGroupsMeta.from_dictionary( + dictionary.get("meta"))\ + if "meta" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_groups, meta, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_groups={(self.subscription_groups if hasattr(self, "subscription_groups") else None)!r}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_groups=( + self.subscription_groups + if hasattr(self, "subscription_groups") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_groups={_subscription_groups!r}, " + f"meta={_meta!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_groups={(self.subscription_groups if hasattr(self, "subscription_groups") else None)!s}, ' - f'meta={(self.meta if hasattr(self, "meta") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_groups=( + self.subscription_groups + if hasattr(self, "subscription_groups") + else None + ) + _meta=( + self.meta + if hasattr(self, "meta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_groups={_subscription_groups!s}, " + f"meta={_meta!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/metadata.py b/advancedbilling/models/metadata.py index 65330f43..33871353 100644 --- a/advancedbilling/models/metadata.py +++ b/advancedbilling/models/metadata.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Metadata(object): - """Implementation of the 'Metadata' model. Attributes: @@ -20,61 +18,64 @@ class Metadata(object): name (str): The model property of type str. deleted_at (datetime): The model property of type datetime. metafield_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "value": 'value', - "resource_id": 'resource_id', - "name": 'name', - "deleted_at": 'deleted_at', - "metafield_id": 'metafield_id' + "id": "id", + "value": "value", + "resource_id": "resource_id", + "name": "name", + "deleted_at": "deleted_at", + "metafield_id": "metafield_id", } _optionals = [ - 'id', - 'value', - 'resource_id', - 'name', - 'deleted_at', - 'metafield_id', + "id", + "value", + "resource_id", + "name", + "deleted_at", + "metafield_id", ] _nullables = [ - 'id', - 'value', - 'resource_id', - 'deleted_at', - 'metafield_id', + "id", + "value", + "resource_id", + "deleted_at", + "metafield_id", ] - def __init__(self, - id=APIHelper.SKIP, - value=APIHelper.SKIP, - resource_id=APIHelper.SKIP, - name=APIHelper.SKIP, - deleted_at=APIHelper.SKIP, - metafield_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Metadata class""" - + def __init__( + self, + id=APIHelper.SKIP, + value=APIHelper.SKIP, + resource_id=APIHelper.SKIP, + name=APIHelper.SKIP, + deleted_at=APIHelper.SKIP, + metafield_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a Metadata instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if value is not APIHelper.SKIP: - self.value = value + self.value = value if resource_id is not APIHelper.SKIP: - self.resource_id = resource_id + self.resource_id = resource_id if name is not APIHelper.SKIP: - self.name = name + self.name = name if deleted_at is not APIHelper.SKIP: - self.deleted_at = APIHelper.apply_datetime_converter(deleted_at, APIHelper.RFC3339DateTime) if deleted_at else None + self.deleted_at =\ + APIHelper.apply_datetime_converter( + deleted_at, APIHelper.RFC3339DateTime)\ + if deleted_at else None if metafield_id is not APIHelper.SKIP: - self.metafield_id = metafield_id + self.metafield_id = metafield_id # Add additional model properties to the instance if additional_properties is None: @@ -84,7 +85,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -95,22 +96,42 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if "id" in dictionary.keys() else APIHelper.SKIP - value = dictionary.get("value") if "value" in dictionary.keys() else APIHelper.SKIP - resource_id = dictionary.get("resource_id") if "resource_id" in dictionary.keys() else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - if 'deleted_at' in dictionary.keys(): - deleted_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("deleted_at")).datetime if dictionary.get("deleted_at") else None + id =\ + dictionary.get("id")\ + if "id" in dictionary.keys()\ + else APIHelper.SKIP + value =\ + dictionary.get("value")\ + if "value" in dictionary.keys()\ + else APIHelper.SKIP + resource_id =\ + dictionary.get("resource_id")\ + if "resource_id" in dictionary.keys()\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + if "deleted_at" in dictionary.keys(): + deleted_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("deleted_at")).datetime\ + if dictionary.get("deleted_at") else None + else: deleted_at = APIHelper.SKIP - metafield_id = dictionary.get("metafield_id") if "metafield_id" in dictionary.keys() else APIHelper.SKIP + metafield_id =\ + dictionary.get("metafield_id")\ + if "metafield_id" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, value, @@ -121,21 +142,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'value={(self.value if hasattr(self, "value") else None)!r}, ' - f'resource_id={(self.resource_id if hasattr(self, "resource_id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'deleted_at={(self.deleted_at if hasattr(self, "deleted_at") else None)!r}, ' - f'metafield_id={(self.metafield_id if hasattr(self, "metafield_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _resource_id=( + self.resource_id + if hasattr(self, "resource_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _deleted_at=( + self.deleted_at + if hasattr(self, "deleted_at") + else None + ) + _metafield_id=( + self.metafield_id + if hasattr(self, "metafield_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"value={_value!r}, " + f"resource_id={_resource_id!r}, " + f"name={_name!r}, " + f"deleted_at={_deleted_at!r}, " + f"metafield_id={_metafield_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'value={(self.value if hasattr(self, "value") else None)!s}, ' - f'resource_id={(self.resource_id if hasattr(self, "resource_id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'deleted_at={(self.deleted_at if hasattr(self, "deleted_at") else None)!s}, ' - f'metafield_id={(self.metafield_id if hasattr(self, "metafield_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _resource_id=( + self.resource_id + if hasattr(self, "resource_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _deleted_at=( + self.deleted_at + if hasattr(self, "deleted_at") + else None + ) + _metafield_id=( + self.metafield_id + if hasattr(self, "metafield_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"value={_value!s}, " + f"resource_id={_resource_id!s}, " + f"name={_name!s}, " + f"deleted_at={_deleted_at!s}, " + f"metafield_id={_metafield_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/metafield.py b/advancedbilling/models/metafield.py index 6b5c60d6..3eae69ff 100644 --- a/advancedbilling/models/metafield.py +++ b/advancedbilling/models/metafield.py @@ -1,83 +1,83 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.metafield_scope import MetafieldScope +from advancedbilling.models.metafield_scope import ( + MetafieldScope, +) class Metafield(object): - """Implementation of the 'Metafield' model. Attributes: id (int): The model property of type int. name (str): The model property of type str. - scope (MetafieldScope): Warning: When updating a metafield's scope - attribute, all scope attributes must be passed. Partially complete - scope attributes will override the existing settings. - data_count (int): The amount of subscriptions this metafield has been - applied to in Advanced Billing. + scope (MetafieldScope): Warning: When updating a metafield's scope attribute, + all scope attributes must be passed. Partially complete scope attributes + will override the existing settings. + data_count (int): The amount of subscriptions this metafield has been applied + to in Advanced Billing. input_type (MetafieldInput): Indicates the type of metafield. A text - metafield allows any string value. Dropdown and radio metafields - have a set of values that can be selected. Defaults to 'text'. - enum (str | List[str] | None): The model property of type str | - List[str] | None. - additional_properties (Dict[str, object]): The additional properties - for the model. + metafield allows any string value. Dropdown and radio metafields have a + set of values that can be selected. Defaults to 'text'. + enum (str | List[str] | None): The model property of type str | List[str] | + None. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "scope": 'scope', - "data_count": 'data_count', - "input_type": 'input_type', - "enum": 'enum' + "id": "id", + "name": "name", + "scope": "scope", + "data_count": "data_count", + "input_type": "input_type", + "enum": "enum", } _optionals = [ - 'id', - 'name', - 'scope', - 'data_count', - 'input_type', - 'enum', + "id", + "name", + "scope", + "data_count", + "input_type", + "enum", ] _nullables = [ - 'enum', + "enum", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - scope=APIHelper.SKIP, - data_count=APIHelper.SKIP, - input_type=APIHelper.SKIP, - enum=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Metafield class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + scope=APIHelper.SKIP, + data_count=APIHelper.SKIP, + input_type=APIHelper.SKIP, + enum=APIHelper.SKIP, + additional_properties=None): + """Initialize a Metafield instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if scope is not APIHelper.SKIP: - self.scope = scope + self.scope = scope if data_count is not APIHelper.SKIP: - self.data_count = data_count + self.data_count = data_count if input_type is not APIHelper.SKIP: - self.input_type = input_type + self.input_type = input_type if enum is not APIHelper.SKIP: - self.enum = enum + self.enum = enum # Add additional model properties to the instance if additional_properties is None: @@ -87,7 +87,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -98,23 +98,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - scope = MetafieldScope.from_dictionary(dictionary.get('scope')) if 'scope' in dictionary.keys() else APIHelper.SKIP - data_count = dictionary.get("data_count") if dictionary.get("data_count") else APIHelper.SKIP - input_type = dictionary.get("input_type") if dictionary.get("input_type") else APIHelper.SKIP - if 'enum' in dictionary.keys(): - enum = APIHelper.deserialize_union_type(UnionTypeLookUp.get('MetafieldEnum'), dictionary.get('enum'), False) if dictionary.get('enum') is not None else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + scope =\ + MetafieldScope.from_dictionary( + dictionary.get("scope"))\ + if "scope" in dictionary.keys()\ + else APIHelper.SKIP + data_count =\ + dictionary.get("data_count")\ + if dictionary.get("data_count")\ + else APIHelper.SKIP + input_type =\ + dictionary.get("input_type")\ + if dictionary.get("input_type")\ + else APIHelper.SKIP + if "enum" in dictionary.keys(): + enum = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("MetafieldEnum"), + dictionary.get("enum"), + False)\ + if dictionary.get("enum") is not None\ + else None else: enum = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -125,21 +151,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'scope={(self.scope if hasattr(self, "scope") else None)!r}, ' - f'data_count={(self.data_count if hasattr(self, "data_count") else None)!r}, ' - f'input_type={(self.input_type if hasattr(self, "input_type") else None)!r}, ' - f'enum={(self.enum if hasattr(self, "enum") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _scope=( + self.scope + if hasattr(self, "scope") + else None + ) + _data_count=( + self.data_count + if hasattr(self, "data_count") + else None + ) + _input_type=( + self.input_type + if hasattr(self, "input_type") + else None + ) + _enum=( + self.enum + if hasattr(self, "enum") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"scope={_scope!r}, " + f"data_count={_data_count!r}, " + f"input_type={_input_type!r}, " + f"enum={_enum!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'scope={(self.scope if hasattr(self, "scope") else None)!s}, ' - f'data_count={(self.data_count if hasattr(self, "data_count") else None)!s}, ' - f'input_type={(self.input_type if hasattr(self, "input_type") else None)!s}, ' - f'enum={(self.enum if hasattr(self, "enum") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _scope=( + self.scope + if hasattr(self, "scope") + else None + ) + _data_count=( + self.data_count + if hasattr(self, "data_count") + else None + ) + _input_type=( + self.input_type + if hasattr(self, "input_type") + else None + ) + _enum=( + self.enum + if hasattr(self, "enum") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"scope={_scope!s}, " + f"data_count={_data_count!s}, " + f"input_type={_input_type!s}, " + f"enum={_enum!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/metafield_input.py b/advancedbilling/models/metafield_input.py index 7de4a54b..024fa7ee 100644 --- a/advancedbilling/models/metafield_input.py +++ b/advancedbilling/models/metafield_input.py @@ -1,19 +1,16 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class MetafieldInput(object): - """Implementation of the 'Metafield Input' enum. Indicates the type of metafield. A text metafield allows any string value. - Dropdown and radio metafields have a set of values that can be selected. + Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. Attributes: @@ -21,22 +18,23 @@ class MetafieldInput(object): TEXT: The enum member of type str. RADIO: The enum member of type str. DROPDOWN: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['balance_tracker', 'text', 'radio', 'dropdown'] - BALANCE_TRACKER = 'balance_tracker' - TEXT = 'text' + _all_values = ["balance_tracker", "text", "radio", "dropdown"] + BALANCE_TRACKER = "balance_tracker" - RADIO = 'radio' + TEXT = "text" - DROPDOWN = 'dropdown' + RADIO = "radio" + + DROPDOWN = "dropdown" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -46,9 +44,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/metafield_scope.py b/advancedbilling/models/metafield_scope.py index 0108c9b2..6b2ea059 100644 --- a/advancedbilling/models/metafield_scope.py +++ b/advancedbilling/models/metafield_scope.py @@ -1,92 +1,88 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class MetafieldScope(object): - """Implementation of the 'Metafield Scope' model. - Warning: When updating a metafield's scope attribute, all scope attributes - must be passed. Partially complete scope attributes will override the - existing settings. + Warning: When updating a metafield's scope attribute, all scope attributes must + be passed. Partially complete scope attributes will override the existing + settings. Attributes: - csv (IncludeOption): Include (1) or exclude (0) metafields from the - csv export. - invoices (IncludeOption): Include (1) or exclude (0) metafields from - invoices. + csv (IncludeOption): Include (1) or exclude (0) metafields from the csv + export. + invoices (IncludeOption): Include (1) or exclude (0) metafields from invoices. statements (IncludeOption): Include (1) or exclude (0) metafields from statements. - portal (IncludeOption): Include (1) or exclude (0) metafields from the - portal. - public_show (IncludeOption): Include (1) or exclude (0) metafields - used in [Embeddable - Components](page:development-tools/embeddable-components/overview) - from being viewable by your ecosystem. - public_edit (IncludeOption): Include (1) or exclude (0) metafields - used in [Embeddable - Components](page:development-tools/embeddable-components/overview) - from being editable by your ecosystem. + portal (IncludeOption): Include (1) or exclude (0) metafields from the portal. + public_show (IncludeOption): Include (1) or exclude (0) metafields used in + [Embeddable + Components](page:development-tools/embeddable-components/overview) from + being viewable by your ecosystem. + public_edit (IncludeOption): Include (1) or exclude (0) metafields used in + [Embeddable + Components](page:development-tools/embeddable-components/overview) from + being editable by your ecosystem. hosted (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "csv": 'csv', - "invoices": 'invoices', - "statements": 'statements', - "portal": 'portal', - "public_show": 'public_show', - "public_edit": 'public_edit', - "hosted": 'hosted' + "csv": "csv", + "invoices": "invoices", + "statements": "statements", + "portal": "portal", + "public_show": "public_show", + "public_edit": "public_edit", + "hosted": "hosted", } _optionals = [ - 'csv', - 'invoices', - 'statements', - 'portal', - 'public_show', - 'public_edit', - 'hosted', + "csv", + "invoices", + "statements", + "portal", + "public_show", + "public_edit", + "hosted", ] - def __init__(self, - csv=APIHelper.SKIP, - invoices=APIHelper.SKIP, - statements=APIHelper.SKIP, - portal=APIHelper.SKIP, - public_show=APIHelper.SKIP, - public_edit=APIHelper.SKIP, - hosted=APIHelper.SKIP, - additional_properties=None): - """Constructor for the MetafieldScope class""" - + def __init__( + self, + csv=APIHelper.SKIP, + invoices=APIHelper.SKIP, + statements=APIHelper.SKIP, + portal=APIHelper.SKIP, + public_show=APIHelper.SKIP, + public_edit=APIHelper.SKIP, + hosted=APIHelper.SKIP, + additional_properties=None): + """Initialize a MetafieldScope instance.""" # Initialize members of the class if csv is not APIHelper.SKIP: - self.csv = csv + self.csv = csv if invoices is not APIHelper.SKIP: - self.invoices = invoices + self.invoices = invoices if statements is not APIHelper.SKIP: - self.statements = statements + self.statements = statements if portal is not APIHelper.SKIP: - self.portal = portal + self.portal = portal if public_show is not APIHelper.SKIP: - self.public_show = public_show + self.public_show = public_show if public_edit is not APIHelper.SKIP: - self.public_edit = public_edit + self.public_edit = public_edit if hosted is not APIHelper.SKIP: - self.hosted = hosted + self.hosted = hosted # Add additional model properties to the instance if additional_properties is None: @@ -96,7 +92,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -107,20 +103,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - csv = dictionary.get("csv") if dictionary.get("csv") else APIHelper.SKIP - invoices = dictionary.get("invoices") if dictionary.get("invoices") else APIHelper.SKIP - statements = dictionary.get("statements") if dictionary.get("statements") else APIHelper.SKIP - portal = dictionary.get("portal") if dictionary.get("portal") else APIHelper.SKIP - public_show = dictionary.get("public_show") if dictionary.get("public_show") else APIHelper.SKIP - public_edit = dictionary.get("public_edit") if dictionary.get("public_edit") else APIHelper.SKIP - hosted = dictionary.get("hosted") if dictionary.get("hosted") else APIHelper.SKIP + csv =\ + dictionary.get("csv")\ + if dictionary.get("csv")\ + else APIHelper.SKIP + invoices =\ + dictionary.get("invoices")\ + if dictionary.get("invoices")\ + else APIHelper.SKIP + statements =\ + dictionary.get("statements")\ + if dictionary.get("statements")\ + else APIHelper.SKIP + portal =\ + dictionary.get("portal")\ + if dictionary.get("portal")\ + else APIHelper.SKIP + public_show =\ + dictionary.get("public_show")\ + if dictionary.get("public_show")\ + else APIHelper.SKIP + public_edit =\ + dictionary.get("public_edit")\ + if dictionary.get("public_edit")\ + else APIHelper.SKIP + hosted =\ + dictionary.get("hosted")\ + if dictionary.get("hosted")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(csv, invoices, @@ -133,7 +152,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -144,7 +163,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -154,23 +172,103 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'csv={(self.csv if hasattr(self, "csv") else None)!r}, ' - f'invoices={(self.invoices if hasattr(self, "invoices") else None)!r}, ' - f'statements={(self.statements if hasattr(self, "statements") else None)!r}, ' - f'portal={(self.portal if hasattr(self, "portal") else None)!r}, ' - f'public_show={(self.public_show if hasattr(self, "public_show") else None)!r}, ' - f'public_edit={(self.public_edit if hasattr(self, "public_edit") else None)!r}, ' - f'hosted={(self.hosted if hasattr(self, "hosted") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _csv=( + self.csv + if hasattr(self, "csv") + else None + ) + _invoices=( + self.invoices + if hasattr(self, "invoices") + else None + ) + _statements=( + self.statements + if hasattr(self, "statements") + else None + ) + _portal=( + self.portal + if hasattr(self, "portal") + else None + ) + _public_show=( + self.public_show + if hasattr(self, "public_show") + else None + ) + _public_edit=( + self.public_edit + if hasattr(self, "public_edit") + else None + ) + _hosted=( + self.hosted + if hasattr(self, "hosted") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"csv={_csv!r}, " + f"invoices={_invoices!r}, " + f"statements={_statements!r}, " + f"portal={_portal!r}, " + f"public_show={_public_show!r}, " + f"public_edit={_public_edit!r}, " + f"hosted={_hosted!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'csv={(self.csv if hasattr(self, "csv") else None)!s}, ' - f'invoices={(self.invoices if hasattr(self, "invoices") else None)!s}, ' - f'statements={(self.statements if hasattr(self, "statements") else None)!s}, ' - f'portal={(self.portal if hasattr(self, "portal") else None)!s}, ' - f'public_show={(self.public_show if hasattr(self, "public_show") else None)!s}, ' - f'public_edit={(self.public_edit if hasattr(self, "public_edit") else None)!s}, ' - f'hosted={(self.hosted if hasattr(self, "hosted") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _csv=( + self.csv + if hasattr(self, "csv") + else None + ) + _invoices=( + self.invoices + if hasattr(self, "invoices") + else None + ) + _statements=( + self.statements + if hasattr(self, "statements") + else None + ) + _portal=( + self.portal + if hasattr(self, "portal") + else None + ) + _public_show=( + self.public_show + if hasattr(self, "public_show") + else None + ) + _public_edit=( + self.public_edit + if hasattr(self, "public_edit") + else None + ) + _hosted=( + self.hosted + if hasattr(self, "hosted") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"csv={_csv!s}, " + f"invoices={_invoices!s}, " + f"statements={_statements!s}, " + f"portal={_portal!s}, " + f"public_show={_public_show!s}, " + f"public_edit={_public_edit!s}, " + f"hosted={_hosted!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/metered_component.py b/advancedbilling/models/metered_component.py index 3df342e1..0107efda 100644 --- a/advancedbilling/models/metered_component.py +++ b/advancedbilling/models/metered_component.py @@ -1,166 +1,161 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.component_price_point_item import ( + ComponentPricePointItem, +) from advancedbilling.models.price import Price class MeteredComponent(object): - """Implementation of the 'Metered Component' model. Attributes: - name (str): A name for this component that is suitable for showing - customers and displaying on billing statements, ie. "Minutes". - unit_name (str): The name of the unit of measurement for the - component. It should be singular since it will be automatically - pluralized when necessary. i.e. “message”, which may then be shown - as “5 messages” on a subscription’s component line-item - description (str): A description for the component that will be - displayed to the user on the hosted signup page. - handle (str): A unique identifier for your use that can be used to - retrieve this component is subsequent requests. Must start with a - letter or number and may only contain lowercase letters, numbers, - or the characters '.', ':', '-', or '_'. - taxable (bool): Boolean flag describing whether a component is taxable - or not. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. - prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) - One or more price brackets. See [Price Bracket - Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-C - omponent-Pricing-Schemes#price-bracket-rules) for an overview of - how price brackets work for different pricing schemes. - price_points (List[ComponentPricePointItem]): The model property of - type List[ComponentPricePointItem]. - unit_price (str | float | None): The amount the customer will be - charged per unit when the pricing scheme is “per_unit”. For On/Off - Components, this is the amount that the customer will be charged - when they turn the component on for the subscription. The price - can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or - 0.00000065 - tax_code (str): A string representing the tax code related to the - component type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. - hide_date_range_on_invoice (bool): (Only available on Relationship - Invoicing sites) Boolean flag describing if the service date range - should show for the component on generated invoices. + name (str): A name for this component that is suitable for showing customers + and displaying on billing statements, ie. "Minutes". + unit_name (str): The name of the unit of measurement for the component. It + should be singular since it will be automatically pluralized when + necessary. i.e. “message”, which may then be shown as “5 messages” on a + subscription’s component line-item + description (str): A description for the component that will be displayed to + the user on the hosted signup page. + handle (str): A unique identifier for your use that can be used to retrieve + this component is subsequent requests. Must start with a letter or + number and may only contain lowercase letters, numbers, or the characters + '.', ':', '-', or '_'. + taxable (bool): Boolean flag describing whether a component is taxable or not. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. + prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) One or + more price brackets. See [Price Bracket + Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Componen + t-Pricing-Schemes#price-bracket-rules) for an overview of how price + brackets work for different pricing schemes. + price_points (List[ComponentPricePointItem]): The model property of type + List[ComponentPricePointItem]. + unit_price (str | float | None): The amount the customer will be charged per + unit when the pricing scheme is “per_unit”. For On/Off Components, this + is the amount that the customer will be charged when they turn the + component on for the subscription. The price can contain up to 8 decimal + places. i.e. 1.00 or 0.0012 or 0.00000065 + tax_code (str): A string representing the tax code related to the component + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. + hide_date_range_on_invoice (bool): (Only available on Relationship Invoicing + sites) Boolean flag describing if the service date range should show for + the component on generated invoices. display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. - public_signup_page_ids (List[int]): The model property of type - List[int]. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component's - default price point would renew every 30 days. This property is - only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component's default price point, either month or day. - This property is only available for sites with Multifrequency - enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + public_signup_page_ids (List[int]): The model property of type List[int]. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component's default price point + would renew every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component's default price point, either month or day. This property + is only available for sites with Multifrequency enabled. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "unit_name": 'unit_name', - "pricing_scheme": 'pricing_scheme', - "description": 'description', - "handle": 'handle', - "taxable": 'taxable', - "prices": 'prices', - "price_points": 'price_points', - "unit_price": 'unit_price', - "tax_code": 'tax_code', - "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "display_on_hosted_page": 'display_on_hosted_page', - "allow_fractional_quantities": 'allow_fractional_quantities', - "public_signup_page_ids": 'public_signup_page_ids', - "interval": 'interval', - "interval_unit": 'interval_unit' + "name": "name", + "unit_name": "unit_name", + "pricing_scheme": "pricing_scheme", + "description": "description", + "handle": "handle", + "taxable": "taxable", + "prices": "prices", + "price_points": "price_points", + "unit_price": "unit_price", + "tax_code": "tax_code", + "hide_date_range_on_invoice": "hide_date_range_on_invoice", + "display_on_hosted_page": "display_on_hosted_page", + "allow_fractional_quantities": "allow_fractional_quantities", + "public_signup_page_ids": "public_signup_page_ids", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'description', - 'handle', - 'taxable', - 'prices', - 'price_points', - 'unit_price', - 'tax_code', - 'hide_date_range_on_invoice', - 'display_on_hosted_page', - 'allow_fractional_quantities', - 'public_signup_page_ids', - 'interval', - 'interval_unit', + "description", + "handle", + "taxable", + "prices", + "price_points", + "unit_price", + "tax_code", + "hide_date_range_on_invoice", + "display_on_hosted_page", + "allow_fractional_quantities", + "public_signup_page_ids", + "interval", + "interval_unit", ] _nullables = [ - 'interval_unit', + "interval_unit", ] - def __init__(self, - name=None, - unit_name=None, - pricing_scheme=None, - description=APIHelper.SKIP, - handle=APIHelper.SKIP, - taxable=APIHelper.SKIP, - prices=APIHelper.SKIP, - price_points=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - hide_date_range_on_invoice=APIHelper.SKIP, - display_on_hosted_page=APIHelper.SKIP, - allow_fractional_quantities=APIHelper.SKIP, - public_signup_page_ids=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the MeteredComponent class""" - + def __init__( + self, + name=None, + unit_name=None, + pricing_scheme=None, + description=APIHelper.SKIP, + handle=APIHelper.SKIP, + taxable=APIHelper.SKIP, + prices=APIHelper.SKIP, + price_points=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + hide_date_range_on_invoice=APIHelper.SKIP, + display_on_hosted_page=APIHelper.SKIP, + allow_fractional_quantities=APIHelper.SKIP, + public_signup_page_ids=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a MeteredComponent instance.""" # Initialize members of the class - self.name = name - self.unit_name = unit_name + self.name = name + self.unit_name = unit_name if description is not APIHelper.SKIP: - self.description = description + self.description = description if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if taxable is not APIHelper.SKIP: - self.taxable = taxable - self.pricing_scheme = pricing_scheme + self.taxable = taxable + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices if price_points is not APIHelper.SKIP: - self.price_points = price_points + self.price_points = price_points if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if hide_date_range_on_invoice is not APIHelper.SKIP: - self.hide_date_range_on_invoice = hide_date_range_on_invoice + self.hide_date_range_on_invoice = hide_date_range_on_invoice if display_on_hosted_page is not APIHelper.SKIP: - self.display_on_hosted_page = display_on_hosted_page + self.display_on_hosted_page = display_on_hosted_page if allow_fractional_quantities is not APIHelper.SKIP: - self.allow_fractional_quantities = allow_fractional_quantities + self.allow_fractional_quantities = allow_fractional_quantities if public_signup_page_ids is not APIHelper.SKIP: - self.public_signup_page_ids = public_signup_page_ids + self.public_signup_page_ids = public_signup_page_ids if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -170,7 +165,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -181,38 +176,93 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - unit_name = dictionary.get("unit_name") if dictionary.get("unit_name") else None - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + unit_name =\ + dictionary.get("unit_name")\ + if dictionary.get("unit_name")\ + else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP price_points = None - if dictionary.get('price_points') is not None: - price_points = [ComponentPricePointItem.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ComponentPricePointItem.from_dictionary(x) + for x in dictionary.get("price_points") + ] else: price_points = APIHelper.SKIP - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('MeteredComponentUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP - hide_date_range_on_invoice = dictionary.get("hide_date_range_on_invoice") if "hide_date_range_on_invoice" in dictionary.keys() else APIHelper.SKIP - display_on_hosted_page = dictionary.get("display_on_hosted_page") if "display_on_hosted_page" in dictionary.keys() else APIHelper.SKIP - allow_fractional_quantities = dictionary.get("allow_fractional_quantities") if "allow_fractional_quantities" in dictionary.keys() else APIHelper.SKIP - public_signup_page_ids = dictionary.get("public_signup_page_ids") if dictionary.get("public_signup_page_ids") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("MeteredComponentUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + hide_date_range_on_invoice =\ + dictionary.get("hide_date_range_on_invoice")\ + if "hide_date_range_on_invoice" in dictionary.keys()\ + else APIHelper.SKIP + display_on_hosted_page =\ + dictionary.get("display_on_hosted_page")\ + if "display_on_hosted_page" in dictionary.keys()\ + else APIHelper.SKIP + allow_fractional_quantities =\ + dictionary.get("allow_fractional_quantities")\ + if "allow_fractional_quantities" in dictionary.keys()\ + else APIHelper.SKIP + public_signup_page_ids =\ + dictionary.get("public_signup_page_ids")\ + if dictionary.get("public_signup_page_ids")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, unit_name, @@ -233,41 +283,187 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'unit_name={self.unit_name!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!r}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!r}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!r}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"unit_name={_unit_name!r}, " + f"description={_description!r}, " + f"handle={_handle!r}, " + f"taxable={_taxable!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"price_points={_price_points!r}, " + f"unit_price={_unit_price!r}, " + f"tax_code={_tax_code!r}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!r}, " + f"display_on_hosted_page={_display_on_hosted_page!r}, " + f"allow_fractional_quantities={_allow_fractional_quantities!r}, " + f"public_signup_page_ids={_public_signup_page_ids!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'unit_name={self.unit_name!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!s}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!s}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!s}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"unit_name={_unit_name!s}, " + f"description={_description!s}, " + f"handle={_handle!s}, " + f"taxable={_taxable!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"price_points={_price_points!s}, " + f"unit_price={_unit_price!s}, " + f"tax_code={_tax_code!s}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!s}, " + f"display_on_hosted_page={_display_on_hosted_page!s}, " + f"allow_fractional_quantities={_allow_fractional_quantities!s}, " + f"public_signup_page_ids={_public_signup_page_ids!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/metered_usage.py b/advancedbilling/models/metered_usage.py index affd692c..5cad0486 100644 --- a/advancedbilling/models/metered_usage.py +++ b/advancedbilling/models/metered_usage.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class MeteredUsage(object): - """Implementation of the 'Metered Usage' model. Attributes: @@ -20,38 +18,38 @@ class MeteredUsage(object): component_id (int): The model property of type int. component_handle (str): The model property of type str. memo (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "previous_unit_balance": 'previous_unit_balance', - "new_unit_balance": 'new_unit_balance', - "usage_quantity": 'usage_quantity', - "component_id": 'component_id', - "component_handle": 'component_handle', - "memo": 'memo' + "previous_unit_balance": "previous_unit_balance", + "new_unit_balance": "new_unit_balance", + "usage_quantity": "usage_quantity", + "component_id": "component_id", + "component_handle": "component_handle", + "memo": "memo", } - def __init__(self, - previous_unit_balance=None, - new_unit_balance=None, - usage_quantity=None, - component_id=None, - component_handle=None, - memo=None, - additional_properties=None): - """Constructor for the MeteredUsage class""" - + def __init__( + self, + previous_unit_balance=None, + new_unit_balance=None, + usage_quantity=None, + component_id=None, + component_handle=None, + memo=None, + additional_properties=None): + """Initialize a MeteredUsage instance.""" # Initialize members of the class - self.previous_unit_balance = previous_unit_balance - self.new_unit_balance = new_unit_balance - self.usage_quantity = usage_quantity - self.component_id = component_id - self.component_handle = component_handle - self.memo = memo + self.previous_unit_balance = previous_unit_balance + self.new_unit_balance = new_unit_balance + self.usage_quantity = usage_quantity + self.component_id = component_id + self.component_handle = component_handle + self.memo = memo # Add additional model properties to the instance if additional_properties is None: @@ -61,7 +59,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -72,19 +70,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - previous_unit_balance = dictionary.get("previous_unit_balance") if dictionary.get("previous_unit_balance") else None - new_unit_balance = dictionary.get("new_unit_balance") if dictionary.get("new_unit_balance") else None - usage_quantity = dictionary.get("usage_quantity") if dictionary.get("usage_quantity") else None - component_id = dictionary.get("component_id") if dictionary.get("component_id") else None - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None + previous_unit_balance =\ + dictionary.get("previous_unit_balance")\ + if dictionary.get("previous_unit_balance")\ + else None + new_unit_balance =\ + dictionary.get("new_unit_balance")\ + if dictionary.get("new_unit_balance")\ + else None + usage_quantity =\ + dictionary.get("usage_quantity")\ + if dictionary.get("usage_quantity")\ + else None + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else None + component_handle =\ + dictionary.get("component_handle")\ + if dictionary.get("component_handle")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(previous_unit_balance, new_unit_balance, @@ -96,7 +114,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -107,53 +125,134 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.previous_unit_balance, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.new_unit_balance, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.usage_quantity, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.component_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.component_handle, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.previous_unit_balance, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.new_unit_balance, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.usage_quantity, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.component_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.component_handle, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('previous_unit_balance'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('new_unit_balance'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('usage_quantity'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('component_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('component_handle'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("previous_unit_balance"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_unit_balance"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("usage_quantity"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("component_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("component_handle"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'previous_unit_balance={self.previous_unit_balance!r}, ' - f'new_unit_balance={self.new_unit_balance!r}, ' - f'usage_quantity={self.usage_quantity!r}, ' - f'component_id={self.component_id!r}, ' - f'component_handle={self.component_handle!r}, ' - f'memo={self.memo!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _previous_unit_balance=self.previous_unit_balance + _new_unit_balance=self.new_unit_balance + _usage_quantity=self.usage_quantity + _component_id=self.component_id + _component_handle=self.component_handle + _memo=self.memo + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_unit_balance={_previous_unit_balance!r}, " + f"new_unit_balance={_new_unit_balance!r}, " + f"usage_quantity={_usage_quantity!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"memo={_memo!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'previous_unit_balance={self.previous_unit_balance!s}, ' - f'new_unit_balance={self.new_unit_balance!s}, ' - f'usage_quantity={self.usage_quantity!s}, ' - f'component_id={self.component_id!s}, ' - f'component_handle={self.component_handle!s}, ' - f'memo={self.memo!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _previous_unit_balance=self.previous_unit_balance + _new_unit_balance=self.new_unit_balance + _usage_quantity=self.usage_quantity + _component_id=self.component_id + _component_handle=self.component_handle + _memo=self.memo + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_unit_balance={_previous_unit_balance!s}, " + f"new_unit_balance={_new_unit_balance!s}, " + f"usage_quantity={_usage_quantity!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"memo={_memo!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/movement.py b/advancedbilling/models/movement.py index d1801088..a1ab22ee 100644 --- a/advancedbilling/models/movement.py +++ b/advancedbilling/models/movement.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.breakouts import Breakouts -from advancedbilling.models.movement_line_item import MovementLineItem +from advancedbilling.models.breakouts import ( + Breakouts, +) +from advancedbilling.models.movement_line_item import ( + MovementLineItem, +) class Movement(object): - """Implementation of the 'Movement' model. Attributes: @@ -26,68 +28,71 @@ class Movement(object): List[MovementLineItem]. subscription_id (int): The model property of type int. subscriber_name (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "timestamp": 'timestamp', - "amount_in_cents": 'amount_in_cents', - "amount_formatted": 'amount_formatted', - "description": 'description', - "category": 'category', - "breakouts": 'breakouts', - "line_items": 'line_items', - "subscription_id": 'subscription_id', - "subscriber_name": 'subscriber_name' + "timestamp": "timestamp", + "amount_in_cents": "amount_in_cents", + "amount_formatted": "amount_formatted", + "description": "description", + "category": "category", + "breakouts": "breakouts", + "line_items": "line_items", + "subscription_id": "subscription_id", + "subscriber_name": "subscriber_name", } _optionals = [ - 'timestamp', - 'amount_in_cents', - 'amount_formatted', - 'description', - 'category', - 'breakouts', - 'line_items', - 'subscription_id', - 'subscriber_name', + "timestamp", + "amount_in_cents", + "amount_formatted", + "description", + "category", + "breakouts", + "line_items", + "subscription_id", + "subscriber_name", ] - def __init__(self, - timestamp=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - amount_formatted=APIHelper.SKIP, - description=APIHelper.SKIP, - category=APIHelper.SKIP, - breakouts=APIHelper.SKIP, - line_items=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - subscriber_name=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Movement class""" - + def __init__( + self, + timestamp=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + amount_formatted=APIHelper.SKIP, + description=APIHelper.SKIP, + category=APIHelper.SKIP, + breakouts=APIHelper.SKIP, + line_items=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + subscriber_name=APIHelper.SKIP, + additional_properties=None): + """Initialize a Movement instance.""" # Initialize members of the class if timestamp is not APIHelper.SKIP: - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if amount_formatted is not APIHelper.SKIP: - self.amount_formatted = amount_formatted + self.amount_formatted = amount_formatted if description is not APIHelper.SKIP: - self.description = description + self.description = description if category is not APIHelper.SKIP: - self.category = category + self.category = category if breakouts is not APIHelper.SKIP: - self.breakouts = breakouts + self.breakouts = breakouts if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if subscriber_name is not APIHelper.SKIP: - self.subscriber_name = subscriber_name + self.subscriber_name = subscriber_name # Add additional model properties to the instance if additional_properties is None: @@ -97,7 +102,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -108,26 +113,55 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - amount_formatted = dictionary.get("amount_formatted") if dictionary.get("amount_formatted") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - category = dictionary.get("category") if dictionary.get("category") else APIHelper.SKIP - breakouts = Breakouts.from_dictionary(dictionary.get('breakouts')) if 'breakouts' in dictionary.keys() else APIHelper.SKIP + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + amount_formatted =\ + dictionary.get("amount_formatted")\ + if dictionary.get("amount_formatted")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + category =\ + dictionary.get("category")\ + if dictionary.get("category")\ + else APIHelper.SKIP + breakouts =\ + Breakouts.from_dictionary( + dictionary.get("breakouts"))\ + if "breakouts" in dictionary.keys()\ + else APIHelper.SKIP line_items = None - if dictionary.get('line_items') is not None: - line_items = [MovementLineItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + MovementLineItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - subscriber_name = dictionary.get("subscriber_name") if dictionary.get("subscriber_name") else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + subscriber_name =\ + dictionary.get("subscriber_name")\ + if dictionary.get("subscriber_name")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(timestamp, amount_in_cents, @@ -141,27 +175,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'amount_formatted={(self.amount_formatted if hasattr(self, "amount_formatted") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'category={(self.category if hasattr(self, "category") else None)!r}, ' - f'breakouts={(self.breakouts if hasattr(self, "breakouts") else None)!r}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'subscriber_name={(self.subscriber_name if hasattr(self, "subscriber_name") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _amount_formatted=( + self.amount_formatted + if hasattr(self, "amount_formatted") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _category=( + self.category + if hasattr(self, "category") + else None + ) + _breakouts=( + self.breakouts + if hasattr(self, "breakouts") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _subscriber_name=( + self.subscriber_name + if hasattr(self, "subscriber_name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"timestamp={_timestamp!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"amount_formatted={_amount_formatted!r}, " + f"description={_description!r}, " + f"category={_category!r}, " + f"breakouts={_breakouts!r}, " + f"line_items={_line_items!r}, " + f"subscription_id={_subscription_id!r}, " + f"subscriber_name={_subscriber_name!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'amount_formatted={(self.amount_formatted if hasattr(self, "amount_formatted") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'category={(self.category if hasattr(self, "category") else None)!s}, ' - f'breakouts={(self.breakouts if hasattr(self, "breakouts") else None)!s}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'subscriber_name={(self.subscriber_name if hasattr(self, "subscriber_name") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _timestamp=( + self.timestamp + if hasattr(self, "timestamp") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _amount_formatted=( + self.amount_formatted + if hasattr(self, "amount_formatted") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _category=( + self.category + if hasattr(self, "category") + else None + ) + _breakouts=( + self.breakouts + if hasattr(self, "breakouts") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _subscriber_name=( + self.subscriber_name + if hasattr(self, "subscriber_name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"timestamp={_timestamp!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"amount_formatted={_amount_formatted!s}, " + f"description={_description!s}, " + f"category={_category!s}, " + f"breakouts={_breakouts!s}, " + f"line_items={_line_items!s}, " + f"subscription_id={_subscription_id!s}, " + f"subscriber_name={_subscriber_name!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/movement_line_item.py b/advancedbilling/models/movement_line_item.py index 170a07c8..6b67a3d3 100644 --- a/advancedbilling/models/movement_line_item.py +++ b/advancedbilling/models/movement_line_item.py @@ -1,23 +1,23 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.mrr_movement import MRRMovement +from advancedbilling.models.mrr_movement import ( + MRRMovement, +) class MovementLineItem(object): - """Implementation of the 'Movement Line Item' model. Attributes: product_id (int): The model property of type int. - component_id (int): For Product (or "baseline") line items, this field - will have a value of `0`. + component_id (int): For Product (or "baseline") line items, this field will + have a value of `0`. price_point_id (int): The model property of type int. name (str): The model property of type str. mrr (int): The model property of type int. @@ -25,71 +25,71 @@ class MovementLineItem(object): List[MRRMovement]. quantity (int): The model property of type int. prev_quantity (int): The model property of type int. - recurring (bool): When `true`, the line item's MRR value will - contribute to the `plan` breakout. When `false`, the line item - contributes to the `usage` breakout. - additional_properties (Dict[str, object]): The additional properties - for the model. + recurring (bool): When `true`, the line item's MRR value will contribute to + the `plan` breakout. When `false`, the line item contributes to the + `usage` breakout. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_id": 'product_id', - "component_id": 'component_id', - "price_point_id": 'price_point_id', - "name": 'name', - "mrr": 'mrr', - "mrr_movements": 'mrr_movements', - "quantity": 'quantity', - "prev_quantity": 'prev_quantity', - "recurring": 'recurring' + "product_id": "product_id", + "component_id": "component_id", + "price_point_id": "price_point_id", + "name": "name", + "mrr": "mrr", + "mrr_movements": "mrr_movements", + "quantity": "quantity", + "prev_quantity": "prev_quantity", + "recurring": "recurring", } _optionals = [ - 'product_id', - 'component_id', - 'price_point_id', - 'name', - 'mrr', - 'mrr_movements', - 'quantity', - 'prev_quantity', - 'recurring', + "product_id", + "component_id", + "price_point_id", + "name", + "mrr", + "mrr_movements", + "quantity", + "prev_quantity", + "recurring", ] - def __init__(self, - product_id=APIHelper.SKIP, - component_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - name=APIHelper.SKIP, - mrr=APIHelper.SKIP, - mrr_movements=APIHelper.SKIP, - quantity=APIHelper.SKIP, - prev_quantity=APIHelper.SKIP, - recurring=APIHelper.SKIP, - additional_properties=None): - """Constructor for the MovementLineItem class""" - + def __init__( + self, + product_id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + name=APIHelper.SKIP, + mrr=APIHelper.SKIP, + mrr_movements=APIHelper.SKIP, + quantity=APIHelper.SKIP, + prev_quantity=APIHelper.SKIP, + recurring=APIHelper.SKIP, + additional_properties=None): + """Initialize a MovementLineItem instance.""" # Initialize members of the class if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if name is not APIHelper.SKIP: - self.name = name + self.name = name if mrr is not APIHelper.SKIP: - self.mrr = mrr + self.mrr = mrr if mrr_movements is not APIHelper.SKIP: - self.mrr_movements = mrr_movements + self.mrr_movements = mrr_movements if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if prev_quantity is not APIHelper.SKIP: - self.prev_quantity = prev_quantity + self.prev_quantity = prev_quantity if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring # Add additional model properties to the instance if additional_properties is None: @@ -99,7 +99,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -110,26 +110,55 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - mrr = dictionary.get("mrr") if dictionary.get("mrr") else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + mrr =\ + dictionary.get("mrr")\ + if dictionary.get("mrr")\ + else APIHelper.SKIP mrr_movements = None - if dictionary.get('mrr_movements') is not None: - mrr_movements = [MRRMovement.from_dictionary(x) for x in dictionary.get('mrr_movements')] + if dictionary.get("mrr_movements") is not None: + mrr_movements = [ + MRRMovement.from_dictionary(x) + for x in dictionary.get("mrr_movements") + ] else: mrr_movements = APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - prev_quantity = dictionary.get("prev_quantity") if dictionary.get("prev_quantity") else APIHelper.SKIP - recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + prev_quantity =\ + dictionary.get("prev_quantity")\ + if dictionary.get("prev_quantity")\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if "recurring" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_id, component_id, @@ -143,27 +172,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'mrr={(self.mrr if hasattr(self, "mrr") else None)!r}, ' - f'mrr_movements={(self.mrr_movements if hasattr(self, "mrr_movements") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'prev_quantity={(self.prev_quantity if hasattr(self, "prev_quantity") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _mrr=( + self.mrr + if hasattr(self, "mrr") + else None + ) + _mrr_movements=( + self.mrr_movements + if hasattr(self, "mrr_movements") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _prev_quantity=( + self.prev_quantity + if hasattr(self, "prev_quantity") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!r}, " + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"name={_name!r}, " + f"mrr={_mrr!r}, " + f"mrr_movements={_mrr_movements!r}, " + f"quantity={_quantity!r}, " + f"prev_quantity={_prev_quantity!r}, " + f"recurring={_recurring!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'mrr={(self.mrr if hasattr(self, "mrr") else None)!s}, ' - f'mrr_movements={(self.mrr_movements if hasattr(self, "mrr_movements") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'prev_quantity={(self.prev_quantity if hasattr(self, "prev_quantity") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _mrr=( + self.mrr + if hasattr(self, "mrr") + else None + ) + _mrr_movements=( + self.mrr_movements + if hasattr(self, "mrr_movements") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _prev_quantity=( + self.prev_quantity + if hasattr(self, "prev_quantity") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!s}, " + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"name={_name!s}, " + f"mrr={_mrr!s}, " + f"mrr_movements={_mrr_movements!s}, " + f"quantity={_quantity!s}, " + f"prev_quantity={_prev_quantity!s}, " + f"recurring={_recurring!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/mrr.py b/advancedbilling/models/mrr.py index 020633d0..1fa5be38 100644 --- a/advancedbilling/models/mrr.py +++ b/advancedbilling/models/mrr.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.breakouts import Breakouts +from advancedbilling.models.breakouts import ( + Breakouts, +) class MRR(object): - """Implementation of the 'MRR' model. Attributes: @@ -21,53 +21,56 @@ class MRR(object): currency_symbol (str): The model property of type str. breakouts (Breakouts): The model property of type Breakouts. at_time (datetime): ISO8601 timestamp - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount_in_cents": 'amount_in_cents', - "amount_formatted": 'amount_formatted', - "currency": 'currency', - "currency_symbol": 'currency_symbol', - "breakouts": 'breakouts', - "at_time": 'at_time' + "amount_in_cents": "amount_in_cents", + "amount_formatted": "amount_formatted", + "currency": "currency", + "currency_symbol": "currency_symbol", + "breakouts": "breakouts", + "at_time": "at_time", } _optionals = [ - 'amount_in_cents', - 'amount_formatted', - 'currency', - 'currency_symbol', - 'breakouts', - 'at_time', + "amount_in_cents", + "amount_formatted", + "currency", + "currency_symbol", + "breakouts", + "at_time", ] - def __init__(self, - amount_in_cents=APIHelper.SKIP, - amount_formatted=APIHelper.SKIP, - currency=APIHelper.SKIP, - currency_symbol=APIHelper.SKIP, - breakouts=APIHelper.SKIP, - at_time=APIHelper.SKIP, - additional_properties=None): - """Constructor for the MRR class""" - + def __init__( + self, + amount_in_cents=APIHelper.SKIP, + amount_formatted=APIHelper.SKIP, + currency=APIHelper.SKIP, + currency_symbol=APIHelper.SKIP, + breakouts=APIHelper.SKIP, + at_time=APIHelper.SKIP, + additional_properties=None): + """Initialize a MRR instance.""" # Initialize members of the class if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if amount_formatted is not APIHelper.SKIP: - self.amount_formatted = amount_formatted + self.amount_formatted = amount_formatted if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if currency_symbol is not APIHelper.SKIP: - self.currency_symbol = currency_symbol + self.currency_symbol = currency_symbol if breakouts is not APIHelper.SKIP: - self.breakouts = breakouts + self.breakouts = breakouts if at_time is not APIHelper.SKIP: - self.at_time = APIHelper.apply_datetime_converter(at_time, APIHelper.RFC3339DateTime) if at_time else None + self.at_time =\ + APIHelper.apply_datetime_converter( + at_time, APIHelper.RFC3339DateTime)\ + if at_time else None # Add additional model properties to the instance if additional_properties is None: @@ -77,7 +80,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -88,19 +91,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - amount_formatted = dictionary.get("amount_formatted") if dictionary.get("amount_formatted") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - currency_symbol = dictionary.get("currency_symbol") if dictionary.get("currency_symbol") else APIHelper.SKIP - breakouts = Breakouts.from_dictionary(dictionary.get('breakouts')) if 'breakouts' in dictionary.keys() else APIHelper.SKIP - at_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("at_time")).datetime if dictionary.get("at_time") else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + amount_formatted =\ + dictionary.get("amount_formatted")\ + if dictionary.get("amount_formatted")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + currency_symbol =\ + dictionary.get("currency_symbol")\ + if dictionary.get("currency_symbol")\ + else APIHelper.SKIP + breakouts =\ + Breakouts.from_dictionary( + dictionary.get("breakouts"))\ + if "breakouts" in dictionary.keys()\ + else APIHelper.SKIP + at_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("at_time")).datetime\ + if dictionary.get("at_time") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount_in_cents, amount_formatted, @@ -111,21 +134,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'amount_formatted={(self.amount_formatted if hasattr(self, "amount_formatted") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'currency_symbol={(self.currency_symbol if hasattr(self, "currency_symbol") else None)!r}, ' - f'breakouts={(self.breakouts if hasattr(self, "breakouts") else None)!r}, ' - f'at_time={(self.at_time if hasattr(self, "at_time") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _amount_formatted=( + self.amount_formatted + if hasattr(self, "amount_formatted") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _currency_symbol=( + self.currency_symbol + if hasattr(self, "currency_symbol") + else None + ) + _breakouts=( + self.breakouts + if hasattr(self, "breakouts") + else None + ) + _at_time=( + self.at_time + if hasattr(self, "at_time") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount_in_cents={_amount_in_cents!r}, " + f"amount_formatted={_amount_formatted!r}, " + f"currency={_currency!r}, " + f"currency_symbol={_currency_symbol!r}, " + f"breakouts={_breakouts!r}, " + f"at_time={_at_time!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'amount_formatted={(self.amount_formatted if hasattr(self, "amount_formatted") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'currency_symbol={(self.currency_symbol if hasattr(self, "currency_symbol") else None)!s}, ' - f'breakouts={(self.breakouts if hasattr(self, "breakouts") else None)!s}, ' - f'at_time={(self.at_time if hasattr(self, "at_time") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _amount_formatted=( + self.amount_formatted + if hasattr(self, "amount_formatted") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _currency_symbol=( + self.currency_symbol + if hasattr(self, "currency_symbol") + else None + ) + _breakouts=( + self.breakouts + if hasattr(self, "breakouts") + else None + ) + _at_time=( + self.at_time + if hasattr(self, "at_time") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount_in_cents={_amount_in_cents!s}, " + f"amount_formatted={_amount_formatted!s}, " + f"currency={_currency!s}, " + f"currency_symbol={_currency_symbol!s}, " + f"breakouts={_breakouts!s}, " + f"at_time={_at_time!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/mrr_movement.py b/advancedbilling/models/mrr_movement.py index afe6dba7..c916e556 100644 --- a/advancedbilling/models/mrr_movement.py +++ b/advancedbilling/models/mrr_movement.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class MRRMovement(object): - """Implementation of the 'MRR Movement' model. Attributes: @@ -18,43 +16,43 @@ class MRRMovement(object): category (str): The model property of type str. subscriber_delta (int): The model property of type int. lead_delta (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "category": 'category', - "subscriber_delta": 'subscriber_delta', - "lead_delta": 'lead_delta' + "amount": "amount", + "category": "category", + "subscriber_delta": "subscriber_delta", + "lead_delta": "lead_delta", } _optionals = [ - 'amount', - 'category', - 'subscriber_delta', - 'lead_delta', + "amount", + "category", + "subscriber_delta", + "lead_delta", ] - def __init__(self, - amount=APIHelper.SKIP, - category=APIHelper.SKIP, - subscriber_delta=APIHelper.SKIP, - lead_delta=APIHelper.SKIP, - additional_properties=None): - """Constructor for the MRRMovement class""" - + def __init__( + self, + amount=APIHelper.SKIP, + category=APIHelper.SKIP, + subscriber_delta=APIHelper.SKIP, + lead_delta=APIHelper.SKIP, + additional_properties=None): + """Initialize a MRRMovement instance.""" # Initialize members of the class if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount if category is not APIHelper.SKIP: - self.category = category + self.category = category if subscriber_delta is not APIHelper.SKIP: - self.subscriber_delta = subscriber_delta + self.subscriber_delta = subscriber_delta if lead_delta is not APIHelper.SKIP: - self.lead_delta = lead_delta + self.lead_delta = lead_delta # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = dictionary.get("amount") if dictionary.get("amount") else APIHelper.SKIP - category = dictionary.get("category") if dictionary.get("category") else APIHelper.SKIP - subscriber_delta = dictionary.get("subscriber_delta") if dictionary.get("subscriber_delta") else APIHelper.SKIP - lead_delta = dictionary.get("lead_delta") if dictionary.get("lead_delta") else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else APIHelper.SKIP + category =\ + dictionary.get("category")\ + if dictionary.get("category")\ + else APIHelper.SKIP + subscriber_delta =\ + dictionary.get("subscriber_delta")\ + if dictionary.get("subscriber_delta")\ + else APIHelper.SKIP + lead_delta =\ + dictionary.get("lead_delta")\ + if dictionary.get("lead_delta")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, category, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'category={(self.category if hasattr(self, "category") else None)!r}, ' - f'subscriber_delta={(self.subscriber_delta if hasattr(self, "subscriber_delta") else None)!r}, ' - f'lead_delta={(self.lead_delta if hasattr(self, "lead_delta") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _category=( + self.category + if hasattr(self, "category") + else None + ) + _subscriber_delta=( + self.subscriber_delta + if hasattr(self, "subscriber_delta") + else None + ) + _lead_delta=( + self.lead_delta + if hasattr(self, "lead_delta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"category={_category!r}, " + f"subscriber_delta={_subscriber_delta!r}, " + f"lead_delta={_lead_delta!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'category={(self.category if hasattr(self, "category") else None)!s}, ' - f'subscriber_delta={(self.subscriber_delta if hasattr(self, "subscriber_delta") else None)!s}, ' - f'lead_delta={(self.lead_delta if hasattr(self, "lead_delta") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _category=( + self.category + if hasattr(self, "category") + else None + ) + _subscriber_delta=( + self.subscriber_delta + if hasattr(self, "subscriber_delta") + else None + ) + _lead_delta=( + self.lead_delta + if hasattr(self, "lead_delta") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"category={_category!s}, " + f"subscriber_delta={_subscriber_delta!s}, " + f"lead_delta={_lead_delta!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/mrr_response.py b/advancedbilling/models/mrr_response.py index 1ed48352..d894a120 100644 --- a/advancedbilling/models/mrr_response.py +++ b/advancedbilling/models/mrr_response.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.models.mrr import MRR class MRRResponse(object): - """Implementation of the 'MRR response' model. Attributes: mrr (MRR): The model property of type MRR. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "mrr": 'mrr' + "mrr": "mrr", } - def __init__(self, - mrr=None, - additional_properties=None): - """Constructor for the MRRResponse class""" - + def __init__( + self, + mrr=None, + additional_properties=None): + """Initialize a MRRResponse instance.""" # Initialize members of the class - self.mrr = mrr + self.mrr = mrr # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +50,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - mrr = MRR.from_dictionary(dictionary.get('mrr')) if dictionary.get('mrr') else None + mrr =\ + MRR.from_dictionary( + dictionary.get("mrr"))\ + if dictionary.get("mrr") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(mrr, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'mrr={self.mrr!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _mrr=self.mrr + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mrr={_mrr!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'mrr={self.mrr!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _mrr=self.mrr + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mrr={_mrr!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/multi_invoice_payment.py b/advancedbilling/models/multi_invoice_payment.py index 831f727d..20349665 100644 --- a/advancedbilling/models/multi_invoice_payment.py +++ b/advancedbilling/models/multi_invoice_payment.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_payment_application import InvoicePaymentApplication +from advancedbilling.models.invoice_payment_application import ( + InvoicePaymentApplication, +) class MultiInvoicePayment(object): - """Implementation of the 'Multi Invoice Payment' model. Attributes: @@ -19,45 +19,45 @@ class MultiInvoicePayment(object): total_amount (str): Dollar amount of the sum of the paid invoices. currency_code (str): The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. - applications (List[InvoicePaymentApplication]): The model property of - type List[InvoicePaymentApplication]. - additional_properties (Dict[str, object]): The additional properties - for the model. + applications (List[InvoicePaymentApplication]): The model property of type + List[InvoicePaymentApplication]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "transaction_id": 'transaction_id', - "total_amount": 'total_amount', - "currency_code": 'currency_code', - "applications": 'applications' + "transaction_id": "transaction_id", + "total_amount": "total_amount", + "currency_code": "currency_code", + "applications": "applications", } _optionals = [ - 'transaction_id', - 'total_amount', - 'currency_code', - 'applications', + "transaction_id", + "total_amount", + "currency_code", + "applications", ] - def __init__(self, - transaction_id=APIHelper.SKIP, - total_amount=APIHelper.SKIP, - currency_code=APIHelper.SKIP, - applications=APIHelper.SKIP, - additional_properties=None): - """Constructor for the MultiInvoicePayment class""" - + def __init__( + self, + transaction_id=APIHelper.SKIP, + total_amount=APIHelper.SKIP, + currency_code=APIHelper.SKIP, + applications=APIHelper.SKIP, + additional_properties=None): + """Initialize a MultiInvoicePayment instance.""" # Initialize members of the class if transaction_id is not APIHelper.SKIP: - self.transaction_id = transaction_id + self.transaction_id = transaction_id if total_amount is not APIHelper.SKIP: - self.total_amount = total_amount + self.total_amount = total_amount if currency_code is not APIHelper.SKIP: - self.currency_code = currency_code + self.currency_code = currency_code if applications is not APIHelper.SKIP: - self.applications = applications + self.applications = applications # Add additional model properties to the instance if additional_properties is None: @@ -67,7 +67,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -78,21 +78,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else APIHelper.SKIP - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else APIHelper.SKIP - currency_code = dictionary.get("currency_code") if dictionary.get("currency_code") else APIHelper.SKIP + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else APIHelper.SKIP + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else APIHelper.SKIP + currency_code =\ + dictionary.get("currency_code")\ + if dictionary.get("currency_code")\ + else APIHelper.SKIP applications = None - if dictionary.get('applications') is not None: - applications = [InvoicePaymentApplication.from_dictionary(x) for x in dictionary.get('applications')] + if dictionary.get("applications") is not None: + applications = [ + InvoicePaymentApplication.from_dictionary(x) + for x in dictionary.get("applications") + ] else: applications = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(transaction_id, total_amount, @@ -101,17 +115,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!r}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!r}, ' - f'currency_code={(self.currency_code if hasattr(self, "currency_code") else None)!r}, ' - f'applications={(self.applications if hasattr(self, "applications") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _currency_code=( + self.currency_code + if hasattr(self, "currency_code") + else None + ) + _applications=( + self.applications + if hasattr(self, "applications") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_id={_transaction_id!r}, " + f"total_amount={_total_amount!r}, " + f"currency_code={_currency_code!r}, " + f"applications={_applications!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'transaction_id={(self.transaction_id if hasattr(self, "transaction_id") else None)!s}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!s}, ' - f'currency_code={(self.currency_code if hasattr(self, "currency_code") else None)!s}, ' - f'applications={(self.applications if hasattr(self, "applications") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _transaction_id=( + self.transaction_id + if hasattr(self, "transaction_id") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _currency_code=( + self.currency_code + if hasattr(self, "currency_code") + else None + ) + _applications=( + self.applications + if hasattr(self, "applications") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_id={_transaction_id!s}, " + f"total_amount={_total_amount!s}, " + f"currency_code={_currency_code!s}, " + f"applications={_applications!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/multi_invoice_payment_response.py b/advancedbilling/models/multi_invoice_payment_response.py index 5051c8b4..ba105296 100644 --- a/advancedbilling/models/multi_invoice_payment_response.py +++ b/advancedbilling/models/multi_invoice_payment_response.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.multi_invoice_payment import MultiInvoicePayment +# ruff: noqa: E501 +from advancedbilling.models.multi_invoice_payment import ( + MultiInvoicePayment, +) -class MultiInvoicePaymentResponse(object): +class MultiInvoicePaymentResponse(object): """Implementation of the 'Multi Invoice Payment Response' model. Attributes: - payment (MultiInvoicePayment): The model property of type - MultiInvoicePayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + payment (MultiInvoicePayment): The model property of type MultiInvoicePayment. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment": 'payment' + "payment": "payment", } - def __init__(self, - payment=None, - additional_properties=None): - """Constructor for the MultiInvoicePaymentResponse class""" - + def __init__( + self, + payment=None, + additional_properties=None): + """Initialize a MultiInvoicePaymentResponse instance.""" # Initialize members of the class - self.payment = payment + self.payment = payment # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment = MultiInvoicePayment.from_dictionary(dictionary.get('payment')) if dictionary.get('payment') else None + payment =\ + MultiInvoicePayment.from_dictionary( + dictionary.get("payment"))\ + if dictionary.get("payment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment=self.payment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment=self.payment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/nested_subscription_group.py b/advancedbilling/models/nested_subscription_group.py index 9919bae2..4ee09be5 100644 --- a/advancedbilling/models/nested_subscription_group.py +++ b/advancedbilling/models/nested_subscription_group.py @@ -1,63 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class NestedSubscriptionGroup(object): - """Implementation of the 'Nested Subscription Group' model. Attributes: uid (str): The UID for the group scheme (int): Whether the group is configured to rely on a primary subscription for billing. At this time, it will always be 1. - primary_subscription_id (int): The subscription ID of the primary - within the group. Applicable to scheme 1. - primary (bool): A boolean indicating whether the subscription is the - primary in the group. Applicable to scheme 1. - additional_properties (Dict[str, object]): The additional properties - for the model. + primary_subscription_id (int): The subscription ID of the primary within the + group. Applicable to scheme 1. + primary (bool): A boolean indicating whether the subscription is the primary + in the group. Applicable to scheme 1. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "scheme": 'scheme', - "primary_subscription_id": 'primary_subscription_id', - "primary": 'primary' + "uid": "uid", + "scheme": "scheme", + "primary_subscription_id": "primary_subscription_id", + "primary": "primary", } _optionals = [ - 'uid', - 'scheme', - 'primary_subscription_id', - 'primary', + "uid", + "scheme", + "primary_subscription_id", + "primary", ] - def __init__(self, - uid=APIHelper.SKIP, - scheme=APIHelper.SKIP, - primary_subscription_id=APIHelper.SKIP, - primary=APIHelper.SKIP, - additional_properties=None): - """Constructor for the NestedSubscriptionGroup class""" - + def __init__( + self, + uid=APIHelper.SKIP, + scheme=APIHelper.SKIP, + primary_subscription_id=APIHelper.SKIP, + primary=APIHelper.SKIP, + additional_properties=None): + """Initialize a NestedSubscriptionGroup instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if scheme is not APIHelper.SKIP: - self.scheme = scheme + self.scheme = scheme if primary_subscription_id is not APIHelper.SKIP: - self.primary_subscription_id = primary_subscription_id + self.primary_subscription_id = primary_subscription_id if primary is not APIHelper.SKIP: - self.primary = primary + self.primary = primary # Add additional model properties to the instance if additional_properties is None: @@ -67,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -78,17 +76,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - scheme = dictionary.get("scheme") if dictionary.get("scheme") else APIHelper.SKIP - primary_subscription_id = dictionary.get("primary_subscription_id") if dictionary.get("primary_subscription_id") else APIHelper.SKIP - primary = dictionary.get("primary") if "primary" in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + scheme =\ + dictionary.get("scheme")\ + if dictionary.get("scheme")\ + else APIHelper.SKIP + primary_subscription_id =\ + dictionary.get("primary_subscription_id")\ + if dictionary.get("primary_subscription_id")\ + else APIHelper.SKIP + primary =\ + dictionary.get("primary")\ + if "primary" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, scheme, @@ -98,7 +110,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -109,7 +121,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -119,17 +130,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!r}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!r}, ' - f'primary={(self.primary if hasattr(self, "primary") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _primary=( + self.primary + if hasattr(self, "primary") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"scheme={_scheme!r}, " + f"primary_subscription_id={_primary_subscription_id!r}, " + f"primary={_primary!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!s}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!s}, ' - f'primary={(self.primary if hasattr(self, "primary") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _primary=( + self.primary + if hasattr(self, "primary") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"scheme={_scheme!s}, " + f"primary_subscription_id={_primary_subscription_id!s}, " + f"primary={_primary!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/net_terms.py b/advancedbilling/models/net_terms.py index 4118d4fc..9589c8c5 100644 --- a/advancedbilling/models/net_terms.py +++ b/advancedbilling/models/net_terms.py @@ -1,62 +1,59 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper - +# ruff: noqa: E501 class NetTerms(object): - """Implementation of the 'Net Terms' model. Attributes: default_net_terms (int): The model property of type int. automatic_net_terms (int): The model property of type int. remittance_net_terms (int): The model property of type int. - net_terms_on_remittance_signups_enabled (bool): The model property of - type bool. + net_terms_on_remittance_signups_enabled (bool): The model property of type + bool. custom_net_terms_enabled (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "default_net_terms": 'default_net_terms', - "automatic_net_terms": 'automatic_net_terms', - "remittance_net_terms": 'remittance_net_terms', - "net_terms_on_remittance_signups_enabled": 'net_terms_on_remittance_signups_enabled', - "custom_net_terms_enabled": 'custom_net_terms_enabled' + "default_net_terms": "default_net_terms", + "automatic_net_terms": "automatic_net_terms", + "remittance_net_terms": "remittance_net_terms", + "net_terms_on_remittance_signups_enabled": + "net_terms_on_remittance_signups_enabled", + "custom_net_terms_enabled": "custom_net_terms_enabled", } _optionals = [ - 'default_net_terms', - 'automatic_net_terms', - 'remittance_net_terms', - 'net_terms_on_remittance_signups_enabled', - 'custom_net_terms_enabled', + "default_net_terms", + "automatic_net_terms", + "remittance_net_terms", + "net_terms_on_remittance_signups_enabled", + "custom_net_terms_enabled", ] - def __init__(self, - default_net_terms=0, - automatic_net_terms=0, - remittance_net_terms=0, - net_terms_on_remittance_signups_enabled=False, - custom_net_terms_enabled=False, - additional_properties=None): - """Constructor for the NetTerms class""" - + def __init__( + self, + default_net_terms=0, + automatic_net_terms=0, + remittance_net_terms=0, + net_terms_on_remittance_signups_enabled=False, + custom_net_terms_enabled=False, + additional_properties=None): + """Initialize a NetTerms instance.""" # Initialize members of the class - self.default_net_terms = default_net_terms - self.automatic_net_terms = automatic_net_terms - self.remittance_net_terms = remittance_net_terms - self.net_terms_on_remittance_signups_enabled = net_terms_on_remittance_signups_enabled - self.custom_net_terms_enabled = custom_net_terms_enabled + self.default_net_terms = default_net_terms + self.automatic_net_terms = automatic_net_terms + self.remittance_net_terms = remittance_net_terms + self.net_terms_on_remittance_signups_enabled =\ + net_terms_on_remittance_signups_enabled + self.custom_net_terms_enabled = custom_net_terms_enabled # Add additional model properties to the instance if additional_properties is None: @@ -66,7 +63,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -77,18 +74,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - default_net_terms = dictionary.get("default_net_terms") if dictionary.get("default_net_terms") else 0 - automatic_net_terms = dictionary.get("automatic_net_terms") if dictionary.get("automatic_net_terms") else 0 - remittance_net_terms = dictionary.get("remittance_net_terms") if dictionary.get("remittance_net_terms") else 0 - net_terms_on_remittance_signups_enabled = dictionary.get("net_terms_on_remittance_signups_enabled") if dictionary.get("net_terms_on_remittance_signups_enabled") else False - custom_net_terms_enabled = dictionary.get("custom_net_terms_enabled") if dictionary.get("custom_net_terms_enabled") else False + default_net_terms =\ + dictionary.get("default_net_terms")\ + if dictionary.get("default_net_terms")\ + else 0 + automatic_net_terms =\ + dictionary.get("automatic_net_terms")\ + if dictionary.get("automatic_net_terms")\ + else 0 + remittance_net_terms =\ + dictionary.get("remittance_net_terms")\ + if dictionary.get("remittance_net_terms")\ + else 0 + net_terms_on_remittance_signups_enabled =\ + dictionary.get("net_terms_on_remittance_signups_enabled")\ + if dictionary.get("net_terms_on_remittance_signups_enabled")\ + else False + custom_net_terms_enabled =\ + dictionary.get("custom_net_terms_enabled")\ + if dictionary.get("custom_net_terms_enabled")\ + else False + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(default_net_terms, automatic_net_terms, @@ -98,19 +112,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'default_net_terms={(self.default_net_terms if hasattr(self, "default_net_terms") else None)!r}, ' - f'automatic_net_terms={(self.automatic_net_terms if hasattr(self, "automatic_net_terms") else None)!r}, ' - f'remittance_net_terms={(self.remittance_net_terms if hasattr(self, "remittance_net_terms") else None)!r}, ' - f'net_terms_on_remittance_signups_enabled={(self.net_terms_on_remittance_signups_enabled if hasattr(self, "net_terms_on_remittance_signups_enabled") else None)!r}, ' - f'custom_net_terms_enabled={(self.custom_net_terms_enabled if hasattr(self, "custom_net_terms_enabled") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _default_net_terms=( + self.default_net_terms + if hasattr(self, "default_net_terms") + else None + ) + _automatic_net_terms=( + self.automatic_net_terms + if hasattr(self, "automatic_net_terms") + else None + ) + _remittance_net_terms=( + self.remittance_net_terms + if hasattr(self, "remittance_net_terms") + else None + ) + _net_terms_on_remittance_signups_enabled=( + self.net_terms_on_remittance_signups_enabled + if hasattr(self, "net_terms_on_remittance_signups_enabled") + else None + ) + _custom_net_terms_enabled=( + self.custom_net_terms_enabled + if hasattr(self, "custom_net_terms_enabled") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"default_net_terms={_default_net_terms!r}, " + f"automatic_net_terms={_automatic_net_terms!r}, " + f"remittance_net_terms={_remittance_net_terms!r}, " + f"net_terms_on_remittance_signups_enabled={_net_terms_on_remittance_signups_enabled!r}, " + f"custom_net_terms_enabled={_custom_net_terms_enabled!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'default_net_terms={(self.default_net_terms if hasattr(self, "default_net_terms") else None)!s}, ' - f'automatic_net_terms={(self.automatic_net_terms if hasattr(self, "automatic_net_terms") else None)!s}, ' - f'remittance_net_terms={(self.remittance_net_terms if hasattr(self, "remittance_net_terms") else None)!s}, ' - f'net_terms_on_remittance_signups_enabled={(self.net_terms_on_remittance_signups_enabled if hasattr(self, "net_terms_on_remittance_signups_enabled") else None)!s}, ' - f'custom_net_terms_enabled={(self.custom_net_terms_enabled if hasattr(self, "custom_net_terms_enabled") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _default_net_terms=( + self.default_net_terms + if hasattr(self, "default_net_terms") + else None + ) + _automatic_net_terms=( + self.automatic_net_terms + if hasattr(self, "automatic_net_terms") + else None + ) + _remittance_net_terms=( + self.remittance_net_terms + if hasattr(self, "remittance_net_terms") + else None + ) + _net_terms_on_remittance_signups_enabled=( + self.net_terms_on_remittance_signups_enabled + if hasattr(self, "net_terms_on_remittance_signups_enabled") + else None + ) + _custom_net_terms_enabled=( + self.custom_net_terms_enabled + if hasattr(self, "custom_net_terms_enabled") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"default_net_terms={_default_net_terms!s}, " + f"automatic_net_terms={_automatic_net_terms!s}, " + f"remittance_net_terms={_remittance_net_terms!s}, " + f"net_terms_on_remittance_signups_enabled={_net_terms_on_remittance_signups_enabled!s}, " + f"custom_net_terms_enabled={_custom_net_terms_enabled!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/offer.py b/advancedbilling/models/offer.py index 75d99072..0e10d57d 100644 --- a/advancedbilling/models/offer.py +++ b/advancedbilling/models/offer.py @@ -1,19 +1,23 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.offer_discount import OfferDiscount -from advancedbilling.models.offer_item import OfferItem -from advancedbilling.models.offer_signup_page import OfferSignupPage +from advancedbilling.models.offer_discount import ( + OfferDiscount, +) +from advancedbilling.models.offer_item import ( + OfferItem, +) +from advancedbilling.models.offer_signup_page import ( + OfferSignupPage, +) class Offer(object): - """Implementation of the 'Offer' model. Attributes: @@ -29,8 +33,7 @@ class Offer(object): created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. archived_at (datetime): The model property of type datetime. - offer_items (List[OfferItem]): The model property of type - List[OfferItem]. + offer_items (List[OfferItem]): The model property of type List[OfferItem]. offer_discounts (List[OfferDiscount]): The model property of type List[OfferDiscount]. product_family_name (str): The model property of type str. @@ -39,123 +42,132 @@ class Offer(object): product_price_in_cents (int): The model property of type int. offer_signup_pages (List[OfferSignupPage]): The model property of type List[OfferSignupPage]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "site_id": 'site_id', - "product_family_id": 'product_family_id', - "product_id": 'product_id', - "product_price_point_id": 'product_price_point_id', - "product_revisable_number": 'product_revisable_number', - "name": 'name', - "handle": 'handle', - "description": 'description', - "created_at": 'created_at', - "updated_at": 'updated_at', - "archived_at": 'archived_at', - "offer_items": 'offer_items', - "offer_discounts": 'offer_discounts', - "product_family_name": 'product_family_name', - "product_name": 'product_name', - "product_price_point_name": 'product_price_point_name', - "product_price_in_cents": 'product_price_in_cents', - "offer_signup_pages": 'offer_signup_pages' + "id": "id", + "site_id": "site_id", + "product_family_id": "product_family_id", + "product_id": "product_id", + "product_price_point_id": "product_price_point_id", + "product_revisable_number": "product_revisable_number", + "name": "name", + "handle": "handle", + "description": "description", + "created_at": "created_at", + "updated_at": "updated_at", + "archived_at": "archived_at", + "offer_items": "offer_items", + "offer_discounts": "offer_discounts", + "product_family_name": "product_family_name", + "product_name": "product_name", + "product_price_point_name": "product_price_point_name", + "product_price_in_cents": "product_price_in_cents", + "offer_signup_pages": "offer_signup_pages", } _optionals = [ - 'id', - 'site_id', - 'product_family_id', - 'product_id', - 'product_price_point_id', - 'product_revisable_number', - 'name', - 'handle', - 'description', - 'created_at', - 'updated_at', - 'archived_at', - 'offer_items', - 'offer_discounts', - 'product_family_name', - 'product_name', - 'product_price_point_name', - 'product_price_in_cents', - 'offer_signup_pages', + "id", + "site_id", + "product_family_id", + "product_id", + "product_price_point_id", + "product_revisable_number", + "name", + "handle", + "description", + "created_at", + "updated_at", + "archived_at", + "offer_items", + "offer_discounts", + "product_family_name", + "product_name", + "product_price_point_name", + "product_price_in_cents", + "offer_signup_pages", ] _nullables = [ - 'description', - 'archived_at', + "description", + "archived_at", ] - def __init__(self, - id=APIHelper.SKIP, - site_id=APIHelper.SKIP, - product_family_id=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - product_revisable_number=APIHelper.SKIP, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - description=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - offer_items=APIHelper.SKIP, - offer_discounts=APIHelper.SKIP, - product_family_name=APIHelper.SKIP, - product_name=APIHelper.SKIP, - product_price_point_name=APIHelper.SKIP, - product_price_in_cents=APIHelper.SKIP, - offer_signup_pages=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Offer class""" - + def __init__( + self, + id=APIHelper.SKIP, + site_id=APIHelper.SKIP, + product_family_id=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + product_revisable_number=APIHelper.SKIP, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + description=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + offer_items=APIHelper.SKIP, + offer_discounts=APIHelper.SKIP, + product_family_name=APIHelper.SKIP, + product_name=APIHelper.SKIP, + product_price_point_name=APIHelper.SKIP, + product_price_in_cents=APIHelper.SKIP, + offer_signup_pages=APIHelper.SKIP, + additional_properties=None): + """Initialize a Offer instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if product_family_id is not APIHelper.SKIP: - self.product_family_id = product_family_id + self.product_family_id = product_family_id if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if product_revisable_number is not APIHelper.SKIP: - self.product_revisable_number = product_revisable_number + self.product_revisable_number = product_revisable_number if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if description is not APIHelper.SKIP: - self.description = description + self.description = description if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if archived_at is not APIHelper.SKIP: - self.archived_at = APIHelper.apply_datetime_converter(archived_at, APIHelper.RFC3339DateTime) if archived_at else None + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None if offer_items is not APIHelper.SKIP: - self.offer_items = offer_items + self.offer_items = offer_items if offer_discounts is not APIHelper.SKIP: - self.offer_discounts = offer_discounts + self.offer_discounts = offer_discounts if product_family_name is not APIHelper.SKIP: - self.product_family_name = product_family_name + self.product_family_name = product_family_name if product_name is not APIHelper.SKIP: - self.product_name = product_name + self.product_name = product_name if product_price_point_name is not APIHelper.SKIP: - self.product_price_point_name = product_price_point_name + self.product_price_point_name = product_price_point_name if product_price_in_cents is not APIHelper.SKIP: - self.product_price_in_cents = product_price_in_cents + self.product_price_in_cents = product_price_in_cents if offer_signup_pages is not APIHelper.SKIP: - self.offer_signup_pages = offer_signup_pages + self.offer_signup_pages = offer_signup_pages # Add additional model properties to the instance if additional_properties is None: @@ -165,7 +177,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -176,47 +188,104 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - product_family_id = dictionary.get("product_family_id") if dictionary.get("product_family_id") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - product_revisable_number = dictionary.get("product_revisable_number") if dictionary.get("product_revisable_number") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - if 'archived_at' in dictionary.keys(): - archived_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("archived_at")).datetime if dictionary.get("archived_at") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + product_family_id =\ + dictionary.get("product_family_id")\ + if dictionary.get("product_family_id")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + product_revisable_number =\ + dictionary.get("product_revisable_number")\ + if dictionary.get("product_revisable_number")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + else: archived_at = APIHelper.SKIP offer_items = None - if dictionary.get('offer_items') is not None: - offer_items = [OfferItem.from_dictionary(x) for x in dictionary.get('offer_items')] + if dictionary.get("offer_items") is not None: + offer_items = [ + OfferItem.from_dictionary(x) + for x in dictionary.get("offer_items") + ] else: offer_items = APIHelper.SKIP offer_discounts = None - if dictionary.get('offer_discounts') is not None: - offer_discounts = [OfferDiscount.from_dictionary(x) for x in dictionary.get('offer_discounts')] + if dictionary.get("offer_discounts") is not None: + offer_discounts = [ + OfferDiscount.from_dictionary(x) + for x in dictionary.get("offer_discounts") + ] else: offer_discounts = APIHelper.SKIP - product_family_name = dictionary.get("product_family_name") if dictionary.get("product_family_name") else APIHelper.SKIP - product_name = dictionary.get("product_name") if dictionary.get("product_name") else APIHelper.SKIP - product_price_point_name = dictionary.get("product_price_point_name") if dictionary.get("product_price_point_name") else APIHelper.SKIP - product_price_in_cents = dictionary.get("product_price_in_cents") if dictionary.get("product_price_in_cents") else APIHelper.SKIP + product_family_name =\ + dictionary.get("product_family_name")\ + if dictionary.get("product_family_name")\ + else APIHelper.SKIP + product_name =\ + dictionary.get("product_name")\ + if dictionary.get("product_name")\ + else APIHelper.SKIP + product_price_point_name =\ + dictionary.get("product_price_point_name")\ + if dictionary.get("product_price_point_name")\ + else APIHelper.SKIP + product_price_in_cents =\ + dictionary.get("product_price_in_cents")\ + if dictionary.get("product_price_in_cents")\ + else APIHelper.SKIP offer_signup_pages = None - if dictionary.get('offer_signup_pages') is not None: - offer_signup_pages = [OfferSignupPage.from_dictionary(x) for x in dictionary.get('offer_signup_pages')] + if dictionary.get("offer_signup_pages") is not None: + offer_signup_pages = [ + OfferSignupPage.from_dictionary(x) + for x in dictionary.get("offer_signup_pages") + ] else: offer_signup_pages = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, site_id, @@ -240,47 +309,247 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'product_revisable_number={(self.product_revisable_number if hasattr(self, "product_revisable_number") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'offer_items={(self.offer_items if hasattr(self, "offer_items") else None)!r}, ' - f'offer_discounts={(self.offer_discounts if hasattr(self, "offer_discounts") else None)!r}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!r}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!r}, ' - f'product_price_point_name={(self.product_price_point_name if hasattr(self, "product_price_point_name") else None)!r}, ' - f'product_price_in_cents={(self.product_price_in_cents if hasattr(self, "product_price_in_cents") else None)!r}, ' - f'offer_signup_pages={(self.offer_signup_pages if hasattr(self, "offer_signup_pages") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_revisable_number=( + self.product_revisable_number + if hasattr(self, "product_revisable_number") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _offer_items=( + self.offer_items + if hasattr(self, "offer_items") + else None + ) + _offer_discounts=( + self.offer_discounts + if hasattr(self, "offer_discounts") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _product_price_point_name=( + self.product_price_point_name + if hasattr(self, "product_price_point_name") + else None + ) + _product_price_in_cents=( + self.product_price_in_cents + if hasattr(self, "product_price_in_cents") + else None + ) + _offer_signup_pages=( + self.offer_signup_pages + if hasattr(self, "offer_signup_pages") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"site_id={_site_id!r}, " + f"product_family_id={_product_family_id!r}, " + f"product_id={_product_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"product_revisable_number={_product_revisable_number!r}, " + f"name={_name!r}, " + f"handle={_handle!r}, " + f"description={_description!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"archived_at={_archived_at!r}, " + f"offer_items={_offer_items!r}, " + f"offer_discounts={_offer_discounts!r}, " + f"product_family_name={_product_family_name!r}, " + f"product_name={_product_name!r}, " + f"product_price_point_name={_product_price_point_name!r}, " + f"product_price_in_cents={_product_price_in_cents!r}, " + f"offer_signup_pages={_offer_signup_pages!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'product_revisable_number={(self.product_revisable_number if hasattr(self, "product_revisable_number") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'offer_items={(self.offer_items if hasattr(self, "offer_items") else None)!s}, ' - f'offer_discounts={(self.offer_discounts if hasattr(self, "offer_discounts") else None)!s}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!s}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!s}, ' - f'product_price_point_name={(self.product_price_point_name if hasattr(self, "product_price_point_name") else None)!s}, ' - f'product_price_in_cents={(self.product_price_in_cents if hasattr(self, "product_price_in_cents") else None)!s}, ' - f'offer_signup_pages={(self.offer_signup_pages if hasattr(self, "offer_signup_pages") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_revisable_number=( + self.product_revisable_number + if hasattr(self, "product_revisable_number") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _offer_items=( + self.offer_items + if hasattr(self, "offer_items") + else None + ) + _offer_discounts=( + self.offer_discounts + if hasattr(self, "offer_discounts") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _product_price_point_name=( + self.product_price_point_name + if hasattr(self, "product_price_point_name") + else None + ) + _product_price_in_cents=( + self.product_price_in_cents + if hasattr(self, "product_price_in_cents") + else None + ) + _offer_signup_pages=( + self.offer_signup_pages + if hasattr(self, "offer_signup_pages") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"site_id={_site_id!s}, " + f"product_family_id={_product_family_id!s}, " + f"product_id={_product_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"product_revisable_number={_product_revisable_number!s}, " + f"name={_name!s}, " + f"handle={_handle!s}, " + f"description={_description!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"archived_at={_archived_at!s}, " + f"offer_items={_offer_items!s}, " + f"offer_discounts={_offer_discounts!s}, " + f"product_family_name={_product_family_name!s}, " + f"product_name={_product_name!s}, " + f"product_price_point_name={_product_price_point_name!s}, " + f"product_price_in_cents={_product_price_in_cents!s}, " + f"offer_signup_pages={_offer_signup_pages!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/offer_discount.py b/advancedbilling/models/offer_discount.py index 0cf5c215..4a8bade4 100644 --- a/advancedbilling/models/offer_discount.py +++ b/advancedbilling/models/offer_discount.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class OfferDiscount(object): - """Implementation of the 'Offer Discount' model. Attributes: coupon_code (str): The model property of type str. coupon_id (int): The model property of type int. coupon_name (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "coupon_code": 'coupon_code', - "coupon_id": 'coupon_id', - "coupon_name": 'coupon_name' + "coupon_code": "coupon_code", + "coupon_id": "coupon_id", + "coupon_name": "coupon_name", } _optionals = [ - 'coupon_code', - 'coupon_id', - 'coupon_name', + "coupon_code", + "coupon_id", + "coupon_name", ] - def __init__(self, - coupon_code=APIHelper.SKIP, - coupon_id=APIHelper.SKIP, - coupon_name=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OfferDiscount class""" - + def __init__( + self, + coupon_code=APIHelper.SKIP, + coupon_id=APIHelper.SKIP, + coupon_name=APIHelper.SKIP, + additional_properties=None): + """Initialize a OfferDiscount instance.""" # Initialize members of the class if coupon_code is not APIHelper.SKIP: - self.coupon_code = coupon_code + self.coupon_code = coupon_code if coupon_id is not APIHelper.SKIP: - self.coupon_id = coupon_id + self.coupon_id = coupon_id if coupon_name is not APIHelper.SKIP: - self.coupon_name = coupon_name + self.coupon_name = coupon_name # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - coupon_code = dictionary.get("coupon_code") if dictionary.get("coupon_code") else APIHelper.SKIP - coupon_id = dictionary.get("coupon_id") if dictionary.get("coupon_id") else APIHelper.SKIP - coupon_name = dictionary.get("coupon_name") if dictionary.get("coupon_name") else APIHelper.SKIP + coupon_code =\ + dictionary.get("coupon_code")\ + if dictionary.get("coupon_code")\ + else APIHelper.SKIP + coupon_id =\ + dictionary.get("coupon_id")\ + if dictionary.get("coupon_id")\ + else APIHelper.SKIP + coupon_name =\ + dictionary.get("coupon_name")\ + if dictionary.get("coupon_name")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(coupon_code, coupon_id, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!r}, ' - f'coupon_id={(self.coupon_id if hasattr(self, "coupon_id") else None)!r}, ' - f'coupon_name={(self.coupon_name if hasattr(self, "coupon_name") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _coupon_id=( + self.coupon_id + if hasattr(self, "coupon_id") + else None + ) + _coupon_name=( + self.coupon_name + if hasattr(self, "coupon_name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"coupon_code={_coupon_code!r}, " + f"coupon_id={_coupon_id!r}, " + f"coupon_name={_coupon_name!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!s}, ' - f'coupon_id={(self.coupon_id if hasattr(self, "coupon_id") else None)!s}, ' - f'coupon_name={(self.coupon_name if hasattr(self, "coupon_name") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _coupon_id=( + self.coupon_id + if hasattr(self, "coupon_id") + else None + ) + _coupon_name=( + self.coupon_name + if hasattr(self, "coupon_name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"coupon_code={_coupon_code!s}, " + f"coupon_id={_coupon_id!s}, " + f"coupon_name={_coupon_name!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/offer_item.py b/advancedbilling/models/offer_item.py index bda0c8ef..6da1a13d 100644 --- a/advancedbilling/models/offer_item.py +++ b/advancedbilling/models/offer_item.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.currency_price import CurrencyPrice +from advancedbilling.models.currency_price import ( + CurrencyPrice, +) class OfferItem(object): - """Implementation of the 'Offer Item' model. Attributes: @@ -24,84 +24,84 @@ class OfferItem(object): price_point_name (str): The model property of type str. currency_prices (List[CurrencyPrice]): The model property of type List[CurrencyPrice]. - interval (int): The numerical interval. i.e. an interval of '30' - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + interval (int): The numerical interval. i.e. an interval of '30' coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "price_point_id": 'price_point_id', - "starting_quantity": 'starting_quantity', - "editable": 'editable', - "component_unit_price": 'component_unit_price', - "component_name": 'component_name', - "price_point_name": 'price_point_name', - "currency_prices": 'currency_prices', - "interval": 'interval', - "interval_unit": 'interval_unit' + "component_id": "component_id", + "price_point_id": "price_point_id", + "starting_quantity": "starting_quantity", + "editable": "editable", + "component_unit_price": "component_unit_price", + "component_name": "component_name", + "price_point_name": "price_point_name", + "currency_prices": "currency_prices", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'component_id', - 'price_point_id', - 'starting_quantity', - 'editable', - 'component_unit_price', - 'component_name', - 'price_point_name', - 'currency_prices', - 'interval', - 'interval_unit', + "component_id", + "price_point_id", + "starting_quantity", + "editable", + "component_unit_price", + "component_name", + "price_point_name", + "currency_prices", + "interval", + "interval_unit", ] _nullables = [ - 'interval_unit', + "interval_unit", ] - def __init__(self, - component_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - starting_quantity=APIHelper.SKIP, - editable=APIHelper.SKIP, - component_unit_price=APIHelper.SKIP, - component_name=APIHelper.SKIP, - price_point_name=APIHelper.SKIP, - currency_prices=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OfferItem class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + starting_quantity=APIHelper.SKIP, + editable=APIHelper.SKIP, + component_unit_price=APIHelper.SKIP, + component_name=APIHelper.SKIP, + price_point_name=APIHelper.SKIP, + currency_prices=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a OfferItem instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if starting_quantity is not APIHelper.SKIP: - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity if editable is not APIHelper.SKIP: - self.editable = editable + self.editable = editable if component_unit_price is not APIHelper.SKIP: - self.component_unit_price = component_unit_price + self.component_unit_price = component_unit_price if component_name is not APIHelper.SKIP: - self.component_name = component_name + self.component_name = component_name if price_point_name is not APIHelper.SKIP: - self.price_point_name = price_point_name + self.price_point_name = price_point_name if currency_prices is not APIHelper.SKIP: - self.currency_prices = currency_prices + self.currency_prices = currency_prices if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -111,7 +111,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -122,27 +122,59 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - starting_quantity = dictionary.get("starting_quantity") if dictionary.get("starting_quantity") else APIHelper.SKIP - editable = dictionary.get("editable") if "editable" in dictionary.keys() else APIHelper.SKIP - component_unit_price = dictionary.get("component_unit_price") if dictionary.get("component_unit_price") else APIHelper.SKIP - component_name = dictionary.get("component_name") if dictionary.get("component_name") else APIHelper.SKIP - price_point_name = dictionary.get("price_point_name") if dictionary.get("price_point_name") else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + starting_quantity =\ + dictionary.get("starting_quantity")\ + if dictionary.get("starting_quantity")\ + else APIHelper.SKIP + editable =\ + dictionary.get("editable")\ + if "editable" in dictionary.keys()\ + else APIHelper.SKIP + component_unit_price =\ + dictionary.get("component_unit_price")\ + if dictionary.get("component_unit_price")\ + else APIHelper.SKIP + component_name =\ + dictionary.get("component_name")\ + if dictionary.get("component_name")\ + else APIHelper.SKIP + price_point_name =\ + dictionary.get("price_point_name")\ + if dictionary.get("price_point_name")\ + else APIHelper.SKIP currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [CurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + CurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] else: currency_prices = APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, price_point_id, @@ -157,29 +189,139 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!r}, ' - f'editable={(self.editable if hasattr(self, "editable") else None)!r}, ' - f'component_unit_price={(self.component_unit_price if hasattr(self, "component_unit_price") else None)!r}, ' - f'component_name={(self.component_name if hasattr(self, "component_name") else None)!r}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!r}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _editable=( + self.editable + if hasattr(self, "editable") + else None + ) + _component_unit_price=( + self.component_unit_price + if hasattr(self, "component_unit_price") + else None + ) + _component_name=( + self.component_name + if hasattr(self, "component_name") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"starting_quantity={_starting_quantity!r}, " + f"editable={_editable!r}, " + f"component_unit_price={_component_unit_price!r}, " + f"component_name={_component_name!r}, " + f"price_point_name={_price_point_name!r}, " + f"currency_prices={_currency_prices!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!s}, ' - f'editable={(self.editable if hasattr(self, "editable") else None)!s}, ' - f'component_unit_price={(self.component_unit_price if hasattr(self, "component_unit_price") else None)!s}, ' - f'component_name={(self.component_name if hasattr(self, "component_name") else None)!s}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!s}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _editable=( + self.editable + if hasattr(self, "editable") + else None + ) + _component_unit_price=( + self.component_unit_price + if hasattr(self, "component_unit_price") + else None + ) + _component_name=( + self.component_name + if hasattr(self, "component_name") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"starting_quantity={_starting_quantity!s}, " + f"editable={_editable!s}, " + f"component_unit_price={_component_unit_price!s}, " + f"component_name={_component_name!s}, " + f"price_point_name={_price_point_name!s}, " + f"currency_prices={_currency_prices!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/offer_response.py b/advancedbilling/models/offer_response.py index 48234de1..6be29d72 100644 --- a/advancedbilling/models/offer_response.py +++ b/advancedbilling/models/offer_response.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.offer import Offer class OfferResponse(object): - """Implementation of the 'Offer Response' model. Attributes: offer (Offer): The model property of type Offer. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "offer": 'offer' + "offer": "offer", } _optionals = [ - 'offer', + "offer", ] - def __init__(self, - offer=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OfferResponse class""" - + def __init__( + self, + offer=APIHelper.SKIP, + additional_properties=None): + """Initialize a OfferResponse instance.""" # Initialize members of the class if offer is not APIHelper.SKIP: - self.offer = offer + self.offer = offer # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +56,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - offer = Offer.from_dictionary(dictionary.get('offer')) if 'offer' in dictionary.keys() else APIHelper.SKIP + offer =\ + Offer.from_dictionary( + dictionary.get("offer"))\ + if "offer" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(offer, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'offer={(self.offer if hasattr(self, "offer") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _offer=( + self.offer + if hasattr(self, "offer") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"offer={_offer!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'offer={(self.offer if hasattr(self, "offer") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _offer=( + self.offer + if hasattr(self, "offer") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"offer={_offer!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/offer_signup_page.py b/advancedbilling/models/offer_signup_page.py index d1b5592b..766085da 100644 --- a/advancedbilling/models/offer_signup_page.py +++ b/advancedbilling/models/offer_signup_page.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class OfferSignupPage(object): - """Implementation of the 'Offer Signup Page' model. Attributes: @@ -20,53 +18,53 @@ class OfferSignupPage(object): return_url (str): The model property of type str. return_params (str): The model property of type str. url (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "nickname": 'nickname', - "enabled": 'enabled', - "return_url": 'return_url', - "return_params": 'return_params', - "url": 'url' + "id": "id", + "nickname": "nickname", + "enabled": "enabled", + "return_url": "return_url", + "return_params": "return_params", + "url": "url", } _optionals = [ - 'id', - 'nickname', - 'enabled', - 'return_url', - 'return_params', - 'url', + "id", + "nickname", + "enabled", + "return_url", + "return_params", + "url", ] - def __init__(self, - id=APIHelper.SKIP, - nickname=APIHelper.SKIP, - enabled=APIHelper.SKIP, - return_url=APIHelper.SKIP, - return_params=APIHelper.SKIP, - url=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OfferSignupPage class""" - + def __init__( + self, + id=APIHelper.SKIP, + nickname=APIHelper.SKIP, + enabled=APIHelper.SKIP, + return_url=APIHelper.SKIP, + return_params=APIHelper.SKIP, + url=APIHelper.SKIP, + additional_properties=None): + """Initialize a OfferSignupPage instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if nickname is not APIHelper.SKIP: - self.nickname = nickname + self.nickname = nickname if enabled is not APIHelper.SKIP: - self.enabled = enabled + self.enabled = enabled if return_url is not APIHelper.SKIP: - self.return_url = return_url + self.return_url = return_url if return_params is not APIHelper.SKIP: - self.return_params = return_params + self.return_params = return_params if url is not APIHelper.SKIP: - self.url = url + self.url = url # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +74,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,19 +85,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - nickname = dictionary.get("nickname") if dictionary.get("nickname") else APIHelper.SKIP - enabled = dictionary.get("enabled") if "enabled" in dictionary.keys() else APIHelper.SKIP - return_url = dictionary.get("return_url") if dictionary.get("return_url") else APIHelper.SKIP - return_params = dictionary.get("return_params") if dictionary.get("return_params") else APIHelper.SKIP - url = dictionary.get("url") if dictionary.get("url") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + nickname =\ + dictionary.get("nickname")\ + if dictionary.get("nickname")\ + else APIHelper.SKIP + enabled =\ + dictionary.get("enabled")\ + if "enabled" in dictionary.keys()\ + else APIHelper.SKIP + return_url =\ + dictionary.get("return_url")\ + if dictionary.get("return_url")\ + else APIHelper.SKIP + return_params =\ + dictionary.get("return_params")\ + if dictionary.get("return_params")\ + else APIHelper.SKIP + url =\ + dictionary.get("url")\ + if dictionary.get("url")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, nickname, @@ -110,21 +128,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'nickname={(self.nickname if hasattr(self, "nickname") else None)!r}, ' - f'enabled={(self.enabled if hasattr(self, "enabled") else None)!r}, ' - f'return_url={(self.return_url if hasattr(self, "return_url") else None)!r}, ' - f'return_params={(self.return_params if hasattr(self, "return_params") else None)!r}, ' - f'url={(self.url if hasattr(self, "url") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _nickname=( + self.nickname + if hasattr(self, "nickname") + else None + ) + _enabled=( + self.enabled + if hasattr(self, "enabled") + else None + ) + _return_url=( + self.return_url + if hasattr(self, "return_url") + else None + ) + _return_params=( + self.return_params + if hasattr(self, "return_params") + else None + ) + _url=( + self.url + if hasattr(self, "url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"nickname={_nickname!r}, " + f"enabled={_enabled!r}, " + f"return_url={_return_url!r}, " + f"return_params={_return_params!r}, " + f"url={_url!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'nickname={(self.nickname if hasattr(self, "nickname") else None)!s}, ' - f'enabled={(self.enabled if hasattr(self, "enabled") else None)!s}, ' - f'return_url={(self.return_url if hasattr(self, "return_url") else None)!s}, ' - f'return_params={(self.return_params if hasattr(self, "return_params") else None)!s}, ' - f'url={(self.url if hasattr(self, "url") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _nickname=( + self.nickname + if hasattr(self, "nickname") + else None + ) + _enabled=( + self.enabled + if hasattr(self, "enabled") + else None + ) + _return_url=( + self.return_url + if hasattr(self, "return_url") + else None + ) + _return_params=( + self.return_params + if hasattr(self, "return_params") + else None + ) + _url=( + self.url + if hasattr(self, "url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"nickname={_nickname!s}, " + f"enabled={_enabled!s}, " + f"return_url={_return_url!s}, " + f"return_params={_return_params!s}, " + f"url={_url!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/ok_response.py b/advancedbilling/models/ok_response.py index fc8eb147..bfc80171 100644 --- a/advancedbilling/models/ok_response.py +++ b/advancedbilling/models/ok_response.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class OkResponse(object): - """Implementation of the 'Ok Response' model. Attributes: ok (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "ok": 'ok' + "ok": "ok", } _optionals = [ - 'ok', + "ok", ] - def __init__(self, - ok=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OkResponse class""" - + def __init__( + self, + ok=APIHelper.SKIP, + additional_properties=None): + """Initialize a OkResponse instance.""" # Initialize members of the class if ok is not APIHelper.SKIP: - self.ok = ok + self.ok = ok # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - ok = dictionary.get("ok") if dictionary.get("ok") else APIHelper.SKIP + ok =\ + dictionary.get("ok")\ + if dictionary.get("ok")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(ok, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'ok={(self.ok if hasattr(self, "ok") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _ok=( + self.ok + if hasattr(self, "ok") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ok={_ok!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'ok={(self.ok if hasattr(self, "ok") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _ok=( + self.ok + if hasattr(self, "ok") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ok={_ok!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/on_off_component.py b/advancedbilling/models/on_off_component.py index f96a56d4..99d4e26b 100644 --- a/advancedbilling/models/on_off_component.py +++ b/advancedbilling/models/on_off_component.py @@ -1,157 +1,150 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.component_price_point_item import ( + ComponentPricePointItem, +) class OnOffComponent(object): - """Implementation of the 'On/Off Component' model. Attributes: - name (str): A name for this component that is suitable for showing - customers and displaying on billing statements, ie. "Minutes". - description (str): A description for the component that will be - displayed to the user on the hosted signup page. - handle (str): A unique identifier for your use that can be used to - retrieve this component is subsequent requests. Must start with a - letter or number and may only contain lowercase letters, numbers, - or the characters '.', ':', '-', or '_'. - taxable (bool): Boolean flag describing whether a component is taxable - or not. + name (str): A name for this component that is suitable for showing customers + and displaying on billing statements, ie. "Minutes". + description (str): A description for the component that will be displayed to + the user on the hosted signup page. + handle (str): A unique identifier for your use that can be used to retrieve + this component is subsequent requests. Must start with a letter or + number and may only contain lowercase letters, numbers, or the characters + '.', ':', '-', or '_'. + taxable (bool): Boolean flag describing whether a component is taxable or not. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - price_points (List[ComponentPricePointItem]): The model property of - type List[ComponentPricePointItem]. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. + price_points (List[ComponentPricePointItem]): The model property of type + List[ComponentPricePointItem]. unit_price (str | float): This is the amount that the customer will be - charged when they turn the component on for the subscription. The - price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or - 0.00000065 - tax_code (str): A string representing the tax code related to the - component type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. - hide_date_range_on_invoice (bool): (Only available on Relationship - Invoicing sites) Boolean flag describing if the service date range - should show for the component on generated invoices. + charged when they turn the component on for the subscription. The price + can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + tax_code (str): A string representing the tax code related to the component + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. + hide_date_range_on_invoice (bool): (Only available on Relationship Invoicing + sites) Boolean flag describing if the service date range should show for + the component on generated invoices. display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. - public_signup_page_ids (List[int]): The model property of type - List[int]. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component's - default price point would renew every 30 days. This property is - only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component's default price point, either month or day. - This property is only available for sites with Multifrequency - enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + public_signup_page_ids (List[int]): The model property of type List[int]. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component's default price point + would renew every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component's default price point, either month or day. This property + is only available for sites with Multifrequency enabled. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "unit_price": 'unit_price', - "description": 'description', - "handle": 'handle', - "taxable": 'taxable', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "price_points": 'price_points', - "tax_code": 'tax_code', - "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "display_on_hosted_page": 'display_on_hosted_page', - "allow_fractional_quantities": 'allow_fractional_quantities', - "public_signup_page_ids": 'public_signup_page_ids', - "interval": 'interval', - "interval_unit": 'interval_unit' + "name": "name", + "unit_price": "unit_price", + "description": "description", + "handle": "handle", + "taxable": "taxable", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "price_points": "price_points", + "tax_code": "tax_code", + "hide_date_range_on_invoice": "hide_date_range_on_invoice", + "display_on_hosted_page": "display_on_hosted_page", + "allow_fractional_quantities": "allow_fractional_quantities", + "public_signup_page_ids": "public_signup_page_ids", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'description', - 'handle', - 'taxable', - 'upgrade_charge', - 'downgrade_credit', - 'price_points', - 'tax_code', - 'hide_date_range_on_invoice', - 'display_on_hosted_page', - 'allow_fractional_quantities', - 'public_signup_page_ids', - 'interval', - 'interval_unit', + "description", + "handle", + "taxable", + "upgrade_charge", + "downgrade_credit", + "price_points", + "tax_code", + "hide_date_range_on_invoice", + "display_on_hosted_page", + "allow_fractional_quantities", + "public_signup_page_ids", + "interval", + "interval_unit", ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', - 'interval_unit', + "upgrade_charge", + "downgrade_credit", + "interval_unit", ] - def __init__(self, - name=None, - unit_price=None, - description=APIHelper.SKIP, - handle=APIHelper.SKIP, - taxable=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - price_points=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - hide_date_range_on_invoice=APIHelper.SKIP, - display_on_hosted_page=APIHelper.SKIP, - allow_fractional_quantities=APIHelper.SKIP, - public_signup_page_ids=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OnOffComponent class""" - + def __init__( + self, + name=None, + unit_price=None, + description=APIHelper.SKIP, + handle=APIHelper.SKIP, + taxable=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + price_points=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + hide_date_range_on_invoice=APIHelper.SKIP, + display_on_hosted_page=APIHelper.SKIP, + allow_fractional_quantities=APIHelper.SKIP, + public_signup_page_ids=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a OnOffComponent instance.""" # Initialize members of the class - self.name = name + self.name = name if description is not APIHelper.SKIP: - self.description = description + self.description = description if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if taxable is not APIHelper.SKIP: - self.taxable = taxable + self.taxable = taxable if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if price_points is not APIHelper.SKIP: - self.price_points = price_points - self.unit_price = unit_price + self.price_points = price_points + self.unit_price = unit_price if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if hide_date_range_on_invoice is not APIHelper.SKIP: - self.hide_date_range_on_invoice = hide_date_range_on_invoice + self.hide_date_range_on_invoice = hide_date_range_on_invoice if display_on_hosted_page is not APIHelper.SKIP: - self.display_on_hosted_page = display_on_hosted_page + self.display_on_hosted_page = display_on_hosted_page if allow_fractional_quantities is not APIHelper.SKIP: - self.allow_fractional_quantities = allow_fractional_quantities + self.allow_fractional_quantities = allow_fractional_quantities if public_signup_page_ids is not APIHelper.SKIP: - self.public_signup_page_ids = public_signup_page_ids + self.public_signup_page_ids = public_signup_page_ids if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -161,7 +154,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -172,33 +165,85 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('OnOffComponentUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else None - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("OnOffComponentUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP price_points = None - if dictionary.get('price_points') is not None: - price_points = [ComponentPricePointItem.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ComponentPricePointItem.from_dictionary(x) + for x in dictionary.get("price_points") + ] else: price_points = APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP - hide_date_range_on_invoice = dictionary.get("hide_date_range_on_invoice") if "hide_date_range_on_invoice" in dictionary.keys() else APIHelper.SKIP - display_on_hosted_page = dictionary.get("display_on_hosted_page") if "display_on_hosted_page" in dictionary.keys() else APIHelper.SKIP - allow_fractional_quantities = dictionary.get("allow_fractional_quantities") if "allow_fractional_quantities" in dictionary.keys() else APIHelper.SKIP - public_signup_page_ids = dictionary.get("public_signup_page_ids") if dictionary.get("public_signup_page_ids") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + hide_date_range_on_invoice =\ + dictionary.get("hide_date_range_on_invoice")\ + if "hide_date_range_on_invoice" in dictionary.keys()\ + else APIHelper.SKIP + display_on_hosted_page =\ + dictionary.get("display_on_hosted_page")\ + if "display_on_hosted_page" in dictionary.keys()\ + else APIHelper.SKIP + allow_fractional_quantities =\ + dictionary.get("allow_fractional_quantities")\ + if "allow_fractional_quantities" in dictionary.keys()\ + else APIHelper.SKIP + public_signup_page_ids =\ + dictionary.get("public_signup_page_ids")\ + if dictionary.get("public_signup_page_ids")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, unit_price, @@ -219,7 +264,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -230,54 +275,212 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.name, - type_callable=lambda value: isinstance(value, str)) \ - and UnionTypeLookUp.get('OnOffComponentUnitPrice').validate(dictionary.unit_price).is_valid + return APIHelper.is_valid_type( + value=dictionary.name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and (UnionTypeLookUp.get("OnOffComponentUnitPrice") + .validate(dictionary.unit_price).is_valid) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('name'), - type_callable=lambda value: isinstance(value, str)) \ - and UnionTypeLookUp.get('OnOffComponentUnitPrice').validate(dictionary.get('unit_price')).is_valid + return APIHelper.is_valid_type( + value=dictionary.get("name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and (UnionTypeLookUp.get("OnOffComponentUnitPrice") + .validate(dictionary.get("unit_price")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!r}, ' - f'unit_price={self.unit_price!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!r}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!r}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!r}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=self.unit_price + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"description={_description!r}, " + f"handle={_handle!r}, " + f"taxable={_taxable!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"price_points={_price_points!r}, " + f"unit_price={_unit_price!r}, " + f"tax_code={_tax_code!r}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!r}, " + f"display_on_hosted_page={_display_on_hosted_page!r}, " + f"allow_fractional_quantities={_allow_fractional_quantities!r}, " + f"public_signup_page_ids={_public_signup_page_ids!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!s}, ' - f'unit_price={self.unit_price!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!s}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!s}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!s}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=self.unit_price + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"description={_description!s}, " + f"handle={_handle!s}, " + f"taxable={_taxable!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"price_points={_price_points!s}, " + f"unit_price={_unit_price!s}, " + f"tax_code={_tax_code!s}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!s}, " + f"display_on_hosted_page={_display_on_hosted_page!s}, " + f"allow_fractional_quantities={_allow_fractional_quantities!s}, " + f"public_signup_page_ids={_public_signup_page_ids!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/organization_address.py b/advancedbilling/models/organization_address.py index 7c8ea5bd..c85c9994 100644 --- a/advancedbilling/models/organization_address.py +++ b/advancedbilling/models/organization_address.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class OrganizationAddress(object): - """Implementation of the 'Organization Address' model. Attributes: @@ -22,74 +20,74 @@ class OrganizationAddress(object): country (str): The model property of type str. name (str): The model property of type str. phone (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "street": 'street', - "line_2": 'line2', - "city": 'city', - "state": 'state', - "zip": 'zip', - "country": 'country', - "name": 'name', - "phone": 'phone' + "street": "street", + "line_2": "line2", + "city": "city", + "state": "state", + "zip": "zip", + "country": "country", + "name": "name", + "phone": "phone", } _optionals = [ - 'street', - 'line_2', - 'city', - 'state', - 'zip', - 'country', - 'name', - 'phone', + "street", + "line_2", + "city", + "state", + "zip", + "country", + "name", + "phone", ] _nullables = [ - 'street', - 'line_2', - 'city', - 'state', - 'zip', - 'country', - 'name', - 'phone', + "street", + "line_2", + "city", + "state", + "zip", + "country", + "name", + "phone", ] - def __init__(self, - street=APIHelper.SKIP, - line_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - name=APIHelper.SKIP, - phone=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OrganizationAddress class""" - + def __init__( + self, + street=APIHelper.SKIP, + line_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + name=APIHelper.SKIP, + phone=APIHelper.SKIP, + additional_properties=None): + """Initialize a OrganizationAddress instance.""" # Initialize members of the class if street is not APIHelper.SKIP: - self.street = street + self.street = street if line_2 is not APIHelper.SKIP: - self.line_2 = line_2 + self.line_2 = line_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country if name is not APIHelper.SKIP: - self.name = name + self.name = name if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone # Add additional model properties to the instance if additional_properties is None: @@ -99,7 +97,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -110,21 +108,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - street = dictionary.get("street") if "street" in dictionary.keys() else APIHelper.SKIP - line_2 = dictionary.get("line2") if "line2" in dictionary.keys() else APIHelper.SKIP - city = dictionary.get("city") if "city" in dictionary.keys() else APIHelper.SKIP - state = dictionary.get("state") if "state" in dictionary.keys() else APIHelper.SKIP - zip = dictionary.get("zip") if "zip" in dictionary.keys() else APIHelper.SKIP - country = dictionary.get("country") if "country" in dictionary.keys() else APIHelper.SKIP - name = dictionary.get("name") if "name" in dictionary.keys() else APIHelper.SKIP - phone = dictionary.get("phone") if "phone" in dictionary.keys() else APIHelper.SKIP + street =\ + dictionary.get("street")\ + if "street" in dictionary.keys()\ + else APIHelper.SKIP + line_2 =\ + dictionary.get("line2")\ + if "line2" in dictionary.keys()\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if "city" in dictionary.keys()\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if "state" in dictionary.keys()\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if "zip" in dictionary.keys()\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if "country" in dictionary.keys()\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if "name" in dictionary.keys()\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if "phone" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(street, line_2, @@ -137,25 +161,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'street={(self.street if hasattr(self, "street") else None)!r}, ' - f'line_2={(self.line_2 if hasattr(self, "line_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _street=( + self.street + if hasattr(self, "street") + else None + ) + _line_2=( + self.line_2 + if hasattr(self, "line_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"street={_street!r}, " + f"line_2={_line_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"name={_name!r}, " + f"phone={_phone!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'street={(self.street if hasattr(self, "street") else None)!s}, ' - f'line_2={(self.line_2 if hasattr(self, "line_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _street=( + self.street + if hasattr(self, "street") + else None + ) + _line_2=( + self.line_2 + if hasattr(self, "line_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"street={_street!s}, " + f"line_2={_line_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"name={_name!s}, " + f"phone={_phone!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/origin_invoice.py b/advancedbilling/models/origin_invoice.py index b86266b5..2c201795 100644 --- a/advancedbilling/models/origin_invoice.py +++ b/advancedbilling/models/origin_invoice.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class OriginInvoice(object): - """Implementation of the 'Origin Invoice' model. Attributes: uid (str): The UID of the invoice serving as an origin invoice. number (str): The number of the invoice serving as an origin invoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "number": 'number' + "uid": "uid", + "number": "number", } _optionals = [ - 'uid', - 'number', + "uid", + "number", ] - def __init__(self, - uid=APIHelper.SKIP, - number=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OriginInvoice class""" - + def __init__( + self, + uid=APIHelper.SKIP, + number=APIHelper.SKIP, + additional_properties=None): + """Initialize a OriginInvoice instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if number is not APIHelper.SKIP: - self.number = number + self.number = number # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,15 +61,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - number = dictionary.get("number") if dictionary.get("number") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, number, @@ -79,7 +85,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -90,7 +96,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -100,13 +105,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'number={(self.number if hasattr(self, "number") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"number={_number!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'number={(self.number if hasattr(self, "number") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"number={_number!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/overage_pricing.py b/advancedbilling/models/overage_pricing.py index 0c3d220c..4514aff7 100644 --- a/advancedbilling/models/overage_pricing.py +++ b/advancedbilling/models/overage_pricing.py @@ -1,51 +1,51 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.price import Price -from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.pricing_scheme import ( + PricingScheme, +) class OveragePricing(object): - """Implementation of the 'Overage Pricing' model. Attributes: - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. prices (List[Price]): The model property of type List[Price]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "pricing_scheme": 'pricing_scheme', - "prices": 'prices' + "pricing_scheme": "pricing_scheme", + "prices": "prices", } _optionals = [ - 'prices', + "prices", ] - def __init__(self, - pricing_scheme=None, - prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OveragePricing class""" - + def __init__( + self, + pricing_scheme=None, + prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a OveragePricing instance.""" # Initialize members of the class - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices # Add additional model properties to the instance if additional_properties is None: @@ -55,7 +55,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -66,19 +66,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(pricing_scheme, prices, @@ -86,7 +94,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -97,25 +105,50 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.pricing_scheme, - type_callable=lambda value: PricingScheme.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.pricing_scheme, + type_callable=lambda value: + PricingScheme.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('pricing_scheme'), - type_callable=lambda value: PricingScheme.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("pricing_scheme"), + type_callable=lambda value: + PricingScheme.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/override_subscription.py b/advancedbilling/models/override_subscription.py index 6ba5d0f3..74f53c31 100644 --- a/advancedbilling/models/override_subscription.py +++ b/advancedbilling/models/override_subscription.py @@ -1,83 +1,91 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class OverrideSubscription(object): - """Implementation of the 'Override Subscription' model. Attributes: - activated_at (datetime): Can be used to record an external signup - date. Chargify uses this field to record when a subscription first - goes active (either at signup or at trial end). Only ISO8601 - format is supported. - canceled_at (datetime): Can be used to record an external cancellation - date. Chargify sets this field automatically when a subscription - is canceled, whether by request or via dunning. Only ISO8601 - format is supported. - cancellation_message (str): Can be used to record a reason for the - original cancellation. - expires_at (datetime): Can be used to record an external expiration - date. Chargify sets this field automatically when a subscription - expires (ceases billing) after a prescribed amount of time. Only - ISO8601 format is supported. This field is not supported when - Multi-frequency is enabled for the Site. To change the Term End of - a Subscription, use the Update Subscription endpoint. - current_period_starts_at (datetime): Can only be used when a - subscription is unbilled, which happens when a future initial - billing date is passed at subscription creation. The value passed - must be before the current date and time. Allows you to set when - the period started so mid period component allocations have the - correct proration. Only ISO8601 format is supported. - additional_properties (Dict[str, object]): The additional properties - for the model. + activated_at (datetime): Can be used to record an external signup date. + Chargify uses this field to record when a subscription first goes active + (either at signup or at trial end). Only ISO8601 format is supported. + canceled_at (datetime): Can be used to record an external cancellation date. + Chargify sets this field automatically when a subscription is canceled, + whether by request or via dunning. Only ISO8601 format is supported. + cancellation_message (str): Can be used to record a reason for the original + cancellation. + expires_at (datetime): Can be used to record an external expiration date. + Chargify sets this field automatically when a subscription expires + (ceases billing) after a prescribed amount of time. Only ISO8601 format + is supported. This field is not supported when Multi-frequency is enabled + for the Site. To change the Term End of a Subscription, use the Update + Subscription endpoint. + current_period_starts_at (datetime): Can only be used when a subscription is + unbilled, which happens when a future initial billing date is passed at + subscription creation. The value passed must be before the current date + and time. Allows you to set when the period started so mid period + component allocations have the correct proration. Only ISO8601 format is + supported. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "activated_at": 'activated_at', - "canceled_at": 'canceled_at', - "cancellation_message": 'cancellation_message', - "expires_at": 'expires_at', - "current_period_starts_at": 'current_period_starts_at' + "activated_at": "activated_at", + "canceled_at": "canceled_at", + "cancellation_message": "cancellation_message", + "expires_at": "expires_at", + "current_period_starts_at": "current_period_starts_at", } _optionals = [ - 'activated_at', - 'canceled_at', - 'cancellation_message', - 'expires_at', - 'current_period_starts_at', + "activated_at", + "canceled_at", + "cancellation_message", + "expires_at", + "current_period_starts_at", ] - def __init__(self, - activated_at=APIHelper.SKIP, - canceled_at=APIHelper.SKIP, - cancellation_message=APIHelper.SKIP, - expires_at=APIHelper.SKIP, - current_period_starts_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the OverrideSubscription class""" - + def __init__( + self, + activated_at=APIHelper.SKIP, + canceled_at=APIHelper.SKIP, + cancellation_message=APIHelper.SKIP, + expires_at=APIHelper.SKIP, + current_period_starts_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a OverrideSubscription instance.""" # Initialize members of the class if activated_at is not APIHelper.SKIP: - self.activated_at = APIHelper.apply_datetime_converter(activated_at, APIHelper.RFC3339DateTime) if activated_at else None + self.activated_at =\ + APIHelper.apply_datetime_converter( + activated_at, APIHelper.RFC3339DateTime)\ + if activated_at else None if canceled_at is not APIHelper.SKIP: - self.canceled_at = APIHelper.apply_datetime_converter(canceled_at, APIHelper.RFC3339DateTime) if canceled_at else None + self.canceled_at =\ + APIHelper.apply_datetime_converter( + canceled_at, APIHelper.RFC3339DateTime)\ + if canceled_at else None if cancellation_message is not APIHelper.SKIP: - self.cancellation_message = cancellation_message + self.cancellation_message = cancellation_message if expires_at is not APIHelper.SKIP: - self.expires_at = APIHelper.apply_datetime_converter(expires_at, APIHelper.RFC3339DateTime) if expires_at else None + self.expires_at =\ + APIHelper.apply_datetime_converter( + expires_at, APIHelper.RFC3339DateTime)\ + if expires_at else None if current_period_starts_at is not APIHelper.SKIP: - self.current_period_starts_at = APIHelper.apply_datetime_converter(current_period_starts_at, APIHelper.RFC3339DateTime) if current_period_starts_at else None + self.current_period_starts_at =\ + APIHelper.apply_datetime_converter( + current_period_starts_at, APIHelper.RFC3339DateTime)\ + if current_period_starts_at else None # Add additional model properties to the instance if additional_properties is None: @@ -87,7 +95,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -98,18 +106,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - activated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("activated_at")).datetime if dictionary.get("activated_at") else APIHelper.SKIP - canceled_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("canceled_at")).datetime if dictionary.get("canceled_at") else APIHelper.SKIP - cancellation_message = dictionary.get("cancellation_message") if dictionary.get("cancellation_message") else APIHelper.SKIP - expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else APIHelper.SKIP - current_period_starts_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("current_period_starts_at")).datetime if dictionary.get("current_period_starts_at") else APIHelper.SKIP + activated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("activated_at")).datetime\ + if dictionary.get("activated_at") else APIHelper.SKIP + canceled_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("canceled_at")).datetime\ + if dictionary.get("canceled_at") else APIHelper.SKIP + cancellation_message =\ + dictionary.get("cancellation_message")\ + if dictionary.get("cancellation_message")\ + else APIHelper.SKIP + expires_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("expires_at")).datetime\ + if dictionary.get("expires_at") else APIHelper.SKIP + current_period_starts_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("current_period_starts_at")).datetime\ + if dictionary.get("current_period_starts_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(activated_at, canceled_at, @@ -119,19 +140,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'activated_at={(self.activated_at if hasattr(self, "activated_at") else None)!r}, ' - f'canceled_at={(self.canceled_at if hasattr(self, "canceled_at") else None)!r}, ' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!r}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'current_period_starts_at={(self.current_period_starts_at if hasattr(self, "current_period_starts_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _activated_at=( + self.activated_at + if hasattr(self, "activated_at") + else None + ) + _canceled_at=( + self.canceled_at + if hasattr(self, "canceled_at") + else None + ) + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _current_period_starts_at=( + self.current_period_starts_at + if hasattr(self, "current_period_starts_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"activated_at={_activated_at!r}, " + f"canceled_at={_canceled_at!r}, " + f"cancellation_message={_cancellation_message!r}, " + f"expires_at={_expires_at!r}, " + f"current_period_starts_at={_current_period_starts_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'activated_at={(self.activated_at if hasattr(self, "activated_at") else None)!s}, ' - f'canceled_at={(self.canceled_at if hasattr(self, "canceled_at") else None)!s}, ' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!s}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'current_period_starts_at={(self.current_period_starts_at if hasattr(self, "current_period_starts_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _activated_at=( + self.activated_at + if hasattr(self, "activated_at") + else None + ) + _canceled_at=( + self.canceled_at + if hasattr(self, "canceled_at") + else None + ) + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _current_period_starts_at=( + self.current_period_starts_at + if hasattr(self, "current_period_starts_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"activated_at={_activated_at!s}, " + f"canceled_at={_canceled_at!s}, " + f"cancellation_message={_cancellation_message!s}, " + f"expires_at={_expires_at!s}, " + f"current_period_starts_at={_current_period_starts_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/override_subscription_request.py b/advancedbilling/models/override_subscription_request.py index 61727968..21f767ee 100644 --- a/advancedbilling/models/override_subscription_request.py +++ b/advancedbilling/models/override_subscription_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.override_subscription import OverrideSubscription +# ruff: noqa: E501 +from advancedbilling.models.override_subscription import ( + OverrideSubscription, +) -class OverrideSubscriptionRequest(object): +class OverrideSubscriptionRequest(object): """Implementation of the 'Override Subscription Request' model. Attributes: subscription (OverrideSubscription): The model property of type OverrideSubscription. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription": 'subscription' + "subscription": "subscription", } - def __init__(self, - subscription=None, - additional_properties=None): - """Constructor for the OverrideSubscriptionRequest class""" - + def __init__( + self, + subscription=None, + additional_properties=None): + """Initialize a OverrideSubscriptionRequest instance.""" # Initialize members of the class - self.subscription = subscription + self.subscription = subscription # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription = OverrideSubscription.from_dictionary(dictionary.get('subscription')) if dictionary.get('subscription') else None + subscription =\ + OverrideSubscription.from_dictionary( + dictionary.get("subscription"))\ + if dictionary.get("subscription") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/paginated_metadata.py b/advancedbilling/models/paginated_metadata.py index 05504ed2..44adfa3a 100644 --- a/advancedbilling/models/paginated_metadata.py +++ b/advancedbilling/models/paginated_metadata.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.metadata import Metadata +from advancedbilling.models.metadata import ( + Metadata, +) class PaginatedMetadata(object): - """Implementation of the 'Paginated Metadata' model. Attributes: @@ -20,48 +20,48 @@ class PaginatedMetadata(object): total_pages (int): The model property of type int. per_page (int): The model property of type int. metadata (List[Metadata]): The model property of type List[Metadata]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "total_count": 'total_count', - "current_page": 'current_page', - "total_pages": 'total_pages', - "per_page": 'per_page', - "metadata": 'metadata' + "total_count": "total_count", + "current_page": "current_page", + "total_pages": "total_pages", + "per_page": "per_page", + "metadata": "metadata", } _optionals = [ - 'total_count', - 'current_page', - 'total_pages', - 'per_page', - 'metadata', + "total_count", + "current_page", + "total_pages", + "per_page", + "metadata", ] - def __init__(self, - total_count=APIHelper.SKIP, - current_page=APIHelper.SKIP, - total_pages=APIHelper.SKIP, - per_page=APIHelper.SKIP, - metadata=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PaginatedMetadata class""" - + def __init__( + self, + total_count=APIHelper.SKIP, + current_page=APIHelper.SKIP, + total_pages=APIHelper.SKIP, + per_page=APIHelper.SKIP, + metadata=APIHelper.SKIP, + additional_properties=None): + """Initialize a PaginatedMetadata instance.""" # Initialize members of the class if total_count is not APIHelper.SKIP: - self.total_count = total_count + self.total_count = total_count if current_page is not APIHelper.SKIP: - self.current_page = current_page + self.current_page = current_page if total_pages is not APIHelper.SKIP: - self.total_pages = total_pages + self.total_pages = total_pages if per_page is not APIHelper.SKIP: - self.per_page = per_page + self.per_page = per_page if metadata is not APIHelper.SKIP: - self.metadata = metadata + self.metadata = metadata # Add additional model properties to the instance if additional_properties is None: @@ -71,7 +71,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -82,22 +82,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - total_count = dictionary.get("total_count") if dictionary.get("total_count") else APIHelper.SKIP - current_page = dictionary.get("current_page") if dictionary.get("current_page") else APIHelper.SKIP - total_pages = dictionary.get("total_pages") if dictionary.get("total_pages") else APIHelper.SKIP - per_page = dictionary.get("per_page") if dictionary.get("per_page") else APIHelper.SKIP + total_count =\ + dictionary.get("total_count")\ + if dictionary.get("total_count")\ + else APIHelper.SKIP + current_page =\ + dictionary.get("current_page")\ + if dictionary.get("current_page")\ + else APIHelper.SKIP + total_pages =\ + dictionary.get("total_pages")\ + if dictionary.get("total_pages")\ + else APIHelper.SKIP + per_page =\ + dictionary.get("per_page")\ + if dictionary.get("per_page")\ + else APIHelper.SKIP metadata = None - if dictionary.get('metadata') is not None: - metadata = [Metadata.from_dictionary(x) for x in dictionary.get('metadata')] + if dictionary.get("metadata") is not None: + metadata = [ + Metadata.from_dictionary(x) + for x in dictionary.get("metadata") + ] else: metadata = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(total_count, current_page, @@ -107,19 +124,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!r}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!r}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!r}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!r}, ' - f'metadata={(self.metadata if hasattr(self, "metadata") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _metadata=( + self.metadata + if hasattr(self, "metadata") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!r}, " + f"current_page={_current_page!r}, " + f"total_pages={_total_pages!r}, " + f"per_page={_per_page!r}, " + f"metadata={_metadata!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'total_count={(self.total_count if hasattr(self, "total_count") else None)!s}, ' - f'current_page={(self.current_page if hasattr(self, "current_page") else None)!s}, ' - f'total_pages={(self.total_pages if hasattr(self, "total_pages") else None)!s}, ' - f'per_page={(self.per_page if hasattr(self, "per_page") else None)!s}, ' - f'metadata={(self.metadata if hasattr(self, "metadata") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _total_count=( + self.total_count + if hasattr(self, "total_count") + else None + ) + _current_page=( + self.current_page + if hasattr(self, "current_page") + else None + ) + _total_pages=( + self.total_pages + if hasattr(self, "total_pages") + else None + ) + _per_page=( + self.per_page + if hasattr(self, "per_page") + else None + ) + _metadata=( + self.metadata + if hasattr(self, "metadata") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_count={_total_count!s}, " + f"current_page={_current_page!s}, " + f"total_pages={_total_pages!s}, " + f"per_page={_per_page!s}, " + f"metadata={_metadata!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/paid_invoice.py b/advancedbilling/models/paid_invoice.py index d5f9419c..f07e678e 100644 --- a/advancedbilling/models/paid_invoice.py +++ b/advancedbilling/models/paid_invoice.py @@ -1,64 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PaidInvoice(object): - """Implementation of the 'Paid Invoice' model. Attributes: invoice_id (str): The uid of the paid invoice - status (InvoiceStatus): The current status of the invoice. See - [Invoice - Statuses](https://maxio.zendesk.com/hc/en-us/articles/2425228782964 - 5-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. + status (InvoiceStatus): The current status of the invoice. See [Invoice + Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advan + ced-Billing-Invoices-Overview#invoice-statuses) for more. due_amount (str): The remaining due amount on the invoice - paid_amount (str): The total amount paid on this invoice (including - any prior payments) - additional_properties (Dict[str, object]): The additional properties - for the model. + paid_amount (str): The total amount paid on this invoice (including any prior + payments) + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "invoice_id": 'invoice_id', - "status": 'status', - "due_amount": 'due_amount', - "paid_amount": 'paid_amount' + "invoice_id": "invoice_id", + "status": "status", + "due_amount": "due_amount", + "paid_amount": "paid_amount", } _optionals = [ - 'invoice_id', - 'status', - 'due_amount', - 'paid_amount', + "invoice_id", + "status", + "due_amount", + "paid_amount", ] - def __init__(self, - invoice_id=APIHelper.SKIP, - status=APIHelper.SKIP, - due_amount=APIHelper.SKIP, - paid_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PaidInvoice class""" - + def __init__( + self, + invoice_id=APIHelper.SKIP, + status=APIHelper.SKIP, + due_amount=APIHelper.SKIP, + paid_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a PaidInvoice instance.""" # Initialize members of the class if invoice_id is not APIHelper.SKIP: - self.invoice_id = invoice_id + self.invoice_id = invoice_id if status is not APIHelper.SKIP: - self.status = status + self.status = status if due_amount is not APIHelper.SKIP: - self.due_amount = due_amount + self.due_amount = due_amount if paid_amount is not APIHelper.SKIP: - self.paid_amount = paid_amount + self.paid_amount = paid_amount # Add additional model properties to the instance if additional_properties is None: @@ -68,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -79,17 +76,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - invoice_id = dictionary.get("invoice_id") if dictionary.get("invoice_id") else APIHelper.SKIP - status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP - due_amount = dictionary.get("due_amount") if dictionary.get("due_amount") else APIHelper.SKIP - paid_amount = dictionary.get("paid_amount") if dictionary.get("paid_amount") else APIHelper.SKIP + invoice_id =\ + dictionary.get("invoice_id")\ + if dictionary.get("invoice_id")\ + else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + due_amount =\ + dictionary.get("due_amount")\ + if dictionary.get("due_amount")\ + else APIHelper.SKIP + paid_amount =\ + dictionary.get("paid_amount")\ + if dictionary.get("paid_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(invoice_id, status, @@ -98,17 +109,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'due_amount={(self.due_amount if hasattr(self, "due_amount") else None)!r}, ' - f'paid_amount={(self.paid_amount if hasattr(self, "paid_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _invoice_id=( + self.invoice_id + if hasattr(self, "invoice_id") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _due_amount=( + self.due_amount + if hasattr(self, "due_amount") + else None + ) + _paid_amount=( + self.paid_amount + if hasattr(self, "paid_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice_id={_invoice_id!r}, " + f"status={_status!r}, " + f"due_amount={_due_amount!r}, " + f"paid_amount={_paid_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'invoice_id={(self.invoice_id if hasattr(self, "invoice_id") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'due_amount={(self.due_amount if hasattr(self, "due_amount") else None)!s}, ' - f'paid_amount={(self.paid_amount if hasattr(self, "paid_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _invoice_id=( + self.invoice_id + if hasattr(self, "invoice_id") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _due_amount=( + self.due_amount + if hasattr(self, "due_amount") + else None + ) + _paid_amount=( + self.paid_amount + if hasattr(self, "paid_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice_id={_invoice_id!s}, " + f"status={_status!s}, " + f"due_amount={_due_amount!s}, " + f"paid_amount={_paid_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/pause_request.py b/advancedbilling/models/pause_request.py index ba27d880..507d5273 100644 --- a/advancedbilling/models/pause_request.py +++ b/advancedbilling/models/pause_request.py @@ -1,45 +1,45 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.auto_resume import AutoResume +from advancedbilling.models.auto_resume import ( + AutoResume, +) class PauseRequest(object): - """Implementation of the 'Pause Request' model. Allows to pause a Subscription Attributes: hold (AutoResume): The model property of type AutoResume. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "hold": 'hold' + "hold": "hold", } _optionals = [ - 'hold', + "hold", ] - def __init__(self, - hold=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PauseRequest class""" - + def __init__( + self, + hold=APIHelper.SKIP, + additional_properties=None): + """Initialize a PauseRequest instance.""" # Initialize members of the class if hold is not APIHelper.SKIP: - self.hold = hold + self.hold = hold # Add additional model properties to the instance if additional_properties is None: @@ -49,7 +49,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -60,24 +60,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - hold = AutoResume.from_dictionary(dictionary.get('hold')) if 'hold' in dictionary.keys() else APIHelper.SKIP + hold =\ + AutoResume.from_dictionary( + dictionary.get("hold"))\ + if "hold" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(hold, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'hold={(self.hold if hasattr(self, "hold") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _hold=( + self.hold + if hasattr(self, "hold") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"hold={_hold!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'hold={(self.hold if hasattr(self, "hold") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _hold=( + self.hold + if hasattr(self, "hold") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"hold={_hold!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/pay_pal_vault.py b/advancedbilling/models/pay_pal_vault.py index af80553d..022768f1 100644 --- a/advancedbilling/models/pay_pal_vault.py +++ b/advancedbilling/models/pay_pal_vault.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class PayPalVault(object): - """Implementation of the 'PayPal Vault' enum. The vault that stores the payment profile with the provided vault_token. @@ -19,22 +16,23 @@ class PayPalVault(object): PAYPAL: The enum member of type str. MODUSLINK: The enum member of type str. PAYPAL_COMPLETE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['braintree_blue', 'paypal', 'moduslink', 'paypal_complete'] - BRAINTREE_BLUE = 'braintree_blue' - PAYPAL = 'paypal' + _all_values = ["braintree_blue", "paypal", "moduslink", "paypal_complete"] + BRAINTREE_BLUE = "braintree_blue" - MODUSLINK = 'moduslink' + PAYPAL = "paypal" - PAYPAL_COMPLETE = 'paypal_complete' + MODUSLINK = "moduslink" + + PAYPAL_COMPLETE = "paypal_complete" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -44,9 +42,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/payer_attributes.py b/advancedbilling/models/payer_attributes.py index 6bb008c8..a8330b2b 100644 --- a/advancedbilling/models/payer_attributes.py +++ b/advancedbilling/models/payer_attributes.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PayerAttributes(object): - """Implementation of the 'Payer Attributes' model. Attributes: @@ -31,117 +29,116 @@ class PayerAttributes(object): vat_number (str): The model property of type str. tax_exempt (bool): The model property of type bool. tax_exempt_reason (str): The model property of type str. - metafields (Dict[str, str]): (Optional) A set of key/value pairs - representing custom fields and their values. Metafields will be - created “on-the-fly” in your site for a given key, if they have - not been created yet. - additional_properties (Dict[str, object]): The additional properties - for the model. + metafields (Dict[str, str]): (Optional) A set of key/value pairs representing + custom fields and their values. Metafields will be created “on-the-fly” + in your site for a given key, if they have not been created yet. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "email": 'email', - "cc_emails": 'cc_emails', - "organization": 'organization', - "reference": 'reference', - "address": 'address', - "address_2": 'address_2', - "city": 'city', - "state": 'state', - "zip": 'zip', - "country": 'country', - "phone": 'phone', - "locale": 'locale', - "vat_number": 'vat_number', - "tax_exempt": 'tax_exempt', - "tax_exempt_reason": 'tax_exempt_reason', - "metafields": 'metafields' + "first_name": "first_name", + "last_name": "last_name", + "email": "email", + "cc_emails": "cc_emails", + "organization": "organization", + "reference": "reference", + "address": "address", + "address_2": "address_2", + "city": "city", + "state": "state", + "zip": "zip", + "country": "country", + "phone": "phone", + "locale": "locale", + "vat_number": "vat_number", + "tax_exempt": "tax_exempt", + "tax_exempt_reason": "tax_exempt_reason", + "metafields": "metafields", } _optionals = [ - 'first_name', - 'last_name', - 'email', - 'cc_emails', - 'organization', - 'reference', - 'address', - 'address_2', - 'city', - 'state', - 'zip', - 'country', - 'phone', - 'locale', - 'vat_number', - 'tax_exempt', - 'tax_exempt_reason', - 'metafields', + "first_name", + "last_name", + "email", + "cc_emails", + "organization", + "reference", + "address", + "address_2", + "city", + "state", + "zip", + "country", + "phone", + "locale", + "vat_number", + "tax_exempt", + "tax_exempt_reason", + "metafields", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - email=APIHelper.SKIP, - cc_emails=APIHelper.SKIP, - organization=APIHelper.SKIP, - reference=APIHelper.SKIP, - address=APIHelper.SKIP, - address_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - phone=APIHelper.SKIP, - locale=APIHelper.SKIP, - vat_number=APIHelper.SKIP, - tax_exempt=APIHelper.SKIP, - tax_exempt_reason=APIHelper.SKIP, - metafields=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PayerAttributes class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + email=APIHelper.SKIP, + cc_emails=APIHelper.SKIP, + organization=APIHelper.SKIP, + reference=APIHelper.SKIP, + address=APIHelper.SKIP, + address_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + phone=APIHelper.SKIP, + locale=APIHelper.SKIP, + vat_number=APIHelper.SKIP, + tax_exempt=APIHelper.SKIP, + tax_exempt_reason=APIHelper.SKIP, + metafields=APIHelper.SKIP, + additional_properties=None): + """Initialize a PayerAttributes instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if email is not APIHelper.SKIP: - self.email = email + self.email = email if cc_emails is not APIHelper.SKIP: - self.cc_emails = cc_emails + self.cc_emails = cc_emails if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if address is not APIHelper.SKIP: - self.address = address + self.address = address if address_2 is not APIHelper.SKIP: - self.address_2 = address_2 + self.address_2 = address_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone if locale is not APIHelper.SKIP: - self.locale = locale + self.locale = locale if vat_number is not APIHelper.SKIP: - self.vat_number = vat_number + self.vat_number = vat_number if tax_exempt is not APIHelper.SKIP: - self.tax_exempt = tax_exempt + self.tax_exempt = tax_exempt if tax_exempt_reason is not APIHelper.SKIP: - self.tax_exempt_reason = tax_exempt_reason + self.tax_exempt_reason = tax_exempt_reason if metafields is not APIHelper.SKIP: - self.metafields = metafields + self.metafields = metafields # Add additional model properties to the instance if additional_properties is None: @@ -151,7 +148,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -162,31 +159,87 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP - cc_emails = dictionary.get("cc_emails") if dictionary.get("cc_emails") else APIHelper.SKIP - organization = dictionary.get("organization") if dictionary.get("organization") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP - address = dictionary.get("address") if dictionary.get("address") else APIHelper.SKIP - address_2 = dictionary.get("address_2") if dictionary.get("address_2") else APIHelper.SKIP - city = dictionary.get("city") if dictionary.get("city") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - zip = dictionary.get("zip") if dictionary.get("zip") else APIHelper.SKIP - country = dictionary.get("country") if dictionary.get("country") else APIHelper.SKIP - phone = dictionary.get("phone") if dictionary.get("phone") else APIHelper.SKIP - locale = dictionary.get("locale") if dictionary.get("locale") else APIHelper.SKIP - vat_number = dictionary.get("vat_number") if dictionary.get("vat_number") else APIHelper.SKIP - tax_exempt = dictionary.get("tax_exempt") if "tax_exempt" in dictionary.keys() else APIHelper.SKIP - tax_exempt_reason = dictionary.get("tax_exempt_reason") if dictionary.get("tax_exempt_reason") else APIHelper.SKIP - metafields = dictionary.get("metafields") if dictionary.get("metafields") else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + cc_emails =\ + dictionary.get("cc_emails")\ + if dictionary.get("cc_emails")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if dictionary.get("organization")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + address =\ + dictionary.get("address")\ + if dictionary.get("address")\ + else APIHelper.SKIP + address_2 =\ + dictionary.get("address_2")\ + if dictionary.get("address_2")\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if dictionary.get("city")\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if dictionary.get("zip")\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if dictionary.get("country")\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if dictionary.get("phone")\ + else APIHelper.SKIP + locale =\ + dictionary.get("locale")\ + if dictionary.get("locale")\ + else APIHelper.SKIP + vat_number =\ + dictionary.get("vat_number")\ + if dictionary.get("vat_number")\ + else APIHelper.SKIP + tax_exempt =\ + dictionary.get("tax_exempt")\ + if "tax_exempt" in dictionary.keys()\ + else APIHelper.SKIP + tax_exempt_reason =\ + dictionary.get("tax_exempt_reason")\ + if dictionary.get("tax_exempt_reason")\ + else APIHelper.SKIP + metafields =\ + dictionary.get("metafields")\ + if dictionary.get("metafields")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -210,7 +263,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -221,7 +274,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -231,45 +283,235 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!r}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!r}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!r}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"email={_email!r}, " + f"cc_emails={_cc_emails!r}, " + f"organization={_organization!r}, " + f"reference={_reference!r}, " + f"address={_address!r}, " + f"address_2={_address_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"phone={_phone!r}, " + f"locale={_locale!r}, " + f"vat_number={_vat_number!r}, " + f"tax_exempt={_tax_exempt!r}, " + f"tax_exempt_reason={_tax_exempt_reason!r}, " + f"metafields={_metafields!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!s}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!s}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!s}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"email={_email!s}, " + f"cc_emails={_cc_emails!s}, " + f"organization={_organization!s}, " + f"reference={_reference!s}, " + f"address={_address!s}, " + f"address_2={_address_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"phone={_phone!s}, " + f"locale={_locale!s}, " + f"vat_number={_vat_number!s}, " + f"tax_exempt={_tax_exempt!s}, " + f"tax_exempt_reason={_tax_exempt_reason!s}, " + f"metafields={_metafields!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payer_error.py b/advancedbilling/models/payer_error.py index 4d74fc10..fc437338 100644 --- a/advancedbilling/models/payer_error.py +++ b/advancedbilling/models/payer_error.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PayerError(object): - """Implementation of the 'Payer Error' model. Attributes: last_name (List[str]): The model property of type List[str]. first_name (List[str]): The model property of type List[str]. email (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "last_name": 'last_name', - "first_name": 'first_name', - "email": 'email' + "last_name": "last_name", + "first_name": "first_name", + "email": "email", } _optionals = [ - 'last_name', - 'first_name', - 'email', + "last_name", + "first_name", + "email", ] - def __init__(self, - last_name=APIHelper.SKIP, - first_name=APIHelper.SKIP, - email=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PayerError class""" - + def __init__( + self, + last_name=APIHelper.SKIP, + first_name=APIHelper.SKIP, + email=APIHelper.SKIP, + additional_properties=None): + """Initialize a PayerError instance.""" # Initialize members of the class if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if email is not APIHelper.SKIP: - self.email = email + self.email = email # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(last_name, first_name, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"last_name={_last_name!r}, " + f"first_name={_first_name!r}, " + f"email={_email!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"last_name={_last_name!s}, " + f"first_name={_first_name!s}, " + f"email={_email!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_collection_method_changed.py b/advancedbilling/models/payment_collection_method_changed.py index ea16ec37..df470dbf 100644 --- a/advancedbilling/models/payment_collection_method_changed.py +++ b/advancedbilling/models/payment_collection_method_changed.py @@ -1,41 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PaymentCollectionMethodChanged(object): - """Implementation of the 'Payment Collection Method Changed' model. Attributes: previous_value (str): The model property of type str. current_value (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "previous_value": 'previous_value', - "current_value": 'current_value' + "previous_value": "previous_value", + "current_value": "current_value", } - def __init__(self, - previous_value=None, - current_value=None, - additional_properties=None): - """Constructor for the PaymentCollectionMethodChanged class""" - + def __init__( + self, + previous_value=None, + current_value=None, + additional_properties=None): + """Initialize a PaymentCollectionMethodChanged instance.""" # Initialize members of the class - self.previous_value = previous_value - self.current_value = current_value + self.previous_value = previous_value + self.current_value = current_value # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,15 +54,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - previous_value = dictionary.get("previous_value") if dictionary.get("previous_value") else None - current_value = dictionary.get("current_value") if dictionary.get("current_value") else None + previous_value =\ + dictionary.get("previous_value")\ + if dictionary.get("previous_value")\ + else None + current_value =\ + dictionary.get("current_value")\ + if dictionary.get("current_value")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(previous_value, current_value, @@ -72,7 +78,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -83,29 +89,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.previous_value, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.current_value, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.previous_value, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.current_value, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('previous_value'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('current_value'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("previous_value"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("current_value"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'previous_value={self.previous_value!r}, ' - f'current_value={self.current_value!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _previous_value=self.previous_value + _current_value=self.current_value + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_value={_previous_value!r}, " + f"current_value={_current_value!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'previous_value={self.previous_value!s}, ' - f'current_value={self.current_value!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _previous_value=self.previous_value + _current_value=self.current_value + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_value={_previous_value!s}, " + f"current_value={_current_value!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_for_allocation.py b/advancedbilling/models/payment_for_allocation.py index ec26bb03..9c5b8aec 100644 --- a/advancedbilling/models/payment_for_allocation.py +++ b/advancedbilling/models/payment_for_allocation.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PaymentForAllocation(object): - """Implementation of the 'Payment for Allocation' model. Information for captured payment, if applicable @@ -20,43 +18,43 @@ class PaymentForAllocation(object): amount_in_cents (int): The model property of type int. success (bool): The model property of type bool. memo (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "amount_in_cents": 'amount_in_cents', - "success": 'success', - "memo": 'memo' + "id": "id", + "amount_in_cents": "amount_in_cents", + "success": "success", + "memo": "memo", } _optionals = [ - 'id', - 'amount_in_cents', - 'success', - 'memo', + "id", + "amount_in_cents", + "success", + "memo", ] - def __init__(self, - id=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - success=APIHelper.SKIP, - memo=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PaymentForAllocation class""" - + def __init__( + self, + id=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + success=APIHelper.SKIP, + memo=APIHelper.SKIP, + additional_properties=None): + """Initialize a PaymentForAllocation instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if success is not APIHelper.SKIP: - self.success = success + self.success = success if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo # Add additional model properties to the instance if additional_properties is None: @@ -66,7 +64,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -77,17 +75,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - success = dictionary.get("success") if "success" in dictionary.keys() else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + success =\ + dictionary.get("success")\ + if "success" in dictionary.keys()\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, amount_in_cents, @@ -97,7 +109,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -108,7 +120,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -118,17 +129,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'success={(self.success if hasattr(self, "success") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _success=( + self.success + if hasattr(self, "success") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"success={_success!r}, " + f"memo={_memo!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'success={(self.success if hasattr(self, "success") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _success=( + self.success + if hasattr(self, "success") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"success={_success!s}, " + f"memo={_memo!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_method_apple_pay.py b/advancedbilling/models/payment_method_apple_pay.py index 169bf78f..955ec7da 100644 --- a/advancedbilling/models/payment_method_apple_pay.py +++ b/advancedbilling/models/payment_method_apple_pay.py @@ -1,39 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.invoice_event_payment_method import ( + InvoiceEventPaymentMethod, +) class PaymentMethodApplePay(object): - """Implementation of the 'Payment Method Apple Pay' model. Attributes: mtype (InvoiceEventPaymentMethod): The model property of type InvoiceEventPaymentMethod. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "mtype": 'type' + "mtype": "type", } - def __init__(self, - mtype=None, - additional_properties=None): - """Constructor for the PaymentMethodApplePay class""" - + def __init__( + self, + mtype=None, + additional_properties=None): + """Initialize a PaymentMethodApplePay instance.""" # Initialize members of the class - self.mtype = mtype + self.mtype = mtype # Add additional model properties to the instance if additional_properties is None: @@ -43,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -54,21 +54,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - mtype = dictionary.get("type") if dictionary.get("type") else None + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(mtype, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -79,23 +84,38 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.mtype, - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.mtype, + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('type'), - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("type"), + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'mtype={self.mtype!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mtype={_mtype!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'mtype={self.mtype!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mtype={_mtype!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_method_bank_account.py b/advancedbilling/models/payment_method_bank_account.py index 8d794e13..61215b7e 100644 --- a/advancedbilling/models/payment_method_bank_account.py +++ b/advancedbilling/models/payment_method_bank_account.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.invoice_event_payment_method import ( + InvoiceEventPaymentMethod, +) class PaymentMethodBankAccount(object): - """Implementation of the 'Payment Method Bank Account' model. Attributes: @@ -19,29 +19,29 @@ class PaymentMethodBankAccount(object): masked_routing_number (str): The model property of type str. mtype (InvoiceEventPaymentMethod): The model property of type InvoiceEventPaymentMethod. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "masked_account_number": 'masked_account_number', - "masked_routing_number": 'masked_routing_number', - "mtype": 'type' + "masked_account_number": "masked_account_number", + "masked_routing_number": "masked_routing_number", + "mtype": "type", } - def __init__(self, - masked_account_number=None, - masked_routing_number=None, - mtype=None, - additional_properties=None): - """Constructor for the PaymentMethodBankAccount class""" - + def __init__( + self, + masked_account_number=None, + masked_routing_number=None, + mtype=None, + additional_properties=None): + """Initialize a PaymentMethodBankAccount instance.""" # Initialize members of the class - self.masked_account_number = masked_account_number - self.masked_routing_number = masked_routing_number - self.mtype = mtype + self.masked_account_number = masked_account_number + self.masked_routing_number = masked_routing_number + self.mtype = mtype # Add additional model properties to the instance if additional_properties is None: @@ -51,7 +51,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -62,16 +62,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - masked_account_number = dictionary.get("masked_account_number") if dictionary.get("masked_account_number") else None - masked_routing_number = dictionary.get("masked_routing_number") if dictionary.get("masked_routing_number") else None - mtype = dictionary.get("type") if dictionary.get("type") else None + masked_account_number =\ + dictionary.get("masked_account_number")\ + if dictionary.get("masked_account_number")\ + else None + masked_routing_number =\ + dictionary.get("masked_routing_number")\ + if dictionary.get("masked_routing_number")\ + else None + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(masked_account_number, masked_routing_number, @@ -80,7 +91,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -91,35 +102,74 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.masked_account_number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.masked_routing_number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.mtype, - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.masked_account_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.masked_routing_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.mtype, + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('masked_account_number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('masked_routing_number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('type'), - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("masked_account_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("masked_routing_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("type"), + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'masked_account_number={self.masked_account_number!r}, ' - f'masked_routing_number={self.masked_routing_number!r}, ' - f'mtype={self.mtype!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _masked_account_number=self.masked_account_number + _masked_routing_number=self.masked_routing_number + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"masked_account_number={_masked_account_number!r}, " + f"masked_routing_number={_masked_routing_number!r}, " + f"mtype={_mtype!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'masked_account_number={self.masked_account_number!s}, ' - f'masked_routing_number={self.masked_routing_number!s}, ' - f'mtype={self.mtype!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _masked_account_number=self.masked_account_number + _masked_routing_number=self.masked_routing_number + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"masked_account_number={_masked_account_number!s}, " + f"masked_routing_number={_masked_routing_number!s}, " + f"mtype={_mtype!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_method_credit_card.py b/advancedbilling/models/payment_method_credit_card.py index cbbca725..24ad998e 100644 --- a/advancedbilling/models/payment_method_credit_card.py +++ b/advancedbilling/models/payment_method_credit_card.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.invoice_event_payment_method import ( + InvoiceEventPaymentMethod, +) class PaymentMethodCreditCard(object): - """Implementation of the 'Payment Method Credit Card' model. Attributes: @@ -21,46 +21,46 @@ class PaymentMethodCreditCard(object): masked_card_number (str): The model property of type str. mtype (InvoiceEventPaymentMethod): The model property of type InvoiceEventPaymentMethod. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "card_brand": 'card_brand', - "masked_card_number": 'masked_card_number', - "mtype": 'type', - "card_expiration": 'card_expiration', - "last_four": 'last_four' + "card_brand": "card_brand", + "masked_card_number": "masked_card_number", + "mtype": "type", + "card_expiration": "card_expiration", + "last_four": "last_four", } _optionals = [ - 'card_expiration', - 'last_four', + "card_expiration", + "last_four", ] _nullables = [ - 'last_four', + "last_four", ] - def __init__(self, - card_brand=None, - masked_card_number=None, - mtype=None, - card_expiration=APIHelper.SKIP, - last_four=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PaymentMethodCreditCard class""" - + def __init__( + self, + card_brand=None, + masked_card_number=None, + mtype=None, + card_expiration=APIHelper.SKIP, + last_four=APIHelper.SKIP, + additional_properties=None): + """Initialize a PaymentMethodCreditCard instance.""" # Initialize members of the class - self.card_brand = card_brand + self.card_brand = card_brand if card_expiration is not APIHelper.SKIP: - self.card_expiration = card_expiration + self.card_expiration = card_expiration if last_four is not APIHelper.SKIP: - self.last_four = last_four - self.masked_card_number = masked_card_number - self.mtype = mtype + self.last_four = last_four + self.masked_card_number = masked_card_number + self.mtype = mtype # Add additional model properties to the instance if additional_properties is None: @@ -70,7 +70,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -81,18 +81,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - card_brand = dictionary.get("card_brand") if dictionary.get("card_brand") else None - masked_card_number = dictionary.get("masked_card_number") if dictionary.get("masked_card_number") else None - mtype = dictionary.get("type") if dictionary.get("type") else None - card_expiration = dictionary.get("card_expiration") if dictionary.get("card_expiration") else APIHelper.SKIP - last_four = dictionary.get("last_four") if "last_four" in dictionary.keys() else APIHelper.SKIP + card_brand =\ + dictionary.get("card_brand")\ + if dictionary.get("card_brand")\ + else None + masked_card_number =\ + dictionary.get("masked_card_number")\ + if dictionary.get("masked_card_number")\ + else None + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else None + card_expiration =\ + dictionary.get("card_expiration")\ + if dictionary.get("card_expiration")\ + else APIHelper.SKIP + last_four =\ + dictionary.get("last_four")\ + if "last_four" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(card_brand, masked_card_number, @@ -103,7 +120,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -114,39 +131,98 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.card_brand, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.masked_card_number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.mtype, - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.card_brand, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.masked_card_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.mtype, + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('card_brand'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('masked_card_number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('type'), - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("card_brand"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("masked_card_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("type"), + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'card_brand={self.card_brand!r}, ' - f'card_expiration={(self.card_expiration if hasattr(self, "card_expiration") else None)!r}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!r}, ' - f'masked_card_number={self.masked_card_number!r}, ' - f'mtype={self.mtype!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _card_brand=self.card_brand + _card_expiration=( + self.card_expiration + if hasattr(self, "card_expiration") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _masked_card_number=self.masked_card_number + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"card_brand={_card_brand!r}, " + f"card_expiration={_card_expiration!r}, " + f"last_four={_last_four!r}, " + f"masked_card_number={_masked_card_number!r}, " + f"mtype={_mtype!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'card_brand={self.card_brand!s}, ' - f'card_expiration={(self.card_expiration if hasattr(self, "card_expiration") else None)!s}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!s}, ' - f'masked_card_number={self.masked_card_number!s}, ' - f'mtype={self.mtype!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _card_brand=self.card_brand + _card_expiration=( + self.card_expiration + if hasattr(self, "card_expiration") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _masked_card_number=self.masked_card_number + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"card_brand={_card_brand!s}, " + f"card_expiration={_card_expiration!s}, " + f"last_four={_last_four!s}, " + f"masked_card_number={_masked_card_number!s}, " + f"mtype={_mtype!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_method_external.py b/advancedbilling/models/payment_method_external.py index 1632338e..ac049387 100644 --- a/advancedbilling/models/payment_method_external.py +++ b/advancedbilling/models/payment_method_external.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.invoice_event_payment_method import ( + InvoiceEventPaymentMethod, +) class PaymentMethodExternal(object): - """Implementation of the 'Payment Method External' model. Attributes: @@ -20,37 +20,37 @@ class PaymentMethodExternal(object): memo (str): The model property of type str. mtype (InvoiceEventPaymentMethod): The model property of type InvoiceEventPaymentMethod. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "details": 'details', - "kind": 'kind', - "memo": 'memo', - "mtype": 'type' + "details": "details", + "kind": "kind", + "memo": "memo", + "mtype": "type", } _nullables = [ - 'details', - 'memo', + "details", + "memo", ] - def __init__(self, - details=None, - kind=None, - memo=None, - mtype=None, - additional_properties=None): - """Constructor for the PaymentMethodExternal class""" - + def __init__( + self, + details=None, + kind=None, + memo=None, + mtype=None, + additional_properties=None): + """Initialize a PaymentMethodExternal instance.""" # Initialize members of the class - self.details = details - self.kind = kind - self.memo = memo - self.mtype = mtype + self.details = details + self.kind = kind + self.memo = memo + self.mtype = mtype # Add additional model properties to the instance if additional_properties is None: @@ -60,7 +60,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -71,17 +71,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - details = dictionary.get("details") if dictionary.get("details") else None - kind = dictionary.get("kind") if dictionary.get("kind") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - mtype = dictionary.get("type") if dictionary.get("type") else None + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else None + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(details, kind, @@ -91,7 +105,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -102,45 +116,96 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.details, - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.kind, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.mtype, - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.details, + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.kind, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.mtype, + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('details'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('kind'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('type'), - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("details"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("kind"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("type"), + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'details={self.details!r}, ' - f'kind={self.kind!r}, ' - f'memo={self.memo!r}, ' - f'mtype={self.mtype!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _details=self.details + _kind=self.kind + _memo=self.memo + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"details={_details!r}, " + f"kind={_kind!r}, " + f"memo={_memo!r}, " + f"mtype={_mtype!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'details={self.details!s}, ' - f'kind={self.kind!s}, ' - f'memo={self.memo!s}, ' - f'mtype={self.mtype!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _details=self.details + _kind=self.kind + _memo=self.memo + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"details={_details!s}, " + f"kind={_kind!s}, " + f"memo={_memo!s}, " + f"mtype={_mtype!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_method_paypal.py b/advancedbilling/models/payment_method_paypal.py index e9fea0fd..d9a9c2d5 100644 --- a/advancedbilling/models/payment_method_paypal.py +++ b/advancedbilling/models/payment_method_paypal.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.invoice_event_payment_method import ( + InvoiceEventPaymentMethod, +) class PaymentMethodPaypal(object): - """Implementation of the 'Payment Method Paypal' model. Attributes: email (str): The model property of type str. mtype (InvoiceEventPaymentMethod): The model property of type InvoiceEventPaymentMethod. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "email": 'email', - "mtype": 'type' + "email": "email", + "mtype": "type", } - def __init__(self, - email=None, - mtype=None, - additional_properties=None): - """Constructor for the PaymentMethodPaypal class""" - + def __init__( + self, + email=None, + mtype=None, + additional_properties=None): + """Initialize a PaymentMethodPaypal instance.""" # Initialize members of the class - self.email = email - self.mtype = mtype + self.email = email + self.mtype = mtype # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,15 +58,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - email = dictionary.get("email") if dictionary.get("email") else None - mtype = dictionary.get("type") if dictionary.get("type") else None + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else None + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(email, mtype, @@ -74,7 +82,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -85,29 +93,56 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.email, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.mtype, - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.email, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.mtype, + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('email'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('type'), - type_callable=lambda value: InvoiceEventPaymentMethod.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("email"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("type"), + type_callable=lambda value: + InvoiceEventPaymentMethod.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'email={self.email!r}, ' - f'mtype={self.mtype!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _email=self.email + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"email={_email!r}, " + f"mtype={_mtype!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'email={self.email!s}, ' - f'mtype={self.mtype!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _email=self.email + _mtype=self.mtype + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"email={_email!s}, " + f"mtype={_mtype!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_profile_attributes.py b/advancedbilling/models/payment_profile_attributes.py index a0188e95..5d13c055 100644 --- a/advancedbilling/models/payment_profile_attributes.py +++ b/advancedbilling/models/payment_profile_attributes.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PaymentProfileAttributes(object): - """Implementation of the 'Payment Profile Attributes' model. alias to credit_card_attributes @@ -22,231 +20,224 @@ class PaymentProfileAttributes(object): tok_9g6hw85pnpt6knmskpwp4ttt) id (int): The model property of type int. payment_type (PaymentType): The model property of type PaymentType. - first_name (str): (Optional) First name on card or bank account. If - omitted, the first_name from customer attributes will be used. - last_name (str): (Optional) Last name on card or bank account. If - omitted, the last_name from customer attributes will be used. + first_name (str): (Optional) First name on card or bank account. If omitted, + the first_name from customer attributes will be used. + last_name (str): (Optional) Last name on card or bank account. If omitted, + the last_name from customer attributes will be used. masked_card_number (str): The model property of type str. - full_number (str): The full credit card number (string representation, - i.e. 5424000000000015) - card_type (CardType): (Optional, used only for Subscription Import) If - you know the card type (i.e. Visa, MC, etc) you may supply it here - so that we may display the card type in the UI. - expiration_month (int | str | None): (Optional when performing a - Subscription Import via vault_token, required otherwise) The 1- or - 2-digit credit card expiration month, as an integer or string, - i.e. 5 - expiration_year (int | str | None): (Optional when performing a - Subscription Import via vault_token, required otherwise) The - 4-digit credit card expiration year, as an integer or string, i.e. - 2012 + full_number (str): The full credit card number (string representation, i.e. + 5424000000000015) + card_type (CardType): (Optional, used only for Subscription Import) If you + know the card type (i.e. Visa, MC, etc) you may supply it here so that we + may display the card type in the UI. + expiration_month (int | str | None): (Optional when performing a Subscription + Import via vault_token, required otherwise) The 1- or 2-digit credit card + expiration month, as an integer or string, i.e. 5 + expiration_year (int | str | None): (Optional when performing a Subscription + Import via vault_token, required otherwise) The 4-digit credit card + expiration year, as an integer or string, i.e. 2012 billing_address (str): (Optional, may be required by your product configuration or gateway settings) The credit card or bank account - billing street address (i.e. 123 Main St.). This value is merely - passed through to the payment gateway. - billing_address_2 (str): (Optional) Second line of the customer’s - billing address i.e. Apt. 100 - billing_city (str): (Optional, may be required by your product - configuration or gateway settings) The credit card or bank account - billing address city (i.e. “Boston”). This value is merely passed + billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. - billing_state (str): (Optional, may be required by your product - configuration or gateway settings) The credit card or bank account - billing address state (i.e. MA). This value is merely passed - through to the payment gateway. This must conform to the - [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes - ) in order to be valid for tax locale purposes. + billing_address_2 (str): (Optional) Second line of the customer’s billing + address i.e. Apt. 100 + billing_city (str): (Optional, may be required by your product configuration + or gateway settings) The credit card or bank account billing address city + (i.e. “Boston”). This value is merely passed through to the payment + gateway. + billing_state (str): (Optional, may be required by your product configuration + or gateway settings) The credit card or bank account billing address + state (i.e. MA). This value is merely passed through to the payment + gateway. This must conform to the + [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in + order to be valid for tax locale purposes. billing_country (str): (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 - alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format - (i.e. “US”). This value is merely passed through to the payment - gateway. Some gateways require country codes in a specific format. - Check your gateway’s documentation. If creating an ACH - subscription, only US is supported at this time. - billing_zip (str): (Optional, may be required by your product - configuration or gateway settings) The credit card or bank account - billing address zip code (i.e. 12345). This value is merely passed - through to the payment gateway. - current_vault (AllVaults): (Optional, used only for Subscription - Import) The vault that stores the payment profile with the - provided vault_token. - vault_token (str): (Optional, used only for Subscription Import) The - “token” provided by your vault storage for an already stored - payment profile - customer_vault_token (str): (Optional, used only for Subscription - Import) (only for Authorize.Net CIM storage or Square) The - customerProfileId for the owner of the customerPaymentProfileId - provided as the vault_token + alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. + “US”). This value is merely passed through to the payment gateway. Some + gateways require country codes in a specific format. Check your gateway’s + documentation. If creating an ACH subscription, only US is supported at + this time. + billing_zip (str): (Optional, may be required by your product configuration + or gateway settings) The credit card or bank account billing address zip + code (i.e. 12345). This value is merely passed through to the payment + gateway. + current_vault (AllVaults): (Optional, used only for Subscription Import) The + vault that stores the payment profile with the provided vault_token. + vault_token (str): (Optional, used only for Subscription Import) The “token” + provided by your vault storage for an already stored payment profile + customer_vault_token (str): (Optional, used only for Subscription Import) + (only for Authorize.Net CIM storage or Square) The customerProfileId for + the owner of the customerPaymentProfileId provided as the vault_token customer_id (int): The model property of type int. paypal_email (str): The model property of type str. payment_method_nonce (str): (Required for Square unless importing with - vault_token and customer_vault_token) The nonce generated by the - Square Javascript library (SqPaymentForm) + vault_token and customer_vault_token) The nonce generated by the Square + Javascript library (SqPaymentForm) gateway_handle (str): (Optional) This attribute is only available if - MultiGateway feature is enabled for your Site. This feature is in - the Private Beta currently. gateway_handle is used to directly - select a gateway where a payment profile will be stored in. Every - connected gateway must have a unique gateway handle specified. - Read [Multigateway - description](https://chargify.zendesk.com/hc/en-us/articles/4407761 - 759643#connecting-with-multiple-gateways) to learn more about new - concepts that MultiGateway introduces and the default behavior - when this attribute is not passed. - cvv (str): (Optional, may be required by your gateway settings) The 3- - or 4-digit Card Verification Value. This value is merely passed - through to the payment gateway. - last_four (str): (Optional, used only for Subscription Import) If you - have the last 4 digits of the credit card number, you may supply - them here so that we may create a masked card number (i.e. - XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are - required for refunds in Auth.Net. - additional_properties (Dict[str, object]): The additional properties - for the model. + MultiGateway feature is enabled for your Site. This feature is in the + Private Beta currently. gateway_handle is used to directly select a + gateway where a payment profile will be stored in. Every connected + gateway must have a unique gateway handle specified. Read [Multigateway + description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643# + connecting-with-multiple-gateways) to learn more about new concepts that + MultiGateway introduces and the default behavior when this attribute is + not passed. + cvv (str): (Optional, may be required by your gateway settings) The 3- or + 4-digit Card Verification Value. This value is merely passed through to + the payment gateway. + last_four (str): (Optional, used only for Subscription Import) If you have + the last 4 digits of the credit card number, you may supply them here so + that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for + display in the UI. Last 4 digits are required for refunds in Auth.Net. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify_token": 'chargify_token', - "id": 'id', - "payment_type": 'payment_type', - "first_name": 'first_name', - "last_name": 'last_name', - "masked_card_number": 'masked_card_number', - "full_number": 'full_number', - "card_type": 'card_type', - "expiration_month": 'expiration_month', - "expiration_year": 'expiration_year', - "billing_address": 'billing_address', - "billing_address_2": 'billing_address_2', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_country": 'billing_country', - "billing_zip": 'billing_zip', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "customer_vault_token": 'customer_vault_token', - "customer_id": 'customer_id', - "paypal_email": 'paypal_email', - "payment_method_nonce": 'payment_method_nonce', - "gateway_handle": 'gateway_handle', - "cvv": 'cvv', - "last_four": 'last_four' + "chargify_token": "chargify_token", + "id": "id", + "payment_type": "payment_type", + "first_name": "first_name", + "last_name": "last_name", + "masked_card_number": "masked_card_number", + "full_number": "full_number", + "card_type": "card_type", + "expiration_month": "expiration_month", + "expiration_year": "expiration_year", + "billing_address": "billing_address", + "billing_address_2": "billing_address_2", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_country": "billing_country", + "billing_zip": "billing_zip", + "current_vault": "current_vault", + "vault_token": "vault_token", + "customer_vault_token": "customer_vault_token", + "customer_id": "customer_id", + "paypal_email": "paypal_email", + "payment_method_nonce": "payment_method_nonce", + "gateway_handle": "gateway_handle", + "cvv": "cvv", + "last_four": "last_four", } _optionals = [ - 'chargify_token', - 'id', - 'payment_type', - 'first_name', - 'last_name', - 'masked_card_number', - 'full_number', - 'card_type', - 'expiration_month', - 'expiration_year', - 'billing_address', - 'billing_address_2', - 'billing_city', - 'billing_state', - 'billing_country', - 'billing_zip', - 'current_vault', - 'vault_token', - 'customer_vault_token', - 'customer_id', - 'paypal_email', - 'payment_method_nonce', - 'gateway_handle', - 'cvv', - 'last_four', + "chargify_token", + "id", + "payment_type", + "first_name", + "last_name", + "masked_card_number", + "full_number", + "card_type", + "expiration_month", + "expiration_year", + "billing_address", + "billing_address_2", + "billing_city", + "billing_state", + "billing_country", + "billing_zip", + "current_vault", + "vault_token", + "customer_vault_token", + "customer_id", + "paypal_email", + "payment_method_nonce", + "gateway_handle", + "cvv", + "last_four", ] _nullables = [ - 'billing_address_2', + "billing_address_2", ] - def __init__(self, - chargify_token=APIHelper.SKIP, - id=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - masked_card_number=APIHelper.SKIP, - full_number=APIHelper.SKIP, - card_type=APIHelper.SKIP, - expiration_month=APIHelper.SKIP, - expiration_year=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - paypal_email=APIHelper.SKIP, - payment_method_nonce=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - cvv=APIHelper.SKIP, - last_four=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PaymentProfileAttributes class""" - + def __init__( + self, + chargify_token=APIHelper.SKIP, + id=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + masked_card_number=APIHelper.SKIP, + full_number=APIHelper.SKIP, + card_type=APIHelper.SKIP, + expiration_month=APIHelper.SKIP, + expiration_year=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + paypal_email=APIHelper.SKIP, + payment_method_nonce=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + cvv=APIHelper.SKIP, + last_four=APIHelper.SKIP, + additional_properties=None): + """Initialize a PaymentProfileAttributes instance.""" # Initialize members of the class if chargify_token is not APIHelper.SKIP: - self.chargify_token = chargify_token + self.chargify_token = chargify_token if id is not APIHelper.SKIP: - self.id = id + self.id = id if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type + self.payment_type = payment_type if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if masked_card_number is not APIHelper.SKIP: - self.masked_card_number = masked_card_number + self.masked_card_number = masked_card_number if full_number is not APIHelper.SKIP: - self.full_number = full_number + self.full_number = full_number if card_type is not APIHelper.SKIP: - self.card_type = card_type + self.card_type = card_type if expiration_month is not APIHelper.SKIP: - self.expiration_month = expiration_month + self.expiration_month = expiration_month if expiration_year is not APIHelper.SKIP: - self.expiration_year = expiration_year + self.expiration_year = expiration_year if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 + self.billing_address_2 = billing_address_2 if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if paypal_email is not APIHelper.SKIP: - self.paypal_email = paypal_email + self.paypal_email = paypal_email if payment_method_nonce is not APIHelper.SKIP: - self.payment_method_nonce = payment_method_nonce + self.payment_method_nonce = payment_method_nonce if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if cvv is not APIHelper.SKIP: - self.cvv = cvv + self.cvv = cvv if last_four is not APIHelper.SKIP: - self.last_four = last_four + self.last_four = last_four # Add additional model properties to the instance if additional_properties is None: @@ -256,7 +247,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -267,39 +258,123 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargify_token = dictionary.get("chargify_token") if dictionary.get("chargify_token") else APIHelper.SKIP - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - masked_card_number = dictionary.get("masked_card_number") if dictionary.get("masked_card_number") else APIHelper.SKIP - full_number = dictionary.get("full_number") if dictionary.get("full_number") else APIHelper.SKIP - card_type = dictionary.get("card_type") if dictionary.get("card_type") else APIHelper.SKIP - expiration_month = APIHelper.deserialize_union_type(UnionTypeLookUp.get('PaymentProfileAttributesExpirationMonth'), dictionary.get('expiration_month'), False) if dictionary.get('expiration_month') is not None else APIHelper.SKIP - expiration_year = APIHelper.deserialize_union_type(UnionTypeLookUp.get('PaymentProfileAttributesExpirationYear'), dictionary.get('expiration_year'), False) if dictionary.get('expiration_year') is not None else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if dictionary.get("billing_address") else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if "billing_address_2" in dictionary.keys() else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if dictionary.get("billing_city") else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if dictionary.get("billing_state") else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if dictionary.get("billing_country") else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if dictionary.get("billing_zip") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if dictionary.get("customer_vault_token") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - paypal_email = dictionary.get("paypal_email") if dictionary.get("paypal_email") else APIHelper.SKIP - payment_method_nonce = dictionary.get("payment_method_nonce") if dictionary.get("payment_method_nonce") else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if dictionary.get("gateway_handle") else APIHelper.SKIP - cvv = dictionary.get("cvv") if dictionary.get("cvv") else APIHelper.SKIP - last_four = dictionary.get("last_four") if dictionary.get("last_four") else APIHelper.SKIP + chargify_token =\ + dictionary.get("chargify_token")\ + if dictionary.get("chargify_token")\ + else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + masked_card_number =\ + dictionary.get("masked_card_number")\ + if dictionary.get("masked_card_number")\ + else APIHelper.SKIP + full_number =\ + dictionary.get("full_number")\ + if dictionary.get("full_number")\ + else APIHelper.SKIP + card_type =\ + dictionary.get("card_type")\ + if dictionary.get("card_type")\ + else APIHelper.SKIP + expiration_month = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PaymentProfileAttributesExpirationMonth"), + dictionary.get("expiration_month"), + False)\ + if dictionary.get("expiration_month") is not None\ + else APIHelper.SKIP + expiration_year = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PaymentProfileAttributesExpirationYear"), + dictionary.get("expiration_year"), + False)\ + if dictionary.get("expiration_year") is not None\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if dictionary.get("billing_address")\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if "billing_address_2" in dictionary.keys()\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if dictionary.get("billing_city")\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if dictionary.get("billing_state")\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if dictionary.get("billing_country")\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if dictionary.get("billing_zip")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if dictionary.get("customer_vault_token")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + paypal_email =\ + dictionary.get("paypal_email")\ + if dictionary.get("paypal_email")\ + else APIHelper.SKIP + payment_method_nonce =\ + dictionary.get("payment_method_nonce")\ + if dictionary.get("payment_method_nonce")\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if dictionary.get("gateway_handle")\ + else APIHelper.SKIP + cvv =\ + dictionary.get("cvv")\ + if dictionary.get("cvv")\ + else APIHelper.SKIP + last_four =\ + dictionary.get("last_four")\ + if dictionary.get("last_four")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify_token, id, @@ -330,7 +405,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -341,7 +416,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -351,59 +425,319 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!r}, ' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!r}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!r}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!r}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!r}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'paypal_email={(self.paypal_email if hasattr(self, "paypal_email") else None)!r}, ' - f'payment_method_nonce={(self.payment_method_nonce if hasattr(self, "payment_method_nonce") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'cvv={(self.cvv if hasattr(self, "cvv") else None)!r}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _paypal_email=( + self.paypal_email + if hasattr(self, "paypal_email") + else None + ) + _payment_method_nonce=( + self.payment_method_nonce + if hasattr(self, "payment_method_nonce") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _cvv=( + self.cvv + if hasattr(self, "cvv") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!r}, " + f"id={_id!r}, " + f"payment_type={_payment_type!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"masked_card_number={_masked_card_number!r}, " + f"full_number={_full_number!r}, " + f"card_type={_card_type!r}, " + f"expiration_month={_expiration_month!r}, " + f"expiration_year={_expiration_year!r}, " + f"billing_address={_billing_address!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_country={_billing_country!r}, " + f"billing_zip={_billing_zip!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"customer_id={_customer_id!r}, " + f"paypal_email={_paypal_email!r}, " + f"payment_method_nonce={_payment_method_nonce!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"cvv={_cvv!r}, " + f"last_four={_last_four!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!s}, ' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!s}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!s}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!s}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!s}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'paypal_email={(self.paypal_email if hasattr(self, "paypal_email") else None)!s}, ' - f'payment_method_nonce={(self.payment_method_nonce if hasattr(self, "payment_method_nonce") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'cvv={(self.cvv if hasattr(self, "cvv") else None)!s}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _paypal_email=( + self.paypal_email + if hasattr(self, "paypal_email") + else None + ) + _payment_method_nonce=( + self.payment_method_nonce + if hasattr(self, "payment_method_nonce") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _cvv=( + self.cvv + if hasattr(self, "cvv") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!s}, " + f"id={_id!s}, " + f"payment_type={_payment_type!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"masked_card_number={_masked_card_number!s}, " + f"full_number={_full_number!s}, " + f"card_type={_card_type!s}, " + f"expiration_month={_expiration_month!s}, " + f"expiration_year={_expiration_year!s}, " + f"billing_address={_billing_address!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_country={_billing_country!s}, " + f"billing_zip={_billing_zip!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"customer_id={_customer_id!s}, " + f"paypal_email={_paypal_email!s}, " + f"payment_method_nonce={_payment_method_nonce!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"cvv={_cvv!s}, " + f"last_four={_last_four!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_profile_response.py b/advancedbilling/models/payment_profile_response.py index 01c2a719..9f5b7455 100644 --- a/advancedbilling/models/payment_profile_response.py +++ b/advancedbilling/models/payment_profile_response.py @@ -1,41 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PaymentProfileResponse(object): - """Implementation of the 'Payment Profile Response' model. Attributes: payment_profile (ApplePayPaymentProfile | BankAccountPaymentProfile | - CreditCardPaymentProfile | PaypalPaymentProfile): The model - property of type ApplePayPaymentProfile | - BankAccountPaymentProfile | CreditCardPaymentProfile | - PaypalPaymentProfile. - additional_properties (Dict[str, object]): The additional properties - for the model. + CreditCardPaymentProfile | PaypalPaymentProfile): The model property of + type ApplePayPaymentProfile | BankAccountPaymentProfile | + CreditCardPaymentProfile | PaypalPaymentProfile. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_profile": 'payment_profile' + "payment_profile": "payment_profile", } - def __init__(self, - payment_profile=None, - additional_properties=None): - """Constructor for the PaymentProfileResponse class""" - + def __init__( + self, + payment_profile=None, + additional_properties=None): + """Initialize a PaymentProfileResponse instance.""" # Initialize members of the class - self.payment_profile = payment_profile + self.payment_profile = payment_profile # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,22 +53,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_profile = APIHelper.deserialize_union_type(UnionTypeLookUp.get('Payment-Profile'), dictionary.get('payment_profile'), False) if dictionary.get('payment_profile') is not None else None + payment_profile = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("Payment-Profile"), + dictionary.get("payment_profile"), + False)\ + if dictionary.get("payment_profile") is not None\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_profile, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -82,22 +89,38 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('Payment-Profile').validate(dictionary.payment_profile).is_valid + return (UnionTypeLookUp.get("Payment-Profile") + .validate(dictionary.payment_profile).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('Payment-Profile').validate(dictionary.get('payment_profile')).is_valid + return (UnionTypeLookUp.get("Payment-Profile") + .validate(dictionary.get("payment_profile")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_related_events.py b/advancedbilling/models/payment_related_events.py index 9213fdef..2ee2d59a 100644 --- a/advancedbilling/models/payment_related_events.py +++ b/advancedbilling/models/payment_related_events.py @@ -1,41 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PaymentRelatedEvents(object): - """Implementation of the 'Payment Related Events' model. Attributes: product_id (int): The model property of type int. account_transaction_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_id": 'product_id', - "account_transaction_id": 'account_transaction_id' + "product_id": "product_id", + "account_transaction_id": "account_transaction_id", } - def __init__(self, - product_id=None, - account_transaction_id=None, - additional_properties=None): - """Constructor for the PaymentRelatedEvents class""" - + def __init__( + self, + product_id=None, + account_transaction_id=None, + additional_properties=None): + """Initialize a PaymentRelatedEvents instance.""" # Initialize members of the class - self.product_id = product_id - self.account_transaction_id = account_transaction_id + self.product_id = product_id + self.account_transaction_id = account_transaction_id # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,15 +54,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_id = dictionary.get("product_id") if dictionary.get("product_id") else None - account_transaction_id = dictionary.get("account_transaction_id") if dictionary.get("account_transaction_id") else None + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else None + account_transaction_id =\ + dictionary.get("account_transaction_id")\ + if dictionary.get("account_transaction_id")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_id, account_transaction_id, @@ -72,7 +78,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -83,29 +89,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.product_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.account_transaction_id, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.product_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.account_transaction_id, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('product_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('account_transaction_id'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("product_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("account_transaction_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_id={self.product_id!r}, ' - f'account_transaction_id={self.account_transaction_id!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_id=self.product_id + _account_transaction_id=self.account_transaction_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!r}, " + f"account_transaction_id={_account_transaction_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_id={self.product_id!s}, ' - f'account_transaction_id={self.account_transaction_id!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_id=self.product_id + _account_transaction_id=self.account_transaction_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!s}, " + f"account_transaction_id={_account_transaction_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/payment_type.py b/advancedbilling/models/payment_type.py index 225197ab..f13ca574 100644 --- a/advancedbilling/models/payment_type.py +++ b/advancedbilling/models/payment_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class PaymentType(object): - """Implementation of the 'Payment Type' enum. Attributes: @@ -17,22 +14,24 @@ class PaymentType(object): BANK_ACCOUNT: The enum member of type str. PAYPAL_ACCOUNT: The enum member of type str. APPLE_PAY: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['credit_card', 'bank_account', 'paypal_account', 'apple_pay'] - CREDIT_CARD = 'credit_card' - BANK_ACCOUNT = 'bank_account' + _all_values = ["credit_card", "bank_account", "paypal_account", + "apple_pay"] + CREDIT_CARD = "credit_card" - PAYPAL_ACCOUNT = 'paypal_account' + BANK_ACCOUNT = "bank_account" - APPLE_PAY = 'apple_pay' + PAYPAL_ACCOUNT = "paypal_account" + + APPLE_PAY = "apple_pay" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -42,9 +41,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/paypal_payment_profile.py b/advancedbilling/models/paypal_payment_profile.py index 677a9129..f717329f 100644 --- a/advancedbilling/models/paypal_payment_profile.py +++ b/advancedbilling/models/paypal_payment_profile.py @@ -1,173 +1,175 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payment_type import PaymentType +from advancedbilling.models.payment_type import ( + PaymentType, +) class PaypalPaymentProfile(object): - """Implementation of the 'Paypal Payment Profile' model. Attributes: - id (int): The Chargify-assigned ID of the stored PayPal payment - profile. + id (int): The Chargify-assigned ID of the stored PayPal payment profile. first_name (str): The first name of the PayPal account holder last_name (str): The last name of the PayPal account holder - customer_id (int): The Chargify-assigned id for the customer record to - which the PayPal account belongs - current_vault (PayPalVault): The vault that stores the payment profile - with the provided vault_token. - vault_token (str): The “token” provided by your vault storage for an - already stored payment profile - billing_address (str): The current billing street address for the - PayPal account - billing_city (str): The current billing address city for the PayPal - account - billing_state (str): The current billing address state for the PayPal + customer_id (int): The Chargify-assigned id for the customer record to which + the PayPal account belongs + current_vault (PayPalVault): The vault that stores the payment profile with + the provided vault_token. + vault_token (str): The “token” provided by your vault storage for an already + stored payment profile + billing_address (str): The current billing street address for the PayPal account - billing_zip (str): The current billing address zip code for the PayPal + billing_city (str): The current billing address city for the PayPal account + billing_state (str): The current billing address state for the PayPal account + billing_zip (str): The current billing address zip code for the PayPal account + billing_country (str): The current billing address country for the PayPal account - billing_country (str): The current billing address country for the - PayPal account customer_vault_token (str): The model property of type str. - billing_address_2 (str): The current billing street address, second - line, for the PayPal account + billing_address_2 (str): The current billing street address, second line, for + the PayPal account payment_type (PaymentType): The model property of type PaymentType. site_gateway_setting_id (int): The model property of type int. gateway_handle (str): The model property of type str. paypal_email (str): The model property of type str. - created_at (datetime): A timestamp indicating when this payment - profile was created - updated_at (datetime): A timestamp indicating when this payment - profile was last updated - additional_properties (Dict[str, object]): The additional properties - for the model. + created_at (datetime): A timestamp indicating when this payment profile was + created + updated_at (datetime): A timestamp indicating when this payment profile was + last updated + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_type": 'payment_type', - "id": 'id', - "first_name": 'first_name', - "last_name": 'last_name', - "customer_id": 'customer_id', - "current_vault": 'current_vault', - "vault_token": 'vault_token', - "billing_address": 'billing_address', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "billing_country": 'billing_country', - "customer_vault_token": 'customer_vault_token', - "billing_address_2": 'billing_address_2', - "site_gateway_setting_id": 'site_gateway_setting_id', - "gateway_handle": 'gateway_handle', - "paypal_email": 'paypal_email', - "created_at": 'created_at', - "updated_at": 'updated_at' + "payment_type": "payment_type", + "id": "id", + "first_name": "first_name", + "last_name": "last_name", + "customer_id": "customer_id", + "current_vault": "current_vault", + "vault_token": "vault_token", + "billing_address": "billing_address", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "billing_country": "billing_country", + "customer_vault_token": "customer_vault_token", + "billing_address_2": "billing_address_2", + "site_gateway_setting_id": "site_gateway_setting_id", + "gateway_handle": "gateway_handle", + "paypal_email": "paypal_email", + "created_at": "created_at", + "updated_at": "updated_at", } _optionals = [ - 'id', - 'first_name', - 'last_name', - 'customer_id', - 'current_vault', - 'vault_token', - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'site_gateway_setting_id', - 'gateway_handle', - 'paypal_email', - 'created_at', - 'updated_at', + "id", + "first_name", + "last_name", + "customer_id", + "current_vault", + "vault_token", + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "site_gateway_setting_id", + "gateway_handle", + "paypal_email", + "created_at", + "updated_at", ] _nullables = [ - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'customer_vault_token', - 'billing_address_2', - 'site_gateway_setting_id', - 'gateway_handle', + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "customer_vault_token", + "billing_address_2", + "site_gateway_setting_id", + "gateway_handle", ] - def __init__(self, - payment_type='paypal_account', - id=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - site_gateway_setting_id=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - paypal_email=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PaypalPaymentProfile class""" - + def __init__( + self, + payment_type="paypal_account", + id=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + site_gateway_setting_id=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + paypal_email=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a PaypalPaymentProfile instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 - self.payment_type = payment_type + self.billing_address_2 = billing_address_2 + self.payment_type = payment_type if site_gateway_setting_id is not APIHelper.SKIP: - self.site_gateway_setting_id = site_gateway_setting_id + self.site_gateway_setting_id = site_gateway_setting_id if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if paypal_email is not APIHelper.SKIP: - self.paypal_email = paypal_email + self.paypal_email = paypal_email if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None # Add additional model properties to the instance if additional_properties is None: @@ -177,7 +179,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -188,32 +190,89 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else 'paypal_account' - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if "billing_address" in dictionary.keys() else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if "billing_city" in dictionary.keys() else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if "billing_state" in dictionary.keys() else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if "billing_zip" in dictionary.keys() else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if "billing_country" in dictionary.keys() else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if "customer_vault_token" in dictionary.keys() else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if "billing_address_2" in dictionary.keys() else APIHelper.SKIP - site_gateway_setting_id = dictionary.get("site_gateway_setting_id") if "site_gateway_setting_id" in dictionary.keys() else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if "gateway_handle" in dictionary.keys() else APIHelper.SKIP - paypal_email = dictionary.get("paypal_email") if dictionary.get("paypal_email") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else "paypal_account" + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if "billing_city" in dictionary.keys()\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if "billing_state" in dictionary.keys()\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if "billing_zip" in dictionary.keys()\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if "billing_country" in dictionary.keys()\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if "customer_vault_token" in dictionary.keys()\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if "billing_address_2" in dictionary.keys()\ + else APIHelper.SKIP + site_gateway_setting_id =\ + dictionary.get("site_gateway_setting_id")\ + if "site_gateway_setting_id" in dictionary.keys()\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + paypal_email =\ + dictionary.get("paypal_email")\ + if dictionary.get("paypal_email")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_type, id, @@ -238,7 +297,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -249,59 +308,254 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.payment_type, - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.payment_type, + type_callable=lambda value: + PaymentType.validate(value)) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('payment_type'), - type_callable=lambda value: PaymentType.validate(value)) + return APIHelper.is_valid_type( + value=dictionary.get("payment_type"), + type_callable=lambda value: + PaymentType.validate(value)) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'payment_type={self.payment_type!r}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'paypal_email={(self.paypal_email if hasattr(self, "paypal_email") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _payment_type=self.payment_type + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _paypal_email=( + self.paypal_email + if hasattr(self, "paypal_email") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"customer_id={_customer_id!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"billing_address={_billing_address!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"billing_country={_billing_country!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"payment_type={_payment_type!r}, " + f"site_gateway_setting_id={_site_gateway_setting_id!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"paypal_email={_paypal_email!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'payment_type={self.payment_type!s}, ' - f'site_gateway_setting_id={(self.site_gateway_setting_id if hasattr(self, "site_gateway_setting_id") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'paypal_email={(self.paypal_email if hasattr(self, "paypal_email") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _payment_type=self.payment_type + _site_gateway_setting_id=( + self.site_gateway_setting_id + if hasattr(self, "site_gateway_setting_id") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _paypal_email=( + self.paypal_email + if hasattr(self, "paypal_email") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"customer_id={_customer_id!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"billing_address={_billing_address!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"billing_country={_billing_country!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"payment_type={_payment_type!s}, " + f"site_gateway_setting_id={_site_gateway_setting_id!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"paypal_email={_paypal_email!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/pending_cancellation_change.py b/advancedbilling/models/pending_cancellation_change.py index 49e880b1..f1a05d9b 100644 --- a/advancedbilling/models/pending_cancellation_change.py +++ b/advancedbilling/models/pending_cancellation_change.py @@ -1,41 +1,42 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PendingCancellationChange(object): - """Implementation of the 'Pending Cancellation Change' model. Attributes: cancellation_state (str): The model property of type str. cancels_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "cancellation_state": 'cancellation_state', - "cancels_at": 'cancels_at' + "cancellation_state": "cancellation_state", + "cancels_at": "cancels_at", } - def __init__(self, - cancellation_state=None, - cancels_at=None, - additional_properties=None): - """Constructor for the PendingCancellationChange class""" - + def __init__( + self, + cancellation_state=None, + cancels_at=None, + additional_properties=None): + """Initialize a PendingCancellationChange instance.""" # Initialize members of the class - self.cancellation_state = cancellation_state - self.cancels_at = APIHelper.apply_datetime_converter(cancels_at, APIHelper.RFC3339DateTime) if cancels_at else None + self.cancellation_state = cancellation_state + self.cancels_at =\ + APIHelper.apply_datetime_converter( + cancels_at, APIHelper.RFC3339DateTime)\ + if cancels_at else None # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +46,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,15 +57,22 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - cancellation_state = dictionary.get("cancellation_state") if dictionary.get("cancellation_state") else None - cancels_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("cancels_at")).datetime if dictionary.get("cancels_at") else None + cancellation_state =\ + dictionary.get("cancellation_state")\ + if dictionary.get("cancellation_state")\ + else None + cancels_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("cancels_at")).datetime\ + if dictionary.get("cancels_at") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(cancellation_state, cancels_at, @@ -72,7 +80,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -83,29 +91,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.cancellation_state, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.cancels_at, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) + return APIHelper.is_valid_type( + value=dictionary.cancellation_state, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.cancels_at, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('cancellation_state'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('cancels_at'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("cancellation_state"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("cancels_at"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'cancellation_state={self.cancellation_state!r}, ' - f'cancels_at={self.cancels_at!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _cancellation_state=self.cancellation_state + _cancels_at=self.cancels_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"cancellation_state={_cancellation_state!r}, " + f"cancels_at={_cancels_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'cancellation_state={self.cancellation_state!s}, ' - f'cancels_at={self.cancels_at!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _cancellation_state=self.cancellation_state + _cancels_at=self.cancels_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"cancellation_state={_cancellation_state!s}, " + f"cancels_at={_cancels_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/portal_management_link.py b/advancedbilling/models/portal_management_link.py index c64ce666..8f0f6a98 100644 --- a/advancedbilling/models/portal_management_link.py +++ b/advancedbilling/models/portal_management_link.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PortalManagementLink(object): - """Implementation of the 'Portal Management Link' model. Attributes: @@ -20,57 +18,69 @@ class PortalManagementLink(object): new_link_available_at (datetime): The model property of type datetime. expires_at (datetime): The model property of type datetime. last_invite_sent_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "url": 'url', - "fetch_count": 'fetch_count', - "created_at": 'created_at', - "new_link_available_at": 'new_link_available_at', - "expires_at": 'expires_at', - "last_invite_sent_at": 'last_invite_sent_at' + "url": "url", + "fetch_count": "fetch_count", + "created_at": "created_at", + "new_link_available_at": "new_link_available_at", + "expires_at": "expires_at", + "last_invite_sent_at": "last_invite_sent_at", } _optionals = [ - 'url', - 'fetch_count', - 'created_at', - 'new_link_available_at', - 'expires_at', - 'last_invite_sent_at', + "url", + "fetch_count", + "created_at", + "new_link_available_at", + "expires_at", + "last_invite_sent_at", ] _nullables = [ - 'last_invite_sent_at', + "last_invite_sent_at", ] - def __init__(self, - url=APIHelper.SKIP, - fetch_count=APIHelper.SKIP, - created_at=APIHelper.SKIP, - new_link_available_at=APIHelper.SKIP, - expires_at=APIHelper.SKIP, - last_invite_sent_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PortalManagementLink class""" - + def __init__( + self, + url=APIHelper.SKIP, + fetch_count=APIHelper.SKIP, + created_at=APIHelper.SKIP, + new_link_available_at=APIHelper.SKIP, + expires_at=APIHelper.SKIP, + last_invite_sent_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a PortalManagementLink instance.""" # Initialize members of the class if url is not APIHelper.SKIP: - self.url = url + self.url = url if fetch_count is not APIHelper.SKIP: - self.fetch_count = fetch_count + self.fetch_count = fetch_count if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if new_link_available_at is not APIHelper.SKIP: - self.new_link_available_at = APIHelper.apply_datetime_converter(new_link_available_at, APIHelper.RFC3339DateTime) if new_link_available_at else None + self.new_link_available_at =\ + APIHelper.apply_datetime_converter( + new_link_available_at, APIHelper.RFC3339DateTime)\ + if new_link_available_at else None if expires_at is not APIHelper.SKIP: - self.expires_at = APIHelper.apply_datetime_converter(expires_at, APIHelper.RFC3339DateTime) if expires_at else None + self.expires_at =\ + APIHelper.apply_datetime_converter( + expires_at, APIHelper.RFC3339DateTime)\ + if expires_at else None if last_invite_sent_at is not APIHelper.SKIP: - self.last_invite_sent_at = APIHelper.apply_datetime_converter(last_invite_sent_at, APIHelper.RFC3339DateTime) if last_invite_sent_at else None + self.last_invite_sent_at =\ + APIHelper.apply_datetime_converter( + last_invite_sent_at, APIHelper.RFC3339DateTime)\ + if last_invite_sent_at else None # Add additional model properties to the instance if additional_properties is None: @@ -80,7 +90,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -91,22 +101,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - url = dictionary.get("url") if dictionary.get("url") else APIHelper.SKIP - fetch_count = dictionary.get("fetch_count") if dictionary.get("fetch_count") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - new_link_available_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("new_link_available_at")).datetime if dictionary.get("new_link_available_at") else APIHelper.SKIP - expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else APIHelper.SKIP - if 'last_invite_sent_at' in dictionary.keys(): - last_invite_sent_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("last_invite_sent_at")).datetime if dictionary.get("last_invite_sent_at") else None + url =\ + dictionary.get("url")\ + if dictionary.get("url")\ + else APIHelper.SKIP + fetch_count =\ + dictionary.get("fetch_count")\ + if dictionary.get("fetch_count")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + new_link_available_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("new_link_available_at")).datetime\ + if dictionary.get("new_link_available_at") else APIHelper.SKIP + expires_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("expires_at")).datetime\ + if dictionary.get("expires_at") else APIHelper.SKIP + if "last_invite_sent_at" in dictionary.keys(): + last_invite_sent_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("last_invite_sent_at")).datetime\ + if dictionary.get("last_invite_sent_at") else None + else: last_invite_sent_at = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(url, fetch_count, @@ -117,21 +144,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'url={(self.url if hasattr(self, "url") else None)!r}, ' - f'fetch_count={(self.fetch_count if hasattr(self, "fetch_count") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'new_link_available_at={(self.new_link_available_at if hasattr(self, "new_link_available_at") else None)!r}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'last_invite_sent_at={(self.last_invite_sent_at if hasattr(self, "last_invite_sent_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _url=( + self.url + if hasattr(self, "url") + else None + ) + _fetch_count=( + self.fetch_count + if hasattr(self, "fetch_count") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _new_link_available_at=( + self.new_link_available_at + if hasattr(self, "new_link_available_at") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _last_invite_sent_at=( + self.last_invite_sent_at + if hasattr(self, "last_invite_sent_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"url={_url!r}, " + f"fetch_count={_fetch_count!r}, " + f"created_at={_created_at!r}, " + f"new_link_available_at={_new_link_available_at!r}, " + f"expires_at={_expires_at!r}, " + f"last_invite_sent_at={_last_invite_sent_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'url={(self.url if hasattr(self, "url") else None)!s}, ' - f'fetch_count={(self.fetch_count if hasattr(self, "fetch_count") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'new_link_available_at={(self.new_link_available_at if hasattr(self, "new_link_available_at") else None)!s}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'last_invite_sent_at={(self.last_invite_sent_at if hasattr(self, "last_invite_sent_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _url=( + self.url + if hasattr(self, "url") + else None + ) + _fetch_count=( + self.fetch_count + if hasattr(self, "fetch_count") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _new_link_available_at=( + self.new_link_available_at + if hasattr(self, "new_link_available_at") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _last_invite_sent_at=( + self.last_invite_sent_at + if hasattr(self, "last_invite_sent_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"url={_url!s}, " + f"fetch_count={_fetch_count!s}, " + f"created_at={_created_at!s}, " + f"new_link_available_at={_new_link_available_at!s}, " + f"expires_at={_expires_at!s}, " + f"last_invite_sent_at={_last_invite_sent_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepaid_configuration.py b/advancedbilling/models/prepaid_configuration.py index 145c7021..91ca9202 100644 --- a/advancedbilling/models/prepaid_configuration.py +++ b/advancedbilling/models/prepaid_configuration.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PrepaidConfiguration(object): - """Implementation of the 'Prepaid Configuration' model. Attributes: @@ -18,50 +16,50 @@ class PrepaidConfiguration(object): initial_funding_amount_in_cents (int): The model property of type int. replenish_to_amount_in_cents (int): The model property of type int. auto_replenish (bool): The model property of type bool. - replenish_threshold_amount_in_cents (int): The model property of type - int. - additional_properties (Dict[str, object]): The additional properties - for the model. + replenish_threshold_amount_in_cents (int): The model property of type int. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "initial_funding_amount_in_cents": 'initial_funding_amount_in_cents', - "replenish_to_amount_in_cents": 'replenish_to_amount_in_cents', - "auto_replenish": 'auto_replenish', - "replenish_threshold_amount_in_cents": 'replenish_threshold_amount_in_cents' + "id": "id", + "initial_funding_amount_in_cents": "initial_funding_amount_in_cents", + "replenish_to_amount_in_cents": "replenish_to_amount_in_cents", + "auto_replenish": "auto_replenish", + "replenish_threshold_amount_in_cents": "replenish_threshold_amount_in_cents", } _optionals = [ - 'id', - 'initial_funding_amount_in_cents', - 'replenish_to_amount_in_cents', - 'auto_replenish', - 'replenish_threshold_amount_in_cents', + "id", + "initial_funding_amount_in_cents", + "replenish_to_amount_in_cents", + "auto_replenish", + "replenish_threshold_amount_in_cents", ] - def __init__(self, - id=APIHelper.SKIP, - initial_funding_amount_in_cents=APIHelper.SKIP, - replenish_to_amount_in_cents=APIHelper.SKIP, - auto_replenish=APIHelper.SKIP, - replenish_threshold_amount_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PrepaidConfiguration class""" - + def __init__( + self, + id=APIHelper.SKIP, + initial_funding_amount_in_cents=APIHelper.SKIP, + replenish_to_amount_in_cents=APIHelper.SKIP, + auto_replenish=APIHelper.SKIP, + replenish_threshold_amount_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a PrepaidConfiguration instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if initial_funding_amount_in_cents is not APIHelper.SKIP: - self.initial_funding_amount_in_cents = initial_funding_amount_in_cents + self.initial_funding_amount_in_cents = initial_funding_amount_in_cents if replenish_to_amount_in_cents is not APIHelper.SKIP: - self.replenish_to_amount_in_cents = replenish_to_amount_in_cents + self.replenish_to_amount_in_cents = replenish_to_amount_in_cents if auto_replenish is not APIHelper.SKIP: - self.auto_replenish = auto_replenish + self.auto_replenish = auto_replenish if replenish_threshold_amount_in_cents is not APIHelper.SKIP: - self.replenish_threshold_amount_in_cents = replenish_threshold_amount_in_cents + self.replenish_threshold_amount_in_cents =\ + replenish_threshold_amount_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -71,7 +69,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -82,18 +80,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - initial_funding_amount_in_cents = dictionary.get("initial_funding_amount_in_cents") if dictionary.get("initial_funding_amount_in_cents") else APIHelper.SKIP - replenish_to_amount_in_cents = dictionary.get("replenish_to_amount_in_cents") if dictionary.get("replenish_to_amount_in_cents") else APIHelper.SKIP - auto_replenish = dictionary.get("auto_replenish") if "auto_replenish" in dictionary.keys() else APIHelper.SKIP - replenish_threshold_amount_in_cents = dictionary.get("replenish_threshold_amount_in_cents") if dictionary.get("replenish_threshold_amount_in_cents") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + initial_funding_amount_in_cents =\ + dictionary.get("initial_funding_amount_in_cents")\ + if dictionary.get("initial_funding_amount_in_cents")\ + else APIHelper.SKIP + replenish_to_amount_in_cents =\ + dictionary.get("replenish_to_amount_in_cents")\ + if dictionary.get("replenish_to_amount_in_cents")\ + else APIHelper.SKIP + auto_replenish =\ + dictionary.get("auto_replenish")\ + if "auto_replenish" in dictionary.keys()\ + else APIHelper.SKIP + replenish_threshold_amount_in_cents =\ + dictionary.get("replenish_threshold_amount_in_cents")\ + if dictionary.get("replenish_threshold_amount_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, initial_funding_amount_in_cents, @@ -104,7 +119,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -115,7 +130,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -125,19 +139,79 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'initial_funding_amount_in_cents={(self.initial_funding_amount_in_cents if hasattr(self, "initial_funding_amount_in_cents") else None)!r}, ' - f'replenish_to_amount_in_cents={(self.replenish_to_amount_in_cents if hasattr(self, "replenish_to_amount_in_cents") else None)!r}, ' - f'auto_replenish={(self.auto_replenish if hasattr(self, "auto_replenish") else None)!r}, ' - f'replenish_threshold_amount_in_cents={(self.replenish_threshold_amount_in_cents if hasattr(self, "replenish_threshold_amount_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _initial_funding_amount_in_cents=( + self.initial_funding_amount_in_cents + if hasattr(self, "initial_funding_amount_in_cents") + else None + ) + _replenish_to_amount_in_cents=( + self.replenish_to_amount_in_cents + if hasattr(self, "replenish_to_amount_in_cents") + else None + ) + _auto_replenish=( + self.auto_replenish + if hasattr(self, "auto_replenish") + else None + ) + _replenish_threshold_amount_in_cents=( + self.replenish_threshold_amount_in_cents + if hasattr(self, "replenish_threshold_amount_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"initial_funding_amount_in_cents={_initial_funding_amount_in_cents!r}, " + f"replenish_to_amount_in_cents={_replenish_to_amount_in_cents!r}, " + f"auto_replenish={_auto_replenish!r}, " + f"replenish_threshold_amount_in_cents={_replenish_threshold_amount_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'initial_funding_amount_in_cents={(self.initial_funding_amount_in_cents if hasattr(self, "initial_funding_amount_in_cents") else None)!s}, ' - f'replenish_to_amount_in_cents={(self.replenish_to_amount_in_cents if hasattr(self, "replenish_to_amount_in_cents") else None)!s}, ' - f'auto_replenish={(self.auto_replenish if hasattr(self, "auto_replenish") else None)!s}, ' - f'replenish_threshold_amount_in_cents={(self.replenish_threshold_amount_in_cents if hasattr(self, "replenish_threshold_amount_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _initial_funding_amount_in_cents=( + self.initial_funding_amount_in_cents + if hasattr(self, "initial_funding_amount_in_cents") + else None + ) + _replenish_to_amount_in_cents=( + self.replenish_to_amount_in_cents + if hasattr(self, "replenish_to_amount_in_cents") + else None + ) + _auto_replenish=( + self.auto_replenish + if hasattr(self, "auto_replenish") + else None + ) + _replenish_threshold_amount_in_cents=( + self.replenish_threshold_amount_in_cents + if hasattr(self, "replenish_threshold_amount_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"initial_funding_amount_in_cents={_initial_funding_amount_in_cents!s}, " + f"replenish_to_amount_in_cents={_replenish_to_amount_in_cents!s}, " + f"auto_replenish={_auto_replenish!s}, " + f"replenish_threshold_amount_in_cents={_replenish_threshold_amount_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepaid_configuration_response.py b/advancedbilling/models/prepaid_configuration_response.py index 93728c6a..127b6353 100644 --- a/advancedbilling/models/prepaid_configuration_response.py +++ b/advancedbilling/models/prepaid_configuration_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.prepaid_configuration import PrepaidConfiguration +# ruff: noqa: E501 +from advancedbilling.models.prepaid_configuration import ( + PrepaidConfiguration, +) -class PrepaidConfigurationResponse(object): +class PrepaidConfigurationResponse(object): """Implementation of the 'Prepaid Configuration Response' model. Attributes: - prepaid_configuration (PrepaidConfiguration): The model property of - type PrepaidConfiguration. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepaid_configuration (PrepaidConfiguration): The model property of type + PrepaidConfiguration. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepaid_configuration": 'prepaid_configuration' + "prepaid_configuration": "prepaid_configuration", } - def __init__(self, - prepaid_configuration=None, - additional_properties=None): - """Constructor for the PrepaidConfigurationResponse class""" - + def __init__( + self, + prepaid_configuration=None, + additional_properties=None): + """Initialize a PrepaidConfigurationResponse instance.""" # Initialize members of the class - self.prepaid_configuration = prepaid_configuration + self.prepaid_configuration = prepaid_configuration # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepaid_configuration = PrepaidConfiguration.from_dictionary(dictionary.get('prepaid_configuration')) if dictionary.get('prepaid_configuration') else None + prepaid_configuration =\ + PrepaidConfiguration.from_dictionary( + dictionary.get("prepaid_configuration"))\ + if dictionary.get("prepaid_configuration") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepaid_configuration, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepaid_configuration={self.prepaid_configuration!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepaid_configuration=self.prepaid_configuration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepaid_configuration={_prepaid_configuration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepaid_configuration={self.prepaid_configuration!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepaid_configuration=self.prepaid_configuration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepaid_configuration={_prepaid_configuration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepaid_product_price_point_filter.py b/advancedbilling/models/prepaid_product_price_point_filter.py index c96d7ed6..050dd705 100644 --- a/advancedbilling/models/prepaid_product_price_point_filter.py +++ b/advancedbilling/models/prepaid_product_price_point_filter.py @@ -1,36 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class PrepaidProductPricePointFilter(object): - """Implementation of the 'Prepaid Product Price Point Filter' model. Attributes: - product_price_point_id (str): Passed as a parameter to list methods to - return only non null values. - additional_properties (Dict[str, object]): The additional properties - for the model. + product_price_point_id (str): Passed as a parameter to list methods to return + only non null values. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_price_point_id": 'product_price_point_id' + "product_price_point_id": "product_price_point_id", } - def __init__(self, - additional_properties=None): - """Constructor for the PrepaidProductPricePointFilter class""" - + def __init__( + self, + additional_properties=None): + """Initialize a PrepaidProductPricePointFilter instance.""" # Initialize members of the class - self.product_price_point_id = 'not_null' + self.product_price_point_id = "not_null" # Add additional model properties to the instance if additional_properties is None: @@ -40,7 +36,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -51,23 +47,36 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_price_point_id={self.product_price_point_id!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_price_point_id=self.product_price_point_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_price_point_id={_product_price_point_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_price_point_id={self.product_price_point_id!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_price_point_id=self.product_price_point_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_price_point_id={_product_price_point_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepaid_subscription_balance_changed.py b/advancedbilling/models/prepaid_subscription_balance_changed.py index 7e363cf6..9b9341aa 100644 --- a/advancedbilling/models/prepaid_subscription_balance_changed.py +++ b/advancedbilling/models/prepaid_subscription_balance_changed.py @@ -1,50 +1,48 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PrepaidSubscriptionBalanceChanged(object): - """Implementation of the 'Prepaid Subscription Balance Changed' model. Attributes: reason (str): The model property of type str. current_account_balance_in_cents (int): The model property of type int. - prepayment_account_balance_in_cents (int): The model property of type - int. + prepayment_account_balance_in_cents (int): The model property of type int. current_usage_amount_in_cents (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reason": 'reason', - "current_account_balance_in_cents": 'current_account_balance_in_cents', - "prepayment_account_balance_in_cents": 'prepayment_account_balance_in_cents', - "current_usage_amount_in_cents": 'current_usage_amount_in_cents' + "reason": "reason", + "current_account_balance_in_cents": "current_account_balance_in_cents", + "prepayment_account_balance_in_cents": "prepayment_account_balance_in_cents", + "current_usage_amount_in_cents": "current_usage_amount_in_cents", } - def __init__(self, - reason=None, - current_account_balance_in_cents=None, - prepayment_account_balance_in_cents=None, - current_usage_amount_in_cents=None, - additional_properties=None): - """Constructor for the PrepaidSubscriptionBalanceChanged class""" - + def __init__( + self, + reason=None, + current_account_balance_in_cents=None, + prepayment_account_balance_in_cents=None, + current_usage_amount_in_cents=None, + additional_properties=None): + """Initialize a PrepaidSubscriptionBalanceChanged instance.""" # Initialize members of the class - self.reason = reason - self.current_account_balance_in_cents = current_account_balance_in_cents - self.prepayment_account_balance_in_cents = prepayment_account_balance_in_cents - self.current_usage_amount_in_cents = current_usage_amount_in_cents + self.reason = reason + self.current_account_balance_in_cents = current_account_balance_in_cents + self.prepayment_account_balance_in_cents =\ + prepayment_account_balance_in_cents + self.current_usage_amount_in_cents = current_usage_amount_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -54,7 +52,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -65,17 +63,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reason = dictionary.get("reason") if dictionary.get("reason") else None - current_account_balance_in_cents = dictionary.get("current_account_balance_in_cents") if dictionary.get("current_account_balance_in_cents") else None - prepayment_account_balance_in_cents = dictionary.get("prepayment_account_balance_in_cents") if dictionary.get("prepayment_account_balance_in_cents") else None - current_usage_amount_in_cents = dictionary.get("current_usage_amount_in_cents") if dictionary.get("current_usage_amount_in_cents") else None + reason =\ + dictionary.get("reason")\ + if dictionary.get("reason")\ + else None + current_account_balance_in_cents =\ + dictionary.get("current_account_balance_in_cents")\ + if dictionary.get("current_account_balance_in_cents")\ + else None + prepayment_account_balance_in_cents =\ + dictionary.get("prepayment_account_balance_in_cents")\ + if dictionary.get("prepayment_account_balance_in_cents")\ + else None + current_usage_amount_in_cents =\ + dictionary.get("current_usage_amount_in_cents")\ + if dictionary.get("current_usage_amount_in_cents")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reason, current_account_balance_in_cents, @@ -85,7 +97,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -96,41 +108,98 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.reason, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.current_account_balance_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.prepayment_account_balance_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.current_usage_amount_in_cents, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.reason, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.current_account_balance_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.prepayment_account_balance_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.current_usage_amount_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('reason'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('current_account_balance_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('prepayment_account_balance_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('current_usage_amount_in_cents'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("reason"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("current_account_balance_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("prepayment_account_balance_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("current_usage_amount_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!r}, ' - f'current_account_balance_in_cents={self.current_account_balance_in_cents!r}, ' - f'prepayment_account_balance_in_cents={self.prepayment_account_balance_in_cents!r}, ' - f'current_usage_amount_in_cents={self.current_usage_amount_in_cents!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reason=self.reason + _current_account_balance_in_cents=self.current_account_balance_in_cents + _prepayment_account_balance_in_cents=self.prepayment_account_balance_in_cents + _current_usage_amount_in_cents=self.current_usage_amount_in_cents + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!r}, " + f"current_account_balance_in_cents={_current_account_balance_in_cents!r}, " + f"prepayment_account_balance_in_cents={_prepayment_account_balance_in_cents!r}, " + f"current_usage_amount_in_cents={_current_usage_amount_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!s}, ' - f'current_account_balance_in_cents={self.current_account_balance_in_cents!s}, ' - f'prepayment_account_balance_in_cents={self.prepayment_account_balance_in_cents!s}, ' - f'current_usage_amount_in_cents={self.current_usage_amount_in_cents!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reason=self.reason + _current_account_balance_in_cents=self.current_account_balance_in_cents + _prepayment_account_balance_in_cents=self.prepayment_account_balance_in_cents + _current_usage_amount_in_cents=self.current_usage_amount_in_cents + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!s}, " + f"current_account_balance_in_cents={_current_account_balance_in_cents!s}, " + f"prepayment_account_balance_in_cents={_prepayment_account_balance_in_cents!s}, " + f"current_usage_amount_in_cents={_current_usage_amount_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepaid_usage.py b/advancedbilling/models/prepaid_usage.py index ff3a6000..86c36d59 100644 --- a/advancedbilling/models/prepaid_usage.py +++ b/advancedbilling/models/prepaid_usage.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.prepaid_usage_allocation_detail import PrepaidUsageAllocationDetail +from advancedbilling.models.prepaid_usage_allocation_detail import ( + PrepaidUsageAllocationDetail, +) class PrepaidUsage(object): - """Implementation of the 'Prepaid Usage' model. Attributes: @@ -24,52 +24,52 @@ class PrepaidUsage(object): component_id (int): The model property of type int. component_handle (str): The model property of type str. memo (str): The model property of type str. - allocation_details (List[PrepaidUsageAllocationDetail]): The model - property of type List[PrepaidUsageAllocationDetail]. - additional_properties (Dict[str, object]): The additional properties - for the model. + allocation_details (List[PrepaidUsageAllocationDetail]): The model property + of type List[PrepaidUsageAllocationDetail]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "previous_unit_balance": 'previous_unit_balance', - "previous_overage_unit_balance": 'previous_overage_unit_balance', - "new_unit_balance": 'new_unit_balance', - "new_overage_unit_balance": 'new_overage_unit_balance', - "usage_quantity": 'usage_quantity', - "overage_usage_quantity": 'overage_usage_quantity', - "component_id": 'component_id', - "component_handle": 'component_handle', - "memo": 'memo', - "allocation_details": 'allocation_details' + "previous_unit_balance": "previous_unit_balance", + "previous_overage_unit_balance": "previous_overage_unit_balance", + "new_unit_balance": "new_unit_balance", + "new_overage_unit_balance": "new_overage_unit_balance", + "usage_quantity": "usage_quantity", + "overage_usage_quantity": "overage_usage_quantity", + "component_id": "component_id", + "component_handle": "component_handle", + "memo": "memo", + "allocation_details": "allocation_details", } - def __init__(self, - previous_unit_balance=None, - previous_overage_unit_balance=None, - new_unit_balance=None, - new_overage_unit_balance=None, - usage_quantity=None, - overage_usage_quantity=None, - component_id=None, - component_handle=None, - memo=None, - allocation_details=None, - additional_properties=None): - """Constructor for the PrepaidUsage class""" - + def __init__( + self, + previous_unit_balance=None, + previous_overage_unit_balance=None, + new_unit_balance=None, + new_overage_unit_balance=None, + usage_quantity=None, + overage_usage_quantity=None, + component_id=None, + component_handle=None, + memo=None, + allocation_details=None, + additional_properties=None): + """Initialize a PrepaidUsage instance.""" # Initialize members of the class - self.previous_unit_balance = previous_unit_balance - self.previous_overage_unit_balance = previous_overage_unit_balance - self.new_unit_balance = new_unit_balance - self.new_overage_unit_balance = new_overage_unit_balance - self.usage_quantity = usage_quantity - self.overage_usage_quantity = overage_usage_quantity - self.component_id = component_id - self.component_handle = component_handle - self.memo = memo - self.allocation_details = allocation_details + self.previous_unit_balance = previous_unit_balance + self.previous_overage_unit_balance = previous_overage_unit_balance + self.new_unit_balance = new_unit_balance + self.new_overage_unit_balance = new_overage_unit_balance + self.usage_quantity = usage_quantity + self.overage_usage_quantity = overage_usage_quantity + self.component_id = component_id + self.component_handle = component_handle + self.memo = memo + self.allocation_details = allocation_details # Add additional model properties to the instance if additional_properties is None: @@ -79,7 +79,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -90,25 +90,57 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - previous_unit_balance = dictionary.get("previous_unit_balance") if dictionary.get("previous_unit_balance") else None - previous_overage_unit_balance = dictionary.get("previous_overage_unit_balance") if dictionary.get("previous_overage_unit_balance") else None - new_unit_balance = dictionary.get("new_unit_balance") if dictionary.get("new_unit_balance") else None - new_overage_unit_balance = dictionary.get("new_overage_unit_balance") if dictionary.get("new_overage_unit_balance") else None - usage_quantity = dictionary.get("usage_quantity") if dictionary.get("usage_quantity") else None - overage_usage_quantity = dictionary.get("overage_usage_quantity") if dictionary.get("overage_usage_quantity") else None - component_id = dictionary.get("component_id") if dictionary.get("component_id") else None - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None + previous_unit_balance =\ + dictionary.get("previous_unit_balance")\ + if dictionary.get("previous_unit_balance")\ + else None + previous_overage_unit_balance =\ + dictionary.get("previous_overage_unit_balance")\ + if dictionary.get("previous_overage_unit_balance")\ + else None + new_unit_balance =\ + dictionary.get("new_unit_balance")\ + if dictionary.get("new_unit_balance")\ + else None + new_overage_unit_balance =\ + dictionary.get("new_overage_unit_balance")\ + if dictionary.get("new_overage_unit_balance")\ + else None + usage_quantity =\ + dictionary.get("usage_quantity")\ + if dictionary.get("usage_quantity")\ + else None + overage_usage_quantity =\ + dictionary.get("overage_usage_quantity")\ + if dictionary.get("overage_usage_quantity")\ + else None + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else None + component_handle =\ + dictionary.get("component_handle")\ + if dictionary.get("component_handle")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None allocation_details = None - if dictionary.get('allocation_details') is not None: - allocation_details = [PrepaidUsageAllocationDetail.from_dictionary(x) for x in dictionary.get('allocation_details')] + if dictionary.get("allocation_details") is not None: + allocation_details = [ + PrepaidUsageAllocationDetail.from_dictionary(x) + for x in dictionary.get("allocation_details") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(previous_unit_balance, previous_overage_unit_balance, @@ -124,7 +156,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -135,81 +167,204 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.previous_unit_balance, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.previous_overage_unit_balance, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.new_unit_balance, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.new_overage_unit_balance, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.usage_quantity, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.overage_usage_quantity, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.component_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.component_handle, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.allocation_details, - type_callable=lambda value: PrepaidUsageAllocationDetail.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.previous_unit_balance, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.previous_overage_unit_balance, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.new_unit_balance, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.new_overage_unit_balance, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.usage_quantity, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.overage_usage_quantity, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.component_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.component_handle, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.allocation_details, + type_callable=lambda value: + PrepaidUsageAllocationDetail.validate(value), + is_model_dict=True, + is_inner_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('previous_unit_balance'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('previous_overage_unit_balance'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('new_unit_balance'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('new_overage_unit_balance'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('usage_quantity'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('overage_usage_quantity'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('component_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('component_handle'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('allocation_details'), - type_callable=lambda value: PrepaidUsageAllocationDetail.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("previous_unit_balance"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("previous_overage_unit_balance"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_unit_balance"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_overage_unit_balance"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("usage_quantity"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("overage_usage_quantity"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("component_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("component_handle"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("allocation_details"), + type_callable=lambda value: + PrepaidUsageAllocationDetail.validate(value), + is_model_dict=True, + is_inner_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'previous_unit_balance={self.previous_unit_balance!r}, ' - f'previous_overage_unit_balance={self.previous_overage_unit_balance!r}, ' - f'new_unit_balance={self.new_unit_balance!r}, ' - f'new_overage_unit_balance={self.new_overage_unit_balance!r}, ' - f'usage_quantity={self.usage_quantity!r}, ' - f'overage_usage_quantity={self.overage_usage_quantity!r}, ' - f'component_id={self.component_id!r}, ' - f'component_handle={self.component_handle!r}, ' - f'memo={self.memo!r}, ' - f'allocation_details={self.allocation_details!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _previous_unit_balance=self.previous_unit_balance + _previous_overage_unit_balance=self.previous_overage_unit_balance + _new_unit_balance=self.new_unit_balance + _new_overage_unit_balance=self.new_overage_unit_balance + _usage_quantity=self.usage_quantity + _overage_usage_quantity=self.overage_usage_quantity + _component_id=self.component_id + _component_handle=self.component_handle + _memo=self.memo + _allocation_details=self.allocation_details + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_unit_balance={_previous_unit_balance!r}, " + f"previous_overage_unit_balance={_previous_overage_unit_balance!r}, " + f"new_unit_balance={_new_unit_balance!r}, " + f"new_overage_unit_balance={_new_overage_unit_balance!r}, " + f"usage_quantity={_usage_quantity!r}, " + f"overage_usage_quantity={_overage_usage_quantity!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"memo={_memo!r}, " + f"allocation_details={_allocation_details!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'previous_unit_balance={self.previous_unit_balance!s}, ' - f'previous_overage_unit_balance={self.previous_overage_unit_balance!s}, ' - f'new_unit_balance={self.new_unit_balance!s}, ' - f'new_overage_unit_balance={self.new_overage_unit_balance!s}, ' - f'usage_quantity={self.usage_quantity!s}, ' - f'overage_usage_quantity={self.overage_usage_quantity!s}, ' - f'component_id={self.component_id!s}, ' - f'component_handle={self.component_handle!s}, ' - f'memo={self.memo!s}, ' - f'allocation_details={self.allocation_details!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _previous_unit_balance=self.previous_unit_balance + _previous_overage_unit_balance=self.previous_overage_unit_balance + _new_unit_balance=self.new_unit_balance + _new_overage_unit_balance=self.new_overage_unit_balance + _usage_quantity=self.usage_quantity + _overage_usage_quantity=self.overage_usage_quantity + _component_id=self.component_id + _component_handle=self.component_handle + _memo=self.memo + _allocation_details=self.allocation_details + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_unit_balance={_previous_unit_balance!s}, " + f"previous_overage_unit_balance={_previous_overage_unit_balance!s}, " + f"new_unit_balance={_new_unit_balance!s}, " + f"new_overage_unit_balance={_new_overage_unit_balance!s}, " + f"usage_quantity={_usage_quantity!s}, " + f"overage_usage_quantity={_overage_usage_quantity!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"memo={_memo!s}, " + f"allocation_details={_allocation_details!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepaid_usage_allocation_detail.py b/advancedbilling/models/prepaid_usage_allocation_detail.py index b05fce28..c82200b8 100644 --- a/advancedbilling/models/prepaid_usage_allocation_detail.py +++ b/advancedbilling/models/prepaid_usage_allocation_detail.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PrepaidUsageAllocationDetail(object): - """Implementation of the 'Prepaid Usage Allocation Detail' model. Attributes: allocation_id (int): The model property of type int. charge_id (int): The model property of type int. usage_quantity (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "allocation_id": 'allocation_id', - "charge_id": 'charge_id', - "usage_quantity": 'usage_quantity' + "allocation_id": "allocation_id", + "charge_id": "charge_id", + "usage_quantity": "usage_quantity", } _optionals = [ - 'allocation_id', - 'charge_id', - 'usage_quantity', + "allocation_id", + "charge_id", + "usage_quantity", ] - def __init__(self, - allocation_id=APIHelper.SKIP, - charge_id=APIHelper.SKIP, - usage_quantity=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PrepaidUsageAllocationDetail class""" - + def __init__( + self, + allocation_id=APIHelper.SKIP, + charge_id=APIHelper.SKIP, + usage_quantity=APIHelper.SKIP, + additional_properties=None): + """Initialize a PrepaidUsageAllocationDetail instance.""" # Initialize members of the class if allocation_id is not APIHelper.SKIP: - self.allocation_id = allocation_id + self.allocation_id = allocation_id if charge_id is not APIHelper.SKIP: - self.charge_id = charge_id + self.charge_id = charge_id if usage_quantity is not APIHelper.SKIP: - self.usage_quantity = usage_quantity + self.usage_quantity = usage_quantity # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - allocation_id = dictionary.get("allocation_id") if dictionary.get("allocation_id") else APIHelper.SKIP - charge_id = dictionary.get("charge_id") if dictionary.get("charge_id") else APIHelper.SKIP - usage_quantity = dictionary.get("usage_quantity") if dictionary.get("usage_quantity") else APIHelper.SKIP + allocation_id =\ + dictionary.get("allocation_id")\ + if dictionary.get("allocation_id")\ + else APIHelper.SKIP + charge_id =\ + dictionary.get("charge_id")\ + if dictionary.get("charge_id")\ + else APIHelper.SKIP + usage_quantity =\ + dictionary.get("usage_quantity")\ + if dictionary.get("usage_quantity")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(allocation_id, charge_id, @@ -87,7 +96,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -98,7 +107,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -108,15 +116,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'allocation_id={(self.allocation_id if hasattr(self, "allocation_id") else None)!r}, ' - f'charge_id={(self.charge_id if hasattr(self, "charge_id") else None)!r}, ' - f'usage_quantity={(self.usage_quantity if hasattr(self, "usage_quantity") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _allocation_id=( + self.allocation_id + if hasattr(self, "allocation_id") + else None + ) + _charge_id=( + self.charge_id + if hasattr(self, "charge_id") + else None + ) + _usage_quantity=( + self.usage_quantity + if hasattr(self, "usage_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation_id={_allocation_id!r}, " + f"charge_id={_charge_id!r}, " + f"usage_quantity={_usage_quantity!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'allocation_id={(self.allocation_id if hasattr(self, "allocation_id") else None)!s}, ' - f'charge_id={(self.charge_id if hasattr(self, "charge_id") else None)!s}, ' - f'usage_quantity={(self.usage_quantity if hasattr(self, "usage_quantity") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _allocation_id=( + self.allocation_id + if hasattr(self, "allocation_id") + else None + ) + _charge_id=( + self.charge_id + if hasattr(self, "charge_id") + else None + ) + _usage_quantity=( + self.usage_quantity + if hasattr(self, "usage_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation_id={_allocation_id!s}, " + f"charge_id={_charge_id!s}, " + f"usage_quantity={_usage_quantity!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepaid_usage_component.py b/advancedbilling/models/prepaid_usage_component.py index 17b66818..9a83cc64 100644 --- a/advancedbilling/models/prepaid_usage_component.py +++ b/advancedbilling/models/prepaid_usage_component.py @@ -1,205 +1,198 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_prepaid_usage_component_price_point import CreatePrepaidUsageComponentPricePoint -from advancedbilling.models.overage_pricing import OveragePricing +from advancedbilling.models.create_prepaid_usage_component_price_point import ( + CreatePrepaidUsageComponentPricePoint, +) +from advancedbilling.models.overage_pricing import ( + OveragePricing, +) from advancedbilling.models.price import Price class PrepaidUsageComponent(object): - """Implementation of the 'Prepaid Usage Component' model. Attributes: - name (str): A name for this component that is suitable for showing - customers and displaying on billing statements, ie. "Minutes". - unit_name (str): The name of the unit of measurement for the - component. It should be singular since it will be automatically - pluralized when necessary. i.e. “message”, which may then be shown - as “5 messages” on a subscription’s component line-item - description (str): A description for the component that will be - displayed to the user on the hosted signup page. - handle (str): A unique identifier for your use that can be used to - retrieve this component is subsequent requests. Must start with a - letter or number and may only contain lowercase letters, numbers, - or the characters '.', ':', '-', or '_'. - taxable (bool): Boolean flag describing whether a component is taxable - or not. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. - prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) - One or more price brackets. See [Price Bracket - Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-C - omponent-Pricing-Schemes#price-bracket-rules) for an overview of - how price brackets work for different pricing schemes. + name (str): A name for this component that is suitable for showing customers + and displaying on billing statements, ie. "Minutes". + unit_name (str): The name of the unit of measurement for the component. It + should be singular since it will be automatically pluralized when + necessary. i.e. “message”, which may then be shown as “5 messages” on a + subscription’s component line-item + description (str): A description for the component that will be displayed to + the user on the hosted signup page. + handle (str): A unique identifier for your use that can be used to retrieve + this component is subsequent requests. Must start with a letter or + number and may only contain lowercase letters, numbers, or the characters + '.', ':', '-', or '_'. + taxable (bool): Boolean flag describing whether a component is taxable or not. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. + prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) One or + more price brackets. See [Price Bracket + Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Componen + t-Pricing-Schemes#price-bracket-rules) for an overview of how price + brackets work for different pricing schemes. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. price_points (List[CreatePrepaidUsageComponentPricePoint]): The model property of type List[CreatePrepaidUsageComponentPricePoint]. - unit_price (str | float | None): The amount the customer will be - charged per unit when the pricing scheme is “per_unit”. For On/Off - Components, this is the amount that the customer will be charged - when they turn the component on for the subscription. The price - can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or - 0.00000065 - tax_code (str): A string representing the tax code related to the - component type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. - hide_date_range_on_invoice (bool): (Only available on Relationship - Invoicing sites) Boolean flag describing if the service date range - should show for the component on generated invoices. - overage_pricing (OveragePricing): The model property of type - OveragePricing. - rollover_prepaid_remainder (bool): Boolean which controls whether or - not remaining units should be rolled over to the next period - renew_prepaid_allocation (bool): Boolean which controls whether or not - the allocated quantity should be renewed at the beginning of each - period + unit_price (str | float | None): The amount the customer will be charged per + unit when the pricing scheme is “per_unit”. For On/Off Components, this + is the amount that the customer will be charged when they turn the + component on for the subscription. The price can contain up to 8 decimal + places. i.e. 1.00 or 0.0012 or 0.00000065 + tax_code (str): A string representing the tax code related to the component + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. + hide_date_range_on_invoice (bool): (Only available on Relationship Invoicing + sites) Boolean flag describing if the service date range should show for + the component on generated invoices. + overage_pricing (OveragePricing): The model property of type OveragePricing. + rollover_prepaid_remainder (bool): Boolean which controls whether or not + remaining units should be rolled over to the next period + renew_prepaid_allocation (bool): Boolean which controls whether or not the + allocated quantity should be renewed at the beginning of each period expiration_interval (float): (only for prepaid usage components where rollover_prepaid_remainder is true) The number of - `expiration_interval_unit`s after which rollover amounts should - expire - expiration_interval_unit (ExpirationIntervalUnit): The model property - of type ExpirationIntervalUnit. + `expiration_interval_unit`s after which rollover amounts should expire + expiration_interval_unit (ExpirationIntervalUnit): The model property of type + ExpirationIntervalUnit. display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. - public_signup_page_ids (List[int]): The model property of type - List[int]. - additional_properties (Dict[str, object]): The additional properties - for the model. + public_signup_page_ids (List[int]): The model property of type List[int]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "unit_name": 'unit_name', - "pricing_scheme": 'pricing_scheme', - "overage_pricing": 'overage_pricing', - "description": 'description', - "handle": 'handle', - "taxable": 'taxable', - "prices": 'prices', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "price_points": 'price_points', - "unit_price": 'unit_price', - "tax_code": 'tax_code', - "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "rollover_prepaid_remainder": 'rollover_prepaid_remainder', - "renew_prepaid_allocation": 'renew_prepaid_allocation', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit', - "display_on_hosted_page": 'display_on_hosted_page', - "allow_fractional_quantities": 'allow_fractional_quantities', - "public_signup_page_ids": 'public_signup_page_ids' + "name": "name", + "unit_name": "unit_name", + "pricing_scheme": "pricing_scheme", + "overage_pricing": "overage_pricing", + "description": "description", + "handle": "handle", + "taxable": "taxable", + "prices": "prices", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "price_points": "price_points", + "unit_price": "unit_price", + "tax_code": "tax_code", + "hide_date_range_on_invoice": "hide_date_range_on_invoice", + "rollover_prepaid_remainder": "rollover_prepaid_remainder", + "renew_prepaid_allocation": "renew_prepaid_allocation", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + "display_on_hosted_page": "display_on_hosted_page", + "allow_fractional_quantities": "allow_fractional_quantities", + "public_signup_page_ids": "public_signup_page_ids", } _optionals = [ - 'description', - 'handle', - 'taxable', - 'prices', - 'upgrade_charge', - 'downgrade_credit', - 'price_points', - 'unit_price', - 'tax_code', - 'hide_date_range_on_invoice', - 'rollover_prepaid_remainder', - 'renew_prepaid_allocation', - 'expiration_interval', - 'expiration_interval_unit', - 'display_on_hosted_page', - 'allow_fractional_quantities', - 'public_signup_page_ids', + "description", + "handle", + "taxable", + "prices", + "upgrade_charge", + "downgrade_credit", + "price_points", + "unit_price", + "tax_code", + "hide_date_range_on_invoice", + "rollover_prepaid_remainder", + "renew_prepaid_allocation", + "expiration_interval", + "expiration_interval_unit", + "display_on_hosted_page", + "allow_fractional_quantities", + "public_signup_page_ids", ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', - 'expiration_interval_unit', + "upgrade_charge", + "downgrade_credit", + "expiration_interval_unit", ] - def __init__(self, - name=None, - unit_name=None, - pricing_scheme=None, - overage_pricing=None, - description=APIHelper.SKIP, - handle=APIHelper.SKIP, - taxable=APIHelper.SKIP, - prices=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - price_points=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - hide_date_range_on_invoice=APIHelper.SKIP, - rollover_prepaid_remainder=APIHelper.SKIP, - renew_prepaid_allocation=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - display_on_hosted_page=APIHelper.SKIP, - allow_fractional_quantities=APIHelper.SKIP, - public_signup_page_ids=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PrepaidUsageComponent class""" - + def __init__( + self, + name=None, + unit_name=None, + pricing_scheme=None, + overage_pricing=None, + description=APIHelper.SKIP, + handle=APIHelper.SKIP, + taxable=APIHelper.SKIP, + prices=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + price_points=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + hide_date_range_on_invoice=APIHelper.SKIP, + rollover_prepaid_remainder=APIHelper.SKIP, + renew_prepaid_allocation=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + display_on_hosted_page=APIHelper.SKIP, + allow_fractional_quantities=APIHelper.SKIP, + public_signup_page_ids=APIHelper.SKIP, + additional_properties=None): + """Initialize a PrepaidUsageComponent instance.""" # Initialize members of the class - self.name = name - self.unit_name = unit_name + self.name = name + self.unit_name = unit_name if description is not APIHelper.SKIP: - self.description = description + self.description = description if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if taxable is not APIHelper.SKIP: - self.taxable = taxable - self.pricing_scheme = pricing_scheme + self.taxable = taxable + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if price_points is not APIHelper.SKIP: - self.price_points = price_points + self.price_points = price_points if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if hide_date_range_on_invoice is not APIHelper.SKIP: - self.hide_date_range_on_invoice = hide_date_range_on_invoice - self.overage_pricing = overage_pricing + self.hide_date_range_on_invoice = hide_date_range_on_invoice + self.overage_pricing = overage_pricing if rollover_prepaid_remainder is not APIHelper.SKIP: - self.rollover_prepaid_remainder = rollover_prepaid_remainder + self.rollover_prepaid_remainder = rollover_prepaid_remainder if renew_prepaid_allocation is not APIHelper.SKIP: - self.renew_prepaid_allocation = renew_prepaid_allocation + self.renew_prepaid_allocation = renew_prepaid_allocation if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit if display_on_hosted_page is not APIHelper.SKIP: - self.display_on_hosted_page = display_on_hosted_page + self.display_on_hosted_page = display_on_hosted_page if allow_fractional_quantities is not APIHelper.SKIP: - self.allow_fractional_quantities = allow_fractional_quantities + self.allow_fractional_quantities = allow_fractional_quantities if public_signup_page_ids is not APIHelper.SKIP: - self.public_signup_page_ids = public_signup_page_ids + self.public_signup_page_ids = public_signup_page_ids # Add additional model properties to the instance if additional_properties is None: @@ -209,7 +202,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -220,43 +213,113 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - unit_name = dictionary.get("unit_name") if dictionary.get("unit_name") else None - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None - overage_pricing = OveragePricing.from_dictionary(dictionary.get('overage_pricing')) if dictionary.get('overage_pricing') else None - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + unit_name =\ + dictionary.get("unit_name")\ + if dictionary.get("unit_name")\ + else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None + overage_pricing =\ + OveragePricing.from_dictionary( + dictionary.get("overage_pricing"))\ + if dictionary.get("overage_pricing") else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP price_points = None - if dictionary.get('price_points') is not None: - price_points = [CreatePrepaidUsageComponentPricePoint.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + CreatePrepaidUsageComponentPricePoint.from_dictionary(x) + for x in dictionary.get("price_points") + ] else: price_points = APIHelper.SKIP - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('PrepaidUsageComponentUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP - hide_date_range_on_invoice = dictionary.get("hide_date_range_on_invoice") if "hide_date_range_on_invoice" in dictionary.keys() else APIHelper.SKIP - rollover_prepaid_remainder = dictionary.get("rollover_prepaid_remainder") if "rollover_prepaid_remainder" in dictionary.keys() else APIHelper.SKIP - renew_prepaid_allocation = dictionary.get("renew_prepaid_allocation") if "renew_prepaid_allocation" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if dictionary.get("expiration_interval") else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP - display_on_hosted_page = dictionary.get("display_on_hosted_page") if "display_on_hosted_page" in dictionary.keys() else APIHelper.SKIP - allow_fractional_quantities = dictionary.get("allow_fractional_quantities") if "allow_fractional_quantities" in dictionary.keys() else APIHelper.SKIP - public_signup_page_ids = dictionary.get("public_signup_page_ids") if dictionary.get("public_signup_page_ids") else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PrepaidUsageComponentUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + hide_date_range_on_invoice =\ + dictionary.get("hide_date_range_on_invoice")\ + if "hide_date_range_on_invoice" in dictionary.keys()\ + else APIHelper.SKIP + rollover_prepaid_remainder =\ + dictionary.get("rollover_prepaid_remainder")\ + if "rollover_prepaid_remainder" in dictionary.keys()\ + else APIHelper.SKIP + renew_prepaid_allocation =\ + dictionary.get("renew_prepaid_allocation")\ + if "renew_prepaid_allocation" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if dictionary.get("expiration_interval")\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + display_on_hosted_page =\ + dictionary.get("display_on_hosted_page")\ + if "display_on_hosted_page" in dictionary.keys()\ + else APIHelper.SKIP + allow_fractional_quantities =\ + dictionary.get("allow_fractional_quantities")\ + if "allow_fractional_quantities" in dictionary.keys()\ + else APIHelper.SKIP + public_signup_page_ids =\ + dictionary.get("public_signup_page_ids")\ + if dictionary.get("public_signup_page_ids")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, unit_name, @@ -282,51 +345,239 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'unit_name={self.unit_name!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!r}, ' - f'overage_pricing={self.overage_pricing!r}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!r}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!r}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!r}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _overage_pricing=self.overage_pricing + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"unit_name={_unit_name!r}, " + f"description={_description!r}, " + f"handle={_handle!r}, " + f"taxable={_taxable!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"price_points={_price_points!r}, " + f"unit_price={_unit_price!r}, " + f"tax_code={_tax_code!r}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!r}, " + f"overage_pricing={_overage_pricing!r}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!r}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"display_on_hosted_page={_display_on_hosted_page!r}, " + f"allow_fractional_quantities={_allow_fractional_quantities!r}, " + f"public_signup_page_ids={_public_signup_page_ids!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'unit_name={self.unit_name!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!s}, ' - f'overage_pricing={self.overage_pricing!s}, ' - f'rollover_prepaid_remainder={(self.rollover_prepaid_remainder if hasattr(self, "rollover_prepaid_remainder") else None)!s}, ' - f'renew_prepaid_allocation={(self.renew_prepaid_allocation if hasattr(self, "renew_prepaid_allocation") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!s}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!s}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _overage_pricing=self.overage_pricing + _rollover_prepaid_remainder=( + self.rollover_prepaid_remainder + if hasattr(self, "rollover_prepaid_remainder") + else None + ) + _renew_prepaid_allocation=( + self.renew_prepaid_allocation + if hasattr(self, "renew_prepaid_allocation") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"unit_name={_unit_name!s}, " + f"description={_description!s}, " + f"handle={_handle!s}, " + f"taxable={_taxable!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"price_points={_price_points!s}, " + f"unit_price={_unit_price!s}, " + f"tax_code={_tax_code!s}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!s}, " + f"overage_pricing={_overage_pricing!s}, " + f"rollover_prepaid_remainder={_rollover_prepaid_remainder!s}, " + f"renew_prepaid_allocation={_renew_prepaid_allocation!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"display_on_hosted_page={_display_on_hosted_page!s}, " + f"allow_fractional_quantities={_allow_fractional_quantities!s}, " + f"public_signup_page_ids={_public_signup_page_ids!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepayment.py b/advancedbilling/models/prepayment.py index d5e5df0f..d3961f33 100644 --- a/advancedbilling/models/prepayment.py +++ b/advancedbilling/models/prepayment.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Prepayment(object): - """Implementation of the 'Prepayment' model. Attributes: @@ -24,59 +22,62 @@ class Prepayment(object): memo (str): The model property of type str. payment_type (PrepaymentMethod): The payment type of the prepayment. created_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "subscription_id": 'subscription_id', - "amount_in_cents": 'amount_in_cents', - "remaining_amount_in_cents": 'remaining_amount_in_cents', - "external": 'external', - "memo": 'memo', - "created_at": 'created_at', - "refunded_amount_in_cents": 'refunded_amount_in_cents', - "details": 'details', - "payment_type": 'payment_type' + "id": "id", + "subscription_id": "subscription_id", + "amount_in_cents": "amount_in_cents", + "remaining_amount_in_cents": "remaining_amount_in_cents", + "external": "external", + "memo": "memo", + "created_at": "created_at", + "refunded_amount_in_cents": "refunded_amount_in_cents", + "details": "details", + "payment_type": "payment_type", } _optionals = [ - 'refunded_amount_in_cents', - 'details', - 'payment_type', + "refunded_amount_in_cents", + "details", + "payment_type", ] - def __init__(self, - id=None, - subscription_id=None, - amount_in_cents=None, - remaining_amount_in_cents=None, - external=None, - memo=None, - created_at=None, - refunded_amount_in_cents=APIHelper.SKIP, - details=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Prepayment class""" - + def __init__( + self, + id=None, + subscription_id=None, + amount_in_cents=None, + remaining_amount_in_cents=None, + external=None, + memo=None, + created_at=None, + refunded_amount_in_cents=APIHelper.SKIP, + details=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + additional_properties=None): + """Initialize a Prepayment instance.""" # Initialize members of the class - self.id = id - self.subscription_id = subscription_id - self.amount_in_cents = amount_in_cents - self.remaining_amount_in_cents = remaining_amount_in_cents + self.id = id + self.subscription_id = subscription_id + self.amount_in_cents = amount_in_cents + self.remaining_amount_in_cents = remaining_amount_in_cents if refunded_amount_in_cents is not APIHelper.SKIP: - self.refunded_amount_in_cents = refunded_amount_in_cents + self.refunded_amount_in_cents = refunded_amount_in_cents if details is not APIHelper.SKIP: - self.details = details - self.external = external - self.memo = memo + self.details = details + self.external = external + self.memo = memo if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.payment_type = payment_type + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None # Add additional model properties to the instance if additional_properties is None: @@ -86,7 +87,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -97,23 +98,54 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else None - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else None - remaining_amount_in_cents = dictionary.get("remaining_amount_in_cents") if dictionary.get("remaining_amount_in_cents") else None - external = dictionary.get("external") if "external" in dictionary.keys() else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else None - refunded_amount_in_cents = dictionary.get("refunded_amount_in_cents") if dictionary.get("refunded_amount_in_cents") else APIHelper.SKIP - details = dictionary.get("details") if dictionary.get("details") else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else None + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else None + remaining_amount_in_cents =\ + dictionary.get("remaining_amount_in_cents")\ + if dictionary.get("remaining_amount_in_cents")\ + else None + external =\ + dictionary.get("external")\ + if "external" in dictionary.keys()\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else None + refunded_amount_in_cents =\ + dictionary.get("refunded_amount_in_cents")\ + if dictionary.get("refunded_amount_in_cents")\ + else APIHelper.SKIP + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, subscription_id, @@ -128,29 +160,83 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'subscription_id={self.subscription_id!r}, ' - f'amount_in_cents={self.amount_in_cents!r}, ' - f'remaining_amount_in_cents={self.remaining_amount_in_cents!r}, ' - f'refunded_amount_in_cents={(self.refunded_amount_in_cents if hasattr(self, "refunded_amount_in_cents") else None)!r}, ' - f'details={(self.details if hasattr(self, "details") else None)!r}, ' - f'external={self.external!r}, ' - f'memo={self.memo!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'created_at={self.created_at!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _subscription_id=self.subscription_id + _amount_in_cents=self.amount_in_cents + _remaining_amount_in_cents=self.remaining_amount_in_cents + _refunded_amount_in_cents=( + self.refunded_amount_in_cents + if hasattr(self, "refunded_amount_in_cents") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _external=self.external + _memo=self.memo + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _created_at=self.created_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"remaining_amount_in_cents={_remaining_amount_in_cents!r}, " + f"refunded_amount_in_cents={_refunded_amount_in_cents!r}, " + f"details={_details!r}, " + f"external={_external!r}, " + f"memo={_memo!r}, " + f"payment_type={_payment_type!r}, " + f"created_at={_created_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'subscription_id={self.subscription_id!s}, ' - f'amount_in_cents={self.amount_in_cents!s}, ' - f'remaining_amount_in_cents={self.remaining_amount_in_cents!s}, ' - f'refunded_amount_in_cents={(self.refunded_amount_in_cents if hasattr(self, "refunded_amount_in_cents") else None)!s}, ' - f'details={(self.details if hasattr(self, "details") else None)!s}, ' - f'external={self.external!s}, ' - f'memo={self.memo!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'created_at={self.created_at!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _subscription_id=self.subscription_id + _amount_in_cents=self.amount_in_cents + _remaining_amount_in_cents=self.remaining_amount_in_cents + _refunded_amount_in_cents=( + self.refunded_amount_in_cents + if hasattr(self, "refunded_amount_in_cents") + else None + ) + _details=( + self.details + if hasattr(self, "details") + else None + ) + _external=self.external + _memo=self.memo + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _created_at=self.created_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"remaining_amount_in_cents={_remaining_amount_in_cents!s}, " + f"refunded_amount_in_cents={_refunded_amount_in_cents!s}, " + f"details={_details!s}, " + f"external={_external!s}, " + f"memo={_memo!s}, " + f"payment_type={_payment_type!s}, " + f"created_at={_created_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepayment_account_balance_changed.py b/advancedbilling/models/prepayment_account_balance_changed.py index cc86047e..8ebd6edd 100644 --- a/advancedbilling/models/prepayment_account_balance_changed.py +++ b/advancedbilling/models/prepayment_account_balance_changed.py @@ -1,51 +1,48 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PrepaymentAccountBalanceChanged(object): - """Implementation of the 'Prepayment Account Balance Changed' model. Attributes: reason (str): The model property of type str. - prepayment_account_balance_in_cents (int): The model property of type - int. - prepayment_balance_change_in_cents (int): The model property of type - int. + prepayment_account_balance_in_cents (int): The model property of type int. + prepayment_balance_change_in_cents (int): The model property of type int. currency_code (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reason": 'reason', - "prepayment_account_balance_in_cents": 'prepayment_account_balance_in_cents', - "prepayment_balance_change_in_cents": 'prepayment_balance_change_in_cents', - "currency_code": 'currency_code' + "reason": "reason", + "prepayment_account_balance_in_cents": "prepayment_account_balance_in_cents", + "prepayment_balance_change_in_cents": "prepayment_balance_change_in_cents", + "currency_code": "currency_code", } - def __init__(self, - reason=None, - prepayment_account_balance_in_cents=None, - prepayment_balance_change_in_cents=None, - currency_code=None, - additional_properties=None): - """Constructor for the PrepaymentAccountBalanceChanged class""" - + def __init__( + self, + reason=None, + prepayment_account_balance_in_cents=None, + prepayment_balance_change_in_cents=None, + currency_code=None, + additional_properties=None): + """Initialize a PrepaymentAccountBalanceChanged instance.""" # Initialize members of the class - self.reason = reason - self.prepayment_account_balance_in_cents = prepayment_account_balance_in_cents - self.prepayment_balance_change_in_cents = prepayment_balance_change_in_cents - self.currency_code = currency_code + self.reason = reason + self.prepayment_account_balance_in_cents =\ + prepayment_account_balance_in_cents + self.prepayment_balance_change_in_cents = prepayment_balance_change_in_cents + self.currency_code = currency_code # Add additional model properties to the instance if additional_properties is None: @@ -55,7 +52,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -66,17 +63,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reason = dictionary.get("reason") if dictionary.get("reason") else None - prepayment_account_balance_in_cents = dictionary.get("prepayment_account_balance_in_cents") if dictionary.get("prepayment_account_balance_in_cents") else None - prepayment_balance_change_in_cents = dictionary.get("prepayment_balance_change_in_cents") if dictionary.get("prepayment_balance_change_in_cents") else None - currency_code = dictionary.get("currency_code") if dictionary.get("currency_code") else None + reason =\ + dictionary.get("reason")\ + if dictionary.get("reason")\ + else None + prepayment_account_balance_in_cents =\ + dictionary.get("prepayment_account_balance_in_cents")\ + if dictionary.get("prepayment_account_balance_in_cents")\ + else None + prepayment_balance_change_in_cents =\ + dictionary.get("prepayment_balance_change_in_cents")\ + if dictionary.get("prepayment_balance_change_in_cents")\ + else None + currency_code =\ + dictionary.get("currency_code")\ + if dictionary.get("currency_code")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reason, prepayment_account_balance_in_cents, @@ -86,7 +97,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -97,41 +108,98 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.reason, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.prepayment_account_balance_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.prepayment_balance_change_in_cents, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.currency_code, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.reason, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.prepayment_account_balance_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.prepayment_balance_change_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.currency_code, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('reason'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('prepayment_account_balance_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('prepayment_balance_change_in_cents'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('currency_code'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("reason"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("prepayment_account_balance_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("prepayment_balance_change_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("currency_code"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!r}, ' - f'prepayment_account_balance_in_cents={self.prepayment_account_balance_in_cents!r}, ' - f'prepayment_balance_change_in_cents={self.prepayment_balance_change_in_cents!r}, ' - f'currency_code={self.currency_code!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reason=self.reason + _prepayment_account_balance_in_cents=self.prepayment_account_balance_in_cents + _prepayment_balance_change_in_cents=self.prepayment_balance_change_in_cents + _currency_code=self.currency_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!r}, " + f"prepayment_account_balance_in_cents={_prepayment_account_balance_in_cents!r}, " + f"prepayment_balance_change_in_cents={_prepayment_balance_change_in_cents!r}, " + f"currency_code={_currency_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!s}, ' - f'prepayment_account_balance_in_cents={self.prepayment_account_balance_in_cents!s}, ' - f'prepayment_balance_change_in_cents={self.prepayment_balance_change_in_cents!s}, ' - f'currency_code={self.currency_code!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reason=self.reason + _prepayment_account_balance_in_cents=self.prepayment_account_balance_in_cents + _prepayment_balance_change_in_cents=self.prepayment_balance_change_in_cents + _currency_code=self.currency_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!s}, " + f"prepayment_account_balance_in_cents={_prepayment_account_balance_in_cents!s}, " + f"prepayment_balance_change_in_cents={_prepayment_balance_change_in_cents!s}, " + f"currency_code={_currency_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepayment_method.py b/advancedbilling/models/prepayment_method.py index ea625ac0..49c934c0 100644 --- a/advancedbilling/models/prepayment_method.py +++ b/advancedbilling/models/prepayment_method.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class PrepaymentMethod(object): - """Implementation of the 'Prepayment Method' enum. Attributes: @@ -20,26 +17,28 @@ class PrepaymentMethod(object): PAYPAL_ACCOUNT: The enum member of type str. CREDIT_CARD: The enum member of type str. OTHER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CHECK = 'check' - CASH = 'cash' + CHECK = "check" + + CASH = "cash" - MONEY_ORDER = 'money_order' + MONEY_ORDER = "money_order" - ACH = 'ach' + ACH = "ach" - PAYPAL_ACCOUNT = 'paypal_account' + PAYPAL_ACCOUNT = "paypal_account" - CREDIT_CARD = 'credit_card' + CREDIT_CARD = "credit_card" - OTHER = 'other' + OTHER = "other" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/prepayment_response.py b/advancedbilling/models/prepayment_response.py index 368103f7..215b7f9c 100644 --- a/advancedbilling/models/prepayment_response.py +++ b/advancedbilling/models/prepayment_response.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.prepayment import Prepayment +# ruff: noqa: E501 +from advancedbilling.models.prepayment import ( + Prepayment, +) -class PrepaymentResponse(object): +class PrepaymentResponse(object): """Implementation of the 'Prepayment Response' model. Attributes: prepayment (Prepayment): The model property of type Prepayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayment": 'prepayment' + "prepayment": "prepayment", } - def __init__(self, - prepayment=None, - additional_properties=None): - """Constructor for the PrepaymentResponse class""" - + def __init__( + self, + prepayment=None, + additional_properties=None): + """Initialize a PrepaymentResponse instance.""" # Initialize members of the class - self.prepayment = prepayment + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepayment = Prepayment.from_dictionary(dictionary.get('prepayment')) if dictionary.get('prepayment') else None + prepayment =\ + Prepayment.from_dictionary( + dictionary.get("prepayment"))\ + if dictionary.get("prepayment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/prepayments_response.py b/advancedbilling/models/prepayments_response.py index 667d6f60..62f369fe 100644 --- a/advancedbilling/models/prepayments_response.py +++ b/advancedbilling/models/prepayments_response.py @@ -1,44 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.prepayment import Prepayment +from advancedbilling.models.prepayment import ( + Prepayment, +) class PrepaymentsResponse(object): - """Implementation of the 'Prepayments Response' model. Attributes: - prepayments (List[Prepayment]): The model property of type - List[Prepayment]. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayments (List[Prepayment]): The model property of type List[Prepayment]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayments": 'prepayments' + "prepayments": "prepayments", } _optionals = [ - 'prepayments', + "prepayments", ] - def __init__(self, - prepayments=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PrepaymentsResponse class""" - + def __init__( + self, + prepayments=APIHelper.SKIP, + additional_properties=None): + """Initialize a PrepaymentsResponse instance.""" # Initialize members of the class if prepayments is not APIHelper.SKIP: - self.prepayments = prepayments + self.prepayments = prepayments # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,28 +58,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary prepayments = None - if dictionary.get('prepayments') is not None: - prepayments = [Prepayment.from_dictionary(x) for x in dictionary.get('prepayments')] + if dictionary.get("prepayments") is not None: + prepayments = [ + Prepayment.from_dictionary(x) + for x in dictionary.get("prepayments") + ] else: prepayments = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayments, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayments={(self.prepayments if hasattr(self, "prepayments") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayments=( + self.prepayments + if hasattr(self, "prepayments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayments={_prepayments!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayments={(self.prepayments if hasattr(self, "prepayments") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayments=( + self.prepayments + if hasattr(self, "prepayments") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayments={_prepayments!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/preview_allocations_request.py b/advancedbilling/models/preview_allocations_request.py index 6731b14e..046e93ee 100644 --- a/advancedbilling/models/preview_allocations_request.py +++ b/advancedbilling/models/preview_allocations_request.py @@ -1,75 +1,73 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_allocation import CreateAllocation +from advancedbilling.models.create_allocation import ( + CreateAllocation, +) class PreviewAllocationsRequest(object): - """Implementation of the 'Preview Allocations Request' model. Attributes: allocations (List[CreateAllocation]): The model property of type List[CreateAllocation]. - effective_proration_date (date): To calculate proration amounts for a - future time. Only within a current subscription period. Only - ISO8601 format is supported. + effective_proration_date (date): To calculate proration amounts for a future + time. Only within a current subscription period. Only ISO8601 format is + supported. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - additional_properties (Dict[str, object]): The additional properties - for the model. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "allocations": 'allocations', - "effective_proration_date": 'effective_proration_date', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit' + "allocations": "allocations", + "effective_proration_date": "effective_proration_date", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", } _optionals = [ - 'effective_proration_date', - 'upgrade_charge', - 'downgrade_credit', + "effective_proration_date", + "upgrade_charge", + "downgrade_credit", ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', + "upgrade_charge", + "downgrade_credit", ] - def __init__(self, - allocations=None, - effective_proration_date=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PreviewAllocationsRequest class""" - + def __init__( + self, + allocations=None, + effective_proration_date=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + additional_properties=None): + """Initialize a PreviewAllocationsRequest instance.""" # Initialize members of the class - self.allocations = allocations + self.allocations = allocations if effective_proration_date is not APIHelper.SKIP: - self.effective_proration_date = effective_proration_date + self.effective_proration_date = effective_proration_date if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit # Add additional model properties to the instance if additional_properties is None: @@ -79,7 +77,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -90,19 +88,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary allocations = None - if dictionary.get('allocations') is not None: - allocations = [CreateAllocation.from_dictionary(x) for x in dictionary.get('allocations')] - effective_proration_date = dateutil.parser.parse(dictionary.get('effective_proration_date')).date() if dictionary.get('effective_proration_date') else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP + if dictionary.get("allocations") is not None: + allocations = [ + CreateAllocation.from_dictionary(x) + for x in dictionary.get("allocations") + ] + effective_proration_date = dateutil.parser.parse( + dictionary.get("effective_proration_date")).date()\ + if dictionary.get("effective_proration_date") else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(allocations, effective_proration_date, @@ -111,17 +122,59 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'allocations={self.allocations!r}, ' - f'effective_proration_date={(self.effective_proration_date if hasattr(self, "effective_proration_date") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _allocations=self.allocations + _effective_proration_date=( + self.effective_proration_date + if hasattr(self, "effective_proration_date") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocations={_allocations!r}, " + f"effective_proration_date={_effective_proration_date!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'allocations={self.allocations!s}, ' - f'effective_proration_date={(self.effective_proration_date if hasattr(self, "effective_proration_date") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _allocations=self.allocations + _effective_proration_date=( + self.effective_proration_date + if hasattr(self, "effective_proration_date") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocations={_allocations!s}, " + f"effective_proration_date={_effective_proration_date!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/price.py b/advancedbilling/models/price.py index a80b6a4e..6694770b 100644 --- a/advancedbilling/models/price.py +++ b/advancedbilling/models/price.py @@ -1,56 +1,54 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Price(object): - """Implementation of the 'Price' model. Attributes: starting_quantity (int | str): The model property of type int | str. - ending_quantity (int | str | None): The model property of type int | - str | None. - unit_price (float | str): The price can contain up to 8 decimal - places. i.e. 1.00 or 0.0012 or 0.00000065 - additional_properties (Dict[str, object]): The additional properties - for the model. + ending_quantity (int | str | None): The model property of type int | str | + None. + unit_price (float | str): The price can contain up to 8 decimal places. i.e. + 1.00 or 0.0012 or 0.00000065 + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "starting_quantity": 'starting_quantity', - "unit_price": 'unit_price', - "ending_quantity": 'ending_quantity' + "starting_quantity": "starting_quantity", + "unit_price": "unit_price", + "ending_quantity": "ending_quantity", } _optionals = [ - 'ending_quantity', + "ending_quantity", ] _nullables = [ - 'ending_quantity', + "ending_quantity", ] - def __init__(self, - starting_quantity=None, - unit_price=None, - ending_quantity=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Price class""" - + def __init__( + self, + starting_quantity=None, + unit_price=None, + ending_quantity=APIHelper.SKIP, + additional_properties=None): + """Initialize a Price instance.""" # Initialize members of the class - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity if ending_quantity is not APIHelper.SKIP: - self.ending_quantity = ending_quantity - self.unit_price = unit_price + self.ending_quantity = ending_quantity + self.unit_price = unit_price # Add additional model properties to the instance if additional_properties is None: @@ -60,7 +58,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -71,20 +69,40 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - starting_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('PriceStartingQuantity'), dictionary.get('starting_quantity'), False) if dictionary.get('starting_quantity') is not None else None - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('PriceUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else None - if 'ending_quantity' in dictionary.keys(): - ending_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('PriceEndingQuantity'), dictionary.get('ending_quantity'), False) if dictionary.get('ending_quantity') is not None else None + starting_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PriceStartingQuantity"), + dictionary.get("starting_quantity"), + False)\ + if dictionary.get("starting_quantity") is not None\ + else None + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PriceUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else None + if "ending_quantity" in dictionary.keys(): + ending_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PriceEndingQuantity"), + dictionary.get("ending_quantity"), + False)\ + if dictionary.get("ending_quantity") is not None\ + else None else: ending_quantity = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(starting_quantity, unit_price, @@ -93,7 +111,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -104,28 +122,58 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('PriceStartingQuantity').validate(dictionary.starting_quantity).is_valid \ - and UnionTypeLookUp.get('PriceUnitPrice').validate(dictionary.unit_price).is_valid + return (UnionTypeLookUp.get("PriceStartingQuantity") + .validate(dictionary.starting_quantity).is_valid) \ + and (UnionTypeLookUp.get("PriceUnitPrice") + .validate(dictionary.unit_price).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('PriceStartingQuantity').validate(dictionary.get('starting_quantity')).is_valid \ - and UnionTypeLookUp.get('PriceUnitPrice').validate(dictionary.get('unit_price')).is_valid + return (UnionTypeLookUp.get("PriceStartingQuantity") + .validate(dictionary.get("starting_quantity")).is_valid) \ + and (UnionTypeLookUp.get("PriceUnitPrice") + .validate(dictionary.get("unit_price")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'starting_quantity={self.starting_quantity!r}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!r}, ' - f'unit_price={self.unit_price!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _starting_quantity=self.starting_quantity + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=self.unit_price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starting_quantity={_starting_quantity!r}, " + f"ending_quantity={_ending_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'starting_quantity={self.starting_quantity!s}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!s}, ' - f'unit_price={self.unit_price!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _starting_quantity=self.starting_quantity + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=self.unit_price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starting_quantity={_starting_quantity!s}, " + f"ending_quantity={_ending_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/price_point_type.py b/advancedbilling/models/price_point_type.py index 1638edbc..f31b3f23 100644 --- a/advancedbilling/models/price_point_type.py +++ b/advancedbilling/models/price_point_type.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class PricePointType(object): - """Implementation of the 'Price Point Type' enum. Price point type. We expose the following types: - 1. **default**: a price point that is marked as a default price for a - certain product. + 1. **default**: a price point that is marked as a default price for a certain + product. 2. **custom**: a custom price point. - 3. **catalog**: a price point that is **not** marked as a default price - for a certain product and is **not** a custom one. + 3. **catalog**: a price point that is **not** marked as a default price for a + certain product and is **not** a custom one. Attributes: CATALOG: The enum member of type str. DEFAULT: The enum member of type str. CUSTOM: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['catalog', 'default', 'custom'] - CATALOG = 'catalog' - DEFAULT = 'default' + _all_values = ["catalog", "default", "custom"] + CATALOG = "catalog" - CUSTOM = 'custom' + DEFAULT = "default" + + CUSTOM = "custom" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -46,9 +44,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/pricing_scheme.py b/advancedbilling/models/pricing_scheme.py index 5add8653..e6783cd3 100644 --- a/advancedbilling/models/pricing_scheme.py +++ b/advancedbilling/models/pricing_scheme.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class PricingScheme(object): - """Implementation of the 'Pricing Scheme' enum. The identifier for the pricing scheme. See [Product - Components](https://help.chargify.com/products/product-components.html) - for an overview of pricing schemes. + Components](https://help.chargify.com/products/product-components.html) for an + overview of pricing schemes. Attributes: STAIRSTEP: The enum member of type str. VOLUME: The enum member of type str. PER_UNIT: The enum member of type str. TIERED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['stairstep', 'volume', 'per_unit', 'tiered'] - STAIRSTEP = 'stairstep' - VOLUME = 'volume' + _all_values = ["stairstep", "volume", "per_unit", "tiered"] + STAIRSTEP = "stairstep" - PER_UNIT = 'per_unit' + VOLUME = "volume" - TIERED = 'tiered' + PER_UNIT = "per_unit" + + TIERED = "tiered" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -46,9 +44,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/product.py b/advancedbilling/models/product.py index 948f5875..cf71f93c 100644 --- a/advancedbilling/models/product.py +++ b/advancedbilling/models/product.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.product_family import ProductFamily -from advancedbilling.models.public_signup_page import PublicSignupPage +from advancedbilling.models.product_family import ( + ProductFamily, +) +from advancedbilling.models.public_signup_page import ( + PublicSignupPage, +) class Product(object): - """Implementation of the 'Product' model. Attributes: @@ -21,296 +23,297 @@ class Product(object): handle (str): The product API handle description (str): The product description accounting_code (str): E.g. Internal ID or SKU Number - request_credit_card (bool): Deprecated value that can be ignored - unless you have legacy hosted pages. For Public Signup Page users, - read this attribute from under the signup page. - expiration_interval (int): A numerical interval for the length a - subscription to this product will run before it expires. See the - description of interval for a description of how this value is - coupled with an interval unit to calculate the full interval - expiration_interval_unit (ExpirationIntervalUnit): A string - representing the expiration interval unit for this product, either - month, day or never - created_at (datetime): Timestamp indicating when this product was - created - updated_at (datetime): Timestamp indicating when this product was last - updated + request_credit_card (bool): Deprecated value that can be ignored unless you + have legacy hosted pages. For Public Signup Page users, read this + attribute from under the signup page. + expiration_interval (int): A numerical interval for the length a subscription + to this product will run before it expires. See the description of + interval for a description of how this value is coupled with an interval + unit to calculate the full interval + expiration_interval_unit (ExpirationIntervalUnit): A string representing the + expiration interval unit for this product, either month, day or never + created_at (datetime): Timestamp indicating when this product was created + updated_at (datetime): Timestamp indicating when this product was last updated price_in_cents (int): The product price, in integer cents - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this product would - renew every 30 days - interval_unit (IntervalUnit): A string representing the interval unit - for this product, either month or day + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this product would renew every 30 days + interval_unit (IntervalUnit): A string representing the interval unit for + this product, either month or day initial_charge_in_cents (int): The up front charge you have specified. - trial_price_in_cents (int): The price of the trial period for a - subscription to this product, in integer cents. - trial_interval (int): A numerical interval for the length of the trial - period of a subscription to this product. See the description of - interval for a description of how this value is coupled with an - interval unit to calculate the full interval - trial_interval_unit (IntervalUnit): A string representing the trial - interval unit for this product, either month or day - archived_at (datetime): Timestamp indicating when this product was - archived - require_credit_card (bool): Boolean that controls whether a payment - profile is required to be entered for customers wishing to sign up - on this product. + trial_price_in_cents (int): The price of the trial period for a subscription + to this product, in integer cents. + trial_interval (int): A numerical interval for the length of the trial period + of a subscription to this product. See the description of interval for a + description of how this value is coupled with an interval unit to + calculate the full interval + trial_interval_unit (IntervalUnit): A string representing the trial interval + unit for this product, either month or day + archived_at (datetime): Timestamp indicating when this product was archived + require_credit_card (bool): Boolean that controls whether a payment profile + is required to be entered for customers wishing to sign up on this + product. return_params (str): The model property of type str. taxable (bool): The model property of type bool. - update_return_url (str): The url to which a customer will be returned - after a successful account update + update_return_url (str): The url to which a customer will be returned after a + successful account update initial_charge_after_trial (bool): The model property of type bool. version_number (int): The version of the product - update_return_params (str): The parameters will append to the url - after a successful account update. See [help - documentation](https://help.chargify.com/products/product-editing.h - tml#return-parameters-after-account-update) - product_family (ProductFamily): The model property of type - ProductFamily. - public_signup_pages (List[PublicSignupPage]): The model property of - type List[PublicSignupPage]. + update_return_params (str): The parameters will append to the url after a + successful account update. See [help + documentation](https://help.chargify.com/products/product-editing.html#ret + urn-parameters-after-account-update) + product_family (ProductFamily): The model property of type ProductFamily. + public_signup_pages (List[PublicSignupPage]): The model property of type + List[PublicSignupPage]. product_price_point_name (str): The model property of type str. - request_billing_address (bool): A boolean indicating whether to - request a billing address on any Self-Service Pages that are used - by subscribers of this product. + request_billing_address (bool): A boolean indicating whether to request a + billing address on any Self-Service Pages that are used by subscribers of + this product. require_billing_address (bool): A boolean indicating whether a billing address is required to add a payment profile, especially at signup. - require_shipping_address (bool): A boolean indicating whether a - shipping address is required for the customer, especially at - signup. - tax_code (str): A string representing the tax code related to the - product type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. + require_shipping_address (bool): A boolean indicating whether a shipping + address is required for the customer, especially at signup. + tax_code (str): A string representing the tax code related to the product + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. default_product_price_point_id (int): The model property of type int. use_site_exchange_rate (bool): The model property of type bool. item_category (str): One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other product_price_point_id (int): The model property of type int. product_price_point_handle (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "handle": 'handle', - "description": 'description', - "accounting_code": 'accounting_code', - "request_credit_card": 'request_credit_card', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit', - "created_at": 'created_at', - "updated_at": 'updated_at', - "price_in_cents": 'price_in_cents', - "interval": 'interval', - "interval_unit": 'interval_unit', - "initial_charge_in_cents": 'initial_charge_in_cents', - "trial_price_in_cents": 'trial_price_in_cents', - "trial_interval": 'trial_interval', - "trial_interval_unit": 'trial_interval_unit', - "archived_at": 'archived_at', - "require_credit_card": 'require_credit_card', - "return_params": 'return_params', - "taxable": 'taxable', - "update_return_url": 'update_return_url', - "initial_charge_after_trial": 'initial_charge_after_trial', - "version_number": 'version_number', - "update_return_params": 'update_return_params', - "product_family": 'product_family', - "public_signup_pages": 'public_signup_pages', - "product_price_point_name": 'product_price_point_name', - "request_billing_address": 'request_billing_address', - "require_billing_address": 'require_billing_address', - "require_shipping_address": 'require_shipping_address', - "tax_code": 'tax_code', - "default_product_price_point_id": 'default_product_price_point_id', - "use_site_exchange_rate": 'use_site_exchange_rate', - "item_category": 'item_category', - "product_price_point_id": 'product_price_point_id', - "product_price_point_handle": 'product_price_point_handle' + "id": "id", + "name": "name", + "handle": "handle", + "description": "description", + "accounting_code": "accounting_code", + "request_credit_card": "request_credit_card", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + "created_at": "created_at", + "updated_at": "updated_at", + "price_in_cents": "price_in_cents", + "interval": "interval", + "interval_unit": "interval_unit", + "initial_charge_in_cents": "initial_charge_in_cents", + "trial_price_in_cents": "trial_price_in_cents", + "trial_interval": "trial_interval", + "trial_interval_unit": "trial_interval_unit", + "archived_at": "archived_at", + "require_credit_card": "require_credit_card", + "return_params": "return_params", + "taxable": "taxable", + "update_return_url": "update_return_url", + "initial_charge_after_trial": "initial_charge_after_trial", + "version_number": "version_number", + "update_return_params": "update_return_params", + "product_family": "product_family", + "public_signup_pages": "public_signup_pages", + "product_price_point_name": "product_price_point_name", + "request_billing_address": "request_billing_address", + "require_billing_address": "require_billing_address", + "require_shipping_address": "require_shipping_address", + "tax_code": "tax_code", + "default_product_price_point_id": "default_product_price_point_id", + "use_site_exchange_rate": "use_site_exchange_rate", + "item_category": "item_category", + "product_price_point_id": "product_price_point_id", + "product_price_point_handle": "product_price_point_handle", } _optionals = [ - 'id', - 'name', - 'handle', - 'description', - 'accounting_code', - 'request_credit_card', - 'expiration_interval', - 'expiration_interval_unit', - 'created_at', - 'updated_at', - 'price_in_cents', - 'interval', - 'interval_unit', - 'initial_charge_in_cents', - 'trial_price_in_cents', - 'trial_interval', - 'trial_interval_unit', - 'archived_at', - 'require_credit_card', - 'return_params', - 'taxable', - 'update_return_url', - 'initial_charge_after_trial', - 'version_number', - 'update_return_params', - 'product_family', - 'public_signup_pages', - 'product_price_point_name', - 'request_billing_address', - 'require_billing_address', - 'require_shipping_address', - 'tax_code', - 'default_product_price_point_id', - 'use_site_exchange_rate', - 'item_category', - 'product_price_point_id', - 'product_price_point_handle', + "id", + "name", + "handle", + "description", + "accounting_code", + "request_credit_card", + "expiration_interval", + "expiration_interval_unit", + "created_at", + "updated_at", + "price_in_cents", + "interval", + "interval_unit", + "initial_charge_in_cents", + "trial_price_in_cents", + "trial_interval", + "trial_interval_unit", + "archived_at", + "require_credit_card", + "return_params", + "taxable", + "update_return_url", + "initial_charge_after_trial", + "version_number", + "update_return_params", + "product_family", + "public_signup_pages", + "product_price_point_name", + "request_billing_address", + "require_billing_address", + "require_shipping_address", + "tax_code", + "default_product_price_point_id", + "use_site_exchange_rate", + "item_category", + "product_price_point_id", + "product_price_point_handle", ] _nullables = [ - 'handle', - 'description', - 'accounting_code', - 'expiration_interval', - 'expiration_interval_unit', - 'initial_charge_in_cents', - 'trial_price_in_cents', - 'trial_interval', - 'trial_interval_unit', - 'archived_at', - 'return_params', - 'update_return_url', - 'initial_charge_after_trial', - 'update_return_params', - 'tax_code', - 'use_site_exchange_rate', - 'item_category', - 'product_price_point_handle', + "handle", + "description", + "accounting_code", + "expiration_interval", + "expiration_interval_unit", + "initial_charge_in_cents", + "trial_price_in_cents", + "trial_interval", + "trial_interval_unit", + "archived_at", + "return_params", + "update_return_url", + "initial_charge_after_trial", + "update_return_params", + "tax_code", + "use_site_exchange_rate", + "item_category", + "product_price_point_handle", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - description=APIHelper.SKIP, - accounting_code=APIHelper.SKIP, - request_credit_card=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - price_in_cents=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - initial_charge_in_cents=APIHelper.SKIP, - trial_price_in_cents=APIHelper.SKIP, - trial_interval=APIHelper.SKIP, - trial_interval_unit=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - require_credit_card=APIHelper.SKIP, - return_params=APIHelper.SKIP, - taxable=APIHelper.SKIP, - update_return_url=APIHelper.SKIP, - initial_charge_after_trial=APIHelper.SKIP, - version_number=APIHelper.SKIP, - update_return_params=APIHelper.SKIP, - product_family=APIHelper.SKIP, - public_signup_pages=APIHelper.SKIP, - product_price_point_name=APIHelper.SKIP, - request_billing_address=APIHelper.SKIP, - require_billing_address=APIHelper.SKIP, - require_shipping_address=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - default_product_price_point_id=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - item_category=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - product_price_point_handle=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Product class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + description=APIHelper.SKIP, + accounting_code=APIHelper.SKIP, + request_credit_card=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + price_in_cents=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + initial_charge_in_cents=APIHelper.SKIP, + trial_price_in_cents=APIHelper.SKIP, + trial_interval=APIHelper.SKIP, + trial_interval_unit=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + require_credit_card=APIHelper.SKIP, + return_params=APIHelper.SKIP, + taxable=APIHelper.SKIP, + update_return_url=APIHelper.SKIP, + initial_charge_after_trial=APIHelper.SKIP, + version_number=APIHelper.SKIP, + update_return_params=APIHelper.SKIP, + product_family=APIHelper.SKIP, + public_signup_pages=APIHelper.SKIP, + product_price_point_name=APIHelper.SKIP, + request_billing_address=APIHelper.SKIP, + require_billing_address=APIHelper.SKIP, + require_shipping_address=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + default_product_price_point_id=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + item_category=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + product_price_point_handle=APIHelper.SKIP, + additional_properties=None): + """Initialize a Product instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if description is not APIHelper.SKIP: - self.description = description + self.description = description if accounting_code is not APIHelper.SKIP: - self.accounting_code = accounting_code + self.accounting_code = accounting_code if request_credit_card is not APIHelper.SKIP: - self.request_credit_card = request_credit_card + self.request_credit_card = request_credit_card if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents + self.price_in_cents = price_in_cents if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if initial_charge_in_cents is not APIHelper.SKIP: - self.initial_charge_in_cents = initial_charge_in_cents + self.initial_charge_in_cents = initial_charge_in_cents if trial_price_in_cents is not APIHelper.SKIP: - self.trial_price_in_cents = trial_price_in_cents + self.trial_price_in_cents = trial_price_in_cents if trial_interval is not APIHelper.SKIP: - self.trial_interval = trial_interval + self.trial_interval = trial_interval if trial_interval_unit is not APIHelper.SKIP: - self.trial_interval_unit = trial_interval_unit + self.trial_interval_unit = trial_interval_unit if archived_at is not APIHelper.SKIP: - self.archived_at = APIHelper.apply_datetime_converter(archived_at, APIHelper.RFC3339DateTime) if archived_at else None + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None if require_credit_card is not APIHelper.SKIP: - self.require_credit_card = require_credit_card + self.require_credit_card = require_credit_card if return_params is not APIHelper.SKIP: - self.return_params = return_params + self.return_params = return_params if taxable is not APIHelper.SKIP: - self.taxable = taxable + self.taxable = taxable if update_return_url is not APIHelper.SKIP: - self.update_return_url = update_return_url + self.update_return_url = update_return_url if initial_charge_after_trial is not APIHelper.SKIP: - self.initial_charge_after_trial = initial_charge_after_trial + self.initial_charge_after_trial = initial_charge_after_trial if version_number is not APIHelper.SKIP: - self.version_number = version_number + self.version_number = version_number if update_return_params is not APIHelper.SKIP: - self.update_return_params = update_return_params + self.update_return_params = update_return_params if product_family is not APIHelper.SKIP: - self.product_family = product_family + self.product_family = product_family if public_signup_pages is not APIHelper.SKIP: - self.public_signup_pages = public_signup_pages + self.public_signup_pages = public_signup_pages if product_price_point_name is not APIHelper.SKIP: - self.product_price_point_name = product_price_point_name + self.product_price_point_name = product_price_point_name if request_billing_address is not APIHelper.SKIP: - self.request_billing_address = request_billing_address + self.request_billing_address = request_billing_address if require_billing_address is not APIHelper.SKIP: - self.require_billing_address = require_billing_address + self.require_billing_address = require_billing_address if require_shipping_address is not APIHelper.SKIP: - self.require_shipping_address = require_shipping_address + self.require_shipping_address = require_shipping_address if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if default_product_price_point_id is not APIHelper.SKIP: - self.default_product_price_point_id = default_product_price_point_id + self.default_product_price_point_id = default_product_price_point_id if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if item_category is not APIHelper.SKIP: - self.item_category = item_category + self.item_category = item_category if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if product_price_point_handle is not APIHelper.SKIP: - self.product_price_point_handle = product_price_point_handle + self.product_price_point_handle = product_price_point_handle # Add additional model properties to the instance if additional_properties is None: @@ -320,7 +323,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -331,57 +334,169 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if "handle" in dictionary.keys() else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - accounting_code = dictionary.get("accounting_code") if "accounting_code" in dictionary.keys() else APIHelper.SKIP - request_credit_card = dictionary.get("request_credit_card") if "request_credit_card" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if "expiration_interval" in dictionary.keys() else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else APIHelper.SKIP - initial_charge_in_cents = dictionary.get("initial_charge_in_cents") if "initial_charge_in_cents" in dictionary.keys() else APIHelper.SKIP - trial_price_in_cents = dictionary.get("trial_price_in_cents") if "trial_price_in_cents" in dictionary.keys() else APIHelper.SKIP - trial_interval = dictionary.get("trial_interval") if "trial_interval" in dictionary.keys() else APIHelper.SKIP - trial_interval_unit = dictionary.get("trial_interval_unit") if "trial_interval_unit" in dictionary.keys() else APIHelper.SKIP - if 'archived_at' in dictionary.keys(): - archived_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("archived_at")).datetime if dictionary.get("archived_at") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if "handle" in dictionary.keys()\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + accounting_code =\ + dictionary.get("accounting_code")\ + if "accounting_code" in dictionary.keys()\ + else APIHelper.SKIP + request_credit_card =\ + dictionary.get("request_credit_card")\ + if "request_credit_card" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if "expiration_interval" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + price_in_cents =\ + dictionary.get("price_in_cents")\ + if dictionary.get("price_in_cents")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if dictionary.get("interval_unit")\ + else APIHelper.SKIP + initial_charge_in_cents =\ + dictionary.get("initial_charge_in_cents")\ + if "initial_charge_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + trial_price_in_cents =\ + dictionary.get("trial_price_in_cents")\ + if "trial_price_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + trial_interval =\ + dictionary.get("trial_interval")\ + if "trial_interval" in dictionary.keys()\ + else APIHelper.SKIP + trial_interval_unit =\ + dictionary.get("trial_interval_unit")\ + if "trial_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + else: archived_at = APIHelper.SKIP - require_credit_card = dictionary.get("require_credit_card") if "require_credit_card" in dictionary.keys() else APIHelper.SKIP - return_params = dictionary.get("return_params") if "return_params" in dictionary.keys() else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP - update_return_url = dictionary.get("update_return_url") if "update_return_url" in dictionary.keys() else APIHelper.SKIP - initial_charge_after_trial = dictionary.get("initial_charge_after_trial") if "initial_charge_after_trial" in dictionary.keys() else APIHelper.SKIP - version_number = dictionary.get("version_number") if dictionary.get("version_number") else APIHelper.SKIP - update_return_params = dictionary.get("update_return_params") if "update_return_params" in dictionary.keys() else APIHelper.SKIP - product_family = ProductFamily.from_dictionary(dictionary.get('product_family')) if 'product_family' in dictionary.keys() else APIHelper.SKIP + require_credit_card =\ + dictionary.get("require_credit_card")\ + if "require_credit_card" in dictionary.keys()\ + else APIHelper.SKIP + return_params =\ + dictionary.get("return_params")\ + if "return_params" in dictionary.keys()\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP + update_return_url =\ + dictionary.get("update_return_url")\ + if "update_return_url" in dictionary.keys()\ + else APIHelper.SKIP + initial_charge_after_trial =\ + dictionary.get("initial_charge_after_trial")\ + if "initial_charge_after_trial" in dictionary.keys()\ + else APIHelper.SKIP + version_number =\ + dictionary.get("version_number")\ + if dictionary.get("version_number")\ + else APIHelper.SKIP + update_return_params =\ + dictionary.get("update_return_params")\ + if "update_return_params" in dictionary.keys()\ + else APIHelper.SKIP + product_family =\ + ProductFamily.from_dictionary( + dictionary.get("product_family"))\ + if "product_family" in dictionary.keys()\ + else APIHelper.SKIP public_signup_pages = None - if dictionary.get('public_signup_pages') is not None: - public_signup_pages = [PublicSignupPage.from_dictionary(x) for x in dictionary.get('public_signup_pages')] + if dictionary.get("public_signup_pages") is not None: + public_signup_pages = [ + PublicSignupPage.from_dictionary(x) + for x in dictionary.get("public_signup_pages") + ] else: public_signup_pages = APIHelper.SKIP - product_price_point_name = dictionary.get("product_price_point_name") if dictionary.get("product_price_point_name") else APIHelper.SKIP - request_billing_address = dictionary.get("request_billing_address") if "request_billing_address" in dictionary.keys() else APIHelper.SKIP - require_billing_address = dictionary.get("require_billing_address") if "require_billing_address" in dictionary.keys() else APIHelper.SKIP - require_shipping_address = dictionary.get("require_shipping_address") if "require_shipping_address" in dictionary.keys() else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if "tax_code" in dictionary.keys() else APIHelper.SKIP - default_product_price_point_id = dictionary.get("default_product_price_point_id") if dictionary.get("default_product_price_point_id") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - item_category = dictionary.get("item_category") if "item_category" in dictionary.keys() else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - product_price_point_handle = dictionary.get("product_price_point_handle") if "product_price_point_handle" in dictionary.keys() else APIHelper.SKIP + product_price_point_name =\ + dictionary.get("product_price_point_name")\ + if dictionary.get("product_price_point_name")\ + else APIHelper.SKIP + request_billing_address =\ + dictionary.get("request_billing_address")\ + if "request_billing_address" in dictionary.keys()\ + else APIHelper.SKIP + require_billing_address =\ + dictionary.get("require_billing_address")\ + if "require_billing_address" in dictionary.keys()\ + else APIHelper.SKIP + require_shipping_address =\ + dictionary.get("require_shipping_address")\ + if "require_shipping_address" in dictionary.keys()\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if "tax_code" in dictionary.keys()\ + else APIHelper.SKIP + default_product_price_point_id =\ + dictionary.get("default_product_price_point_id")\ + if dictionary.get("default_product_price_point_id")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + item_category =\ + dictionary.get("item_category")\ + if "item_category" in dictionary.keys()\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + product_price_point_handle =\ + dictionary.get("product_price_point_handle")\ + if "product_price_point_handle" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -424,7 +539,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -435,7 +550,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -445,83 +559,463 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!r}, ' - f'request_credit_card={(self.request_credit_card if hasattr(self, "request_credit_card") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!r}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!r}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!r}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'require_credit_card={(self.require_credit_card if hasattr(self, "require_credit_card") else None)!r}, ' - f'return_params={(self.return_params if hasattr(self, "return_params") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'update_return_url={(self.update_return_url if hasattr(self, "update_return_url") else None)!r}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!r}, ' - f'version_number={(self.version_number if hasattr(self, "version_number") else None)!r}, ' - f'update_return_params={(self.update_return_params if hasattr(self, "update_return_params") else None)!r}, ' - f'product_family={(self.product_family if hasattr(self, "product_family") else None)!r}, ' - f'public_signup_pages={(self.public_signup_pages if hasattr(self, "public_signup_pages") else None)!r}, ' - f'product_price_point_name={(self.product_price_point_name if hasattr(self, "product_price_point_name") else None)!r}, ' - f'request_billing_address={(self.request_billing_address if hasattr(self, "request_billing_address") else None)!r}, ' - f'require_billing_address={(self.require_billing_address if hasattr(self, "require_billing_address") else None)!r}, ' - f'require_shipping_address={(self.require_shipping_address if hasattr(self, "require_shipping_address") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'default_product_price_point_id={(self.default_product_price_point_id if hasattr(self, "default_product_price_point_id") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'item_category={(self.item_category if hasattr(self, "item_category") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _request_credit_card=( + self.request_credit_card + if hasattr(self, "request_credit_card") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _require_credit_card=( + self.require_credit_card + if hasattr(self, "require_credit_card") + else None + ) + _return_params=( + self.return_params + if hasattr(self, "return_params") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _update_return_url=( + self.update_return_url + if hasattr(self, "update_return_url") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _version_number=( + self.version_number + if hasattr(self, "version_number") + else None + ) + _update_return_params=( + self.update_return_params + if hasattr(self, "update_return_params") + else None + ) + _product_family=( + self.product_family + if hasattr(self, "product_family") + else None + ) + _public_signup_pages=( + self.public_signup_pages + if hasattr(self, "public_signup_pages") + else None + ) + _product_price_point_name=( + self.product_price_point_name + if hasattr(self, "product_price_point_name") + else None + ) + _request_billing_address=( + self.request_billing_address + if hasattr(self, "request_billing_address") + else None + ) + _require_billing_address=( + self.require_billing_address + if hasattr(self, "require_billing_address") + else None + ) + _require_shipping_address=( + self.require_shipping_address + if hasattr(self, "require_shipping_address") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _default_product_price_point_id=( + self.default_product_price_point_id + if hasattr(self, "default_product_price_point_id") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _item_category=( + self.item_category + if hasattr(self, "item_category") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"handle={_handle!r}, " + f"description={_description!r}, " + f"accounting_code={_accounting_code!r}, " + f"request_credit_card={_request_credit_card!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"initial_charge_in_cents={_initial_charge_in_cents!r}, " + f"trial_price_in_cents={_trial_price_in_cents!r}, " + f"trial_interval={_trial_interval!r}, " + f"trial_interval_unit={_trial_interval_unit!r}, " + f"archived_at={_archived_at!r}, " + f"require_credit_card={_require_credit_card!r}, " + f"return_params={_return_params!r}, " + f"taxable={_taxable!r}, " + f"update_return_url={_update_return_url!r}, " + f"initial_charge_after_trial={_initial_charge_after_trial!r}, " + f"version_number={_version_number!r}, " + f"update_return_params={_update_return_params!r}, " + f"product_family={_product_family!r}, " + f"public_signup_pages={_public_signup_pages!r}, " + f"product_price_point_name={_product_price_point_name!r}, " + f"request_billing_address={_request_billing_address!r}, " + f"require_billing_address={_require_billing_address!r}, " + f"require_shipping_address={_require_shipping_address!r}, " + f"tax_code={_tax_code!r}, " + f"default_product_price_point_id={_default_product_price_point_id!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"item_category={_item_category!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"product_price_point_handle={_product_price_point_handle!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!s}, ' - f'request_credit_card={(self.request_credit_card if hasattr(self, "request_credit_card") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!s}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!s}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!s}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'require_credit_card={(self.require_credit_card if hasattr(self, "require_credit_card") else None)!s}, ' - f'return_params={(self.return_params if hasattr(self, "return_params") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'update_return_url={(self.update_return_url if hasattr(self, "update_return_url") else None)!s}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!s}, ' - f'version_number={(self.version_number if hasattr(self, "version_number") else None)!s}, ' - f'update_return_params={(self.update_return_params if hasattr(self, "update_return_params") else None)!s}, ' - f'product_family={(self.product_family if hasattr(self, "product_family") else None)!s}, ' - f'public_signup_pages={(self.public_signup_pages if hasattr(self, "public_signup_pages") else None)!s}, ' - f'product_price_point_name={(self.product_price_point_name if hasattr(self, "product_price_point_name") else None)!s}, ' - f'request_billing_address={(self.request_billing_address if hasattr(self, "request_billing_address") else None)!s}, ' - f'require_billing_address={(self.require_billing_address if hasattr(self, "require_billing_address") else None)!s}, ' - f'require_shipping_address={(self.require_shipping_address if hasattr(self, "require_shipping_address") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'default_product_price_point_id={(self.default_product_price_point_id if hasattr(self, "default_product_price_point_id") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'item_category={(self.item_category if hasattr(self, "item_category") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _request_credit_card=( + self.request_credit_card + if hasattr(self, "request_credit_card") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _require_credit_card=( + self.require_credit_card + if hasattr(self, "require_credit_card") + else None + ) + _return_params=( + self.return_params + if hasattr(self, "return_params") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _update_return_url=( + self.update_return_url + if hasattr(self, "update_return_url") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _version_number=( + self.version_number + if hasattr(self, "version_number") + else None + ) + _update_return_params=( + self.update_return_params + if hasattr(self, "update_return_params") + else None + ) + _product_family=( + self.product_family + if hasattr(self, "product_family") + else None + ) + _public_signup_pages=( + self.public_signup_pages + if hasattr(self, "public_signup_pages") + else None + ) + _product_price_point_name=( + self.product_price_point_name + if hasattr(self, "product_price_point_name") + else None + ) + _request_billing_address=( + self.request_billing_address + if hasattr(self, "request_billing_address") + else None + ) + _require_billing_address=( + self.require_billing_address + if hasattr(self, "require_billing_address") + else None + ) + _require_shipping_address=( + self.require_shipping_address + if hasattr(self, "require_shipping_address") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _default_product_price_point_id=( + self.default_product_price_point_id + if hasattr(self, "default_product_price_point_id") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _item_category=( + self.item_category + if hasattr(self, "item_category") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"handle={_handle!s}, " + f"description={_description!s}, " + f"accounting_code={_accounting_code!s}, " + f"request_credit_card={_request_credit_card!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"initial_charge_in_cents={_initial_charge_in_cents!s}, " + f"trial_price_in_cents={_trial_price_in_cents!s}, " + f"trial_interval={_trial_interval!s}, " + f"trial_interval_unit={_trial_interval_unit!s}, " + f"archived_at={_archived_at!s}, " + f"require_credit_card={_require_credit_card!s}, " + f"return_params={_return_params!s}, " + f"taxable={_taxable!s}, " + f"update_return_url={_update_return_url!s}, " + f"initial_charge_after_trial={_initial_charge_after_trial!s}, " + f"version_number={_version_number!s}, " + f"update_return_params={_update_return_params!s}, " + f"product_family={_product_family!s}, " + f"public_signup_pages={_public_signup_pages!s}, " + f"product_price_point_name={_product_price_point_name!s}, " + f"request_billing_address={_request_billing_address!s}, " + f"require_billing_address={_require_billing_address!s}, " + f"require_shipping_address={_require_shipping_address!s}, " + f"tax_code={_tax_code!s}, " + f"default_product_price_point_id={_default_product_price_point_id!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"item_category={_item_category!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"product_price_point_handle={_product_price_point_handle!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/product_family.py b/advancedbilling/models/product_family.py index 523041ea..566423f9 100644 --- a/advancedbilling/models/product_family.py +++ b/advancedbilling/models/product_family.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ProductFamily(object): - """Implementation of the 'Product Family' model. Attributes: @@ -21,63 +19,80 @@ class ProductFamily(object): description (str): The model property of type str. created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + archived_at (datetime): Timestamp indicating when this product family was + archived. `null` if the product family is not archived. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "handle": 'handle', - "accounting_code": 'accounting_code', - "description": 'description', - "created_at": 'created_at', - "updated_at": 'updated_at' + "id": "id", + "name": "name", + "handle": "handle", + "accounting_code": "accounting_code", + "description": "description", + "created_at": "created_at", + "updated_at": "updated_at", + "archived_at": "archived_at", } _optionals = [ - 'id', - 'name', - 'handle', - 'accounting_code', - 'description', - 'created_at', - 'updated_at', + "id", + "name", + "handle", + "accounting_code", + "description", + "created_at", + "updated_at", + "archived_at", ] _nullables = [ - 'accounting_code', - 'description', + "accounting_code", + "description", + "archived_at", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - accounting_code=APIHelper.SKIP, - description=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProductFamily class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + accounting_code=APIHelper.SKIP, + description=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProductFamily instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if accounting_code is not APIHelper.SKIP: - self.accounting_code = accounting_code + self.accounting_code = accounting_code if description is not APIHelper.SKIP: - self.description = description + self.description = description if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None + if archived_at is not APIHelper.SKIP: + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None # Add additional model properties to the instance if additional_properties is None: @@ -87,7 +102,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -98,20 +113,48 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - accounting_code = dictionary.get("accounting_code") if "accounting_code" in dictionary.keys() else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + accounting_code =\ + dictionary.get("accounting_code")\ + if "accounting_code" in dictionary.keys()\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + + else: + archived_at = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -120,11 +163,12 @@ def from_dictionary(cls, description, created_at, updated_at, + archived_at, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -135,7 +179,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -145,23 +188,115 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"handle={_handle!r}, " + f"accounting_code={_accounting_code!r}, " + f"description={_description!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"archived_at={_archived_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"handle={_handle!s}, " + f"accounting_code={_accounting_code!s}, " + f"description={_description!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"archived_at={_archived_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/product_family_response.py b/advancedbilling/models/product_family_response.py index e3ccbc62..778e60c3 100644 --- a/advancedbilling/models/product_family_response.py +++ b/advancedbilling/models/product_family_response.py @@ -1,44 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.product_family import ProductFamily +from advancedbilling.models.product_family import ( + ProductFamily, +) class ProductFamilyResponse(object): - """Implementation of the 'Product Family Response' model. Attributes: - product_family (ProductFamily): The model property of type - ProductFamily. - additional_properties (Dict[str, object]): The additional properties - for the model. + product_family (ProductFamily): The model property of type ProductFamily. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_family": 'product_family' + "product_family": "product_family", } _optionals = [ - 'product_family', + "product_family", ] - def __init__(self, - product_family=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProductFamilyResponse class""" - + def __init__( + self, + product_family=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProductFamilyResponse instance.""" # Initialize members of the class if product_family is not APIHelper.SKIP: - self.product_family = product_family + self.product_family = product_family # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_family = ProductFamily.from_dictionary(dictionary.get('product_family')) if 'product_family' in dictionary.keys() else APIHelper.SKIP + product_family =\ + ProductFamily.from_dictionary( + dictionary.get("product_family"))\ + if "product_family" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_family, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_family={(self.product_family if hasattr(self, "product_family") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_family=( + self.product_family + if hasattr(self, "product_family") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_family={_product_family!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_family={(self.product_family if hasattr(self, "product_family") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_family=( + self.product_family + if hasattr(self, "product_family") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_family={_product_family!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/product_price_point.py b/advancedbilling/models/product_price_point.py index 23f673d3..33cb5ec7 100644 --- a/advancedbilling/models/product_price_point.py +++ b/advancedbilling/models/product_price_point.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.currency_price import CurrencyPrice +from advancedbilling.models.currency_price import ( + CurrencyPrice, +) class ProductPricePoint(object): - """Implementation of the 'Product Price Point' model. Attributes: @@ -19,206 +19,211 @@ class ProductPricePoint(object): name (str): The product price point name handle (str): The product price point API handle price_in_cents (int): The product price point price, in integer cents - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this product price - point would renew every 30 days - interval_unit (IntervalUnit): A string representing the interval unit - for this product price point, either month or day - trial_price_in_cents (int): The product price point trial price, in - integer cents - trial_interval (int): The numerical trial interval. i.e. an interval - of ‘30’ coupled with a trial_interval_unit of day would mean this - product price point trial would last 30 days - trial_interval_unit (IntervalUnit): A string representing the trial - interval unit for this product price point, either month or day - trial_type (TrialType): Indicates how a trial is handled when the - trail period ends and there is no credit card on file. For - `no_obligation`, the subscription transitions to a Trial Ended - state. Maxio will not send any emails or statements. For - `payment_expected`, the subscription transitions to a Past Due - state. Maxio will send normal dunning emails and statements - according to your other settings. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this product price point would renew + every 30 days + interval_unit (IntervalUnit): A string representing the interval unit for + this product price point, either month or day + trial_price_in_cents (int): The product price point trial price, in integer + cents + trial_interval (int): The numerical trial interval. i.e. an interval of ‘30’ + coupled with a trial_interval_unit of day would mean this product price + point trial would last 30 days + trial_interval_unit (IntervalUnit): A string representing the trial interval + unit for this product price point, either month or day + trial_type (TrialType): Indicates how a trial is handled when the trail + period ends and there is no credit card on file. For `no_obligation`, the + subscription transitions to a Trial Ended state. Maxio will not send any + emails or statements. For `payment_expected`, the subscription + transitions to a Past Due state. Maxio will send normal dunning emails + and statements according to your other settings. introductory_offer (bool): reserved for future use - initial_charge_in_cents (int): The product price point initial charge, - in integer cents + initial_charge_in_cents (int): The product price point initial charge, in + integer cents initial_charge_after_trial (bool): The model property of type bool. expiration_interval (int): The numerical expiration interval. i.e. an - expiration_interval of ‘30’ coupled with an - expiration_interval_unit of day would mean this product price - point would expire after 30 days - expiration_interval_unit (ExpirationIntervalUnit): A string - representing the expiration interval unit for this product price - point, either month, day or never + expiration_interval of ‘30’ coupled with an expiration_interval_unit of + day would mean this product price point would expire after 30 days + expiration_interval_unit (ExpirationIntervalUnit): A string representing the + expiration interval unit for this product price point, either month, day + or never product_id (int): The product id this price point belongs to archived_at (datetime): Timestamp indicating when this price point was archived - created_at (datetime): Timestamp indicating when this price point was - created - updated_at (datetime): Timestamp indicating when this price point was - last updated - use_site_exchange_rate (bool): Whether or not to use the site's - exchange rate or define your own pricing when your site has - multiple currencies defined. + created_at (datetime): Timestamp indicating when this price point was created + updated_at (datetime): Timestamp indicating when this price point was last + updated + use_site_exchange_rate (bool): Whether or not to use the site's exchange rate + or define your own pricing when your site has multiple currencies defined. mtype (PricePointType): The type of price point tax_included (bool): Whether or not the price point includes tax subscription_id (int): The subscription id this price point belongs to - currency_prices (List[CurrencyPrice]): An array of currency pricing - data is available when multiple currencies are defined for the - site. It varies based on the use_site_exchange_rate setting for - the price point. This parameter is present only in the response of - read endpoints, after including the appropriate query parameter. - additional_properties (Dict[str, object]): The additional properties - for the model. + currency_prices (List[CurrencyPrice]): An array of currency pricing data is + available when multiple currencies are defined for the site. It varies + based on the use_site_exchange_rate setting for the price point. This + parameter is present only in the response of read endpoints, after + including the appropriate query parameter. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "handle": 'handle', - "price_in_cents": 'price_in_cents', - "interval": 'interval', - "interval_unit": 'interval_unit', - "trial_price_in_cents": 'trial_price_in_cents', - "trial_interval": 'trial_interval', - "trial_interval_unit": 'trial_interval_unit', - "trial_type": 'trial_type', - "introductory_offer": 'introductory_offer', - "initial_charge_in_cents": 'initial_charge_in_cents', - "initial_charge_after_trial": 'initial_charge_after_trial', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit', - "product_id": 'product_id', - "archived_at": 'archived_at', - "created_at": 'created_at', - "updated_at": 'updated_at', - "use_site_exchange_rate": 'use_site_exchange_rate', - "mtype": 'type', - "tax_included": 'tax_included', - "subscription_id": 'subscription_id', - "currency_prices": 'currency_prices' + "id": "id", + "name": "name", + "handle": "handle", + "price_in_cents": "price_in_cents", + "interval": "interval", + "interval_unit": "interval_unit", + "trial_price_in_cents": "trial_price_in_cents", + "trial_interval": "trial_interval", + "trial_interval_unit": "trial_interval_unit", + "trial_type": "trial_type", + "introductory_offer": "introductory_offer", + "initial_charge_in_cents": "initial_charge_in_cents", + "initial_charge_after_trial": "initial_charge_after_trial", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + "product_id": "product_id", + "archived_at": "archived_at", + "created_at": "created_at", + "updated_at": "updated_at", + "use_site_exchange_rate": "use_site_exchange_rate", + "mtype": "type", + "tax_included": "tax_included", + "subscription_id": "subscription_id", + "currency_prices": "currency_prices", } _optionals = [ - 'id', - 'name', - 'handle', - 'price_in_cents', - 'interval', - 'interval_unit', - 'trial_price_in_cents', - 'trial_interval', - 'trial_interval_unit', - 'trial_type', - 'introductory_offer', - 'initial_charge_in_cents', - 'initial_charge_after_trial', - 'expiration_interval', - 'expiration_interval_unit', - 'product_id', - 'archived_at', - 'created_at', - 'updated_at', - 'use_site_exchange_rate', - 'mtype', - 'tax_included', - 'subscription_id', - 'currency_prices', + "id", + "name", + "handle", + "price_in_cents", + "interval", + "interval_unit", + "trial_price_in_cents", + "trial_interval", + "trial_interval_unit", + "trial_type", + "introductory_offer", + "initial_charge_in_cents", + "initial_charge_after_trial", + "expiration_interval", + "expiration_interval_unit", + "product_id", + "archived_at", + "created_at", + "updated_at", + "use_site_exchange_rate", + "mtype", + "tax_included", + "subscription_id", + "currency_prices", ] _nullables = [ - 'handle', - 'trial_price_in_cents', - 'trial_interval', - 'trial_interval_unit', - 'trial_type', - 'introductory_offer', - 'initial_charge_in_cents', - 'initial_charge_after_trial', - 'expiration_interval', - 'expiration_interval_unit', - 'archived_at', - 'subscription_id', + "handle", + "trial_price_in_cents", + "trial_interval", + "trial_interval_unit", + "trial_type", + "introductory_offer", + "initial_charge_in_cents", + "initial_charge_after_trial", + "expiration_interval", + "expiration_interval_unit", + "archived_at", + "subscription_id", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - price_in_cents=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - trial_price_in_cents=APIHelper.SKIP, - trial_interval=APIHelper.SKIP, - trial_interval_unit=APIHelper.SKIP, - trial_type=APIHelper.SKIP, - introductory_offer=APIHelper.SKIP, - initial_charge_in_cents=APIHelper.SKIP, - initial_charge_after_trial=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - product_id=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - mtype=APIHelper.SKIP, - tax_included=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - currency_prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProductPricePoint class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + price_in_cents=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + trial_price_in_cents=APIHelper.SKIP, + trial_interval=APIHelper.SKIP, + trial_interval_unit=APIHelper.SKIP, + trial_type=APIHelper.SKIP, + introductory_offer=APIHelper.SKIP, + initial_charge_in_cents=APIHelper.SKIP, + initial_charge_after_trial=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + product_id=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + mtype=APIHelper.SKIP, + tax_included=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + currency_prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProductPricePoint instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents + self.price_in_cents = price_in_cents if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if trial_price_in_cents is not APIHelper.SKIP: - self.trial_price_in_cents = trial_price_in_cents + self.trial_price_in_cents = trial_price_in_cents if trial_interval is not APIHelper.SKIP: - self.trial_interval = trial_interval + self.trial_interval = trial_interval if trial_interval_unit is not APIHelper.SKIP: - self.trial_interval_unit = trial_interval_unit + self.trial_interval_unit = trial_interval_unit if trial_type is not APIHelper.SKIP: - self.trial_type = trial_type + self.trial_type = trial_type if introductory_offer is not APIHelper.SKIP: - self.introductory_offer = introductory_offer + self.introductory_offer = introductory_offer if initial_charge_in_cents is not APIHelper.SKIP: - self.initial_charge_in_cents = initial_charge_in_cents + self.initial_charge_in_cents = initial_charge_in_cents if initial_charge_after_trial is not APIHelper.SKIP: - self.initial_charge_after_trial = initial_charge_after_trial + self.initial_charge_after_trial = initial_charge_after_trial if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if archived_at is not APIHelper.SKIP: - self.archived_at = APIHelper.apply_datetime_converter(archived_at, APIHelper.RFC3339DateTime) if archived_at else None + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if mtype is not APIHelper.SKIP: - self.mtype = mtype + self.mtype = mtype if tax_included is not APIHelper.SKIP: - self.tax_included = tax_included + self.tax_included = tax_included if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if currency_prices is not APIHelper.SKIP: - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -228,7 +233,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -239,44 +244,116 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if "handle" in dictionary.keys() else APIHelper.SKIP - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else APIHelper.SKIP - trial_price_in_cents = dictionary.get("trial_price_in_cents") if "trial_price_in_cents" in dictionary.keys() else APIHelper.SKIP - trial_interval = dictionary.get("trial_interval") if "trial_interval" in dictionary.keys() else APIHelper.SKIP - trial_interval_unit = dictionary.get("trial_interval_unit") if "trial_interval_unit" in dictionary.keys() else APIHelper.SKIP - trial_type = dictionary.get("trial_type") if "trial_type" in dictionary.keys() else APIHelper.SKIP - introductory_offer = dictionary.get("introductory_offer") if "introductory_offer" in dictionary.keys() else APIHelper.SKIP - initial_charge_in_cents = dictionary.get("initial_charge_in_cents") if "initial_charge_in_cents" in dictionary.keys() else APIHelper.SKIP - initial_charge_after_trial = dictionary.get("initial_charge_after_trial") if "initial_charge_after_trial" in dictionary.keys() else APIHelper.SKIP - expiration_interval = dictionary.get("expiration_interval") if "expiration_interval" in dictionary.keys() else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - if 'archived_at' in dictionary.keys(): - archived_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("archived_at")).datetime if dictionary.get("archived_at") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if "handle" in dictionary.keys()\ + else APIHelper.SKIP + price_in_cents =\ + dictionary.get("price_in_cents")\ + if dictionary.get("price_in_cents")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if dictionary.get("interval_unit")\ + else APIHelper.SKIP + trial_price_in_cents =\ + dictionary.get("trial_price_in_cents")\ + if "trial_price_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + trial_interval =\ + dictionary.get("trial_interval")\ + if "trial_interval" in dictionary.keys()\ + else APIHelper.SKIP + trial_interval_unit =\ + dictionary.get("trial_interval_unit")\ + if "trial_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + trial_type =\ + dictionary.get("trial_type")\ + if "trial_type" in dictionary.keys()\ + else APIHelper.SKIP + introductory_offer =\ + dictionary.get("introductory_offer")\ + if "introductory_offer" in dictionary.keys()\ + else APIHelper.SKIP + initial_charge_in_cents =\ + dictionary.get("initial_charge_in_cents")\ + if "initial_charge_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + initial_charge_after_trial =\ + dictionary.get("initial_charge_after_trial")\ + if "initial_charge_after_trial" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if "expiration_interval" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + else: archived_at = APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP - tax_included = dictionary.get("tax_included") if "tax_included" in dictionary.keys() else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if "subscription_id" in dictionary.keys() else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + mtype =\ + dictionary.get("type")\ + if dictionary.get("type")\ + else APIHelper.SKIP + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if "subscription_id" in dictionary.keys()\ + else APIHelper.SKIP currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [CurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + CurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] else: currency_prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -305,57 +382,307 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!r}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!r}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!r}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!r}, ' - f'introductory_offer={(self.introductory_offer if hasattr(self, "introductory_offer") else None)!r}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!r}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _introductory_offer=( + self.introductory_offer + if hasattr(self, "introductory_offer") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"handle={_handle!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"trial_price_in_cents={_trial_price_in_cents!r}, " + f"trial_interval={_trial_interval!r}, " + f"trial_interval_unit={_trial_interval_unit!r}, " + f"trial_type={_trial_type!r}, " + f"introductory_offer={_introductory_offer!r}, " + f"initial_charge_in_cents={_initial_charge_in_cents!r}, " + f"initial_charge_after_trial={_initial_charge_after_trial!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"product_id={_product_id!r}, " + f"archived_at={_archived_at!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"mtype={_mtype!r}, " + f"tax_included={_tax_included!r}, " + f"subscription_id={_subscription_id!r}, " + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!s}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!s}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!s}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!s}, ' - f'introductory_offer={(self.introductory_offer if hasattr(self, "introductory_offer") else None)!s}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!s}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'currency_prices={(self.currency_prices if hasattr(self, "currency_prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _introductory_offer=( + self.introductory_offer + if hasattr(self, "introductory_offer") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _mtype=( + self.mtype + if hasattr(self, "mtype") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _currency_prices=( + self.currency_prices + if hasattr(self, "currency_prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"handle={_handle!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"trial_price_in_cents={_trial_price_in_cents!s}, " + f"trial_interval={_trial_interval!s}, " + f"trial_interval_unit={_trial_interval_unit!s}, " + f"trial_type={_trial_type!s}, " + f"introductory_offer={_introductory_offer!s}, " + f"initial_charge_in_cents={_initial_charge_in_cents!s}, " + f"initial_charge_after_trial={_initial_charge_after_trial!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"product_id={_product_id!s}, " + f"archived_at={_archived_at!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"mtype={_mtype!s}, " + f"tax_included={_tax_included!s}, " + f"subscription_id={_subscription_id!s}, " + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/product_price_point_errors.py b/advancedbilling/models/product_price_point_errors.py index b913e2c6..646697c0 100644 --- a/advancedbilling/models/product_price_point_errors.py +++ b/advancedbilling/models/product_price_point_errors.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ProductPricePointErrors(object): - """Implementation of the 'Product Price Point Errors' model. Attributes: @@ -20,53 +18,53 @@ class ProductPricePointErrors(object): name (List[str]): The model property of type List[str]. price (List[str]): The model property of type List[str]. price_in_cents (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point": 'price_point', - "interval": 'interval', - "interval_unit": 'interval_unit', - "name": 'name', - "price": 'price', - "price_in_cents": 'price_in_cents' + "price_point": "price_point", + "interval": "interval", + "interval_unit": "interval_unit", + "name": "name", + "price": "price", + "price_in_cents": "price_in_cents", } _optionals = [ - 'price_point', - 'interval', - 'interval_unit', - 'name', - 'price', - 'price_in_cents', + "price_point", + "interval", + "interval_unit", + "name", + "price", + "price_in_cents", ] - def __init__(self, - price_point=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - name=APIHelper.SKIP, - price=APIHelper.SKIP, - price_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProductPricePointErrors class""" - + def __init__( + self, + price_point=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + name=APIHelper.SKIP, + price=APIHelper.SKIP, + price_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProductPricePointErrors instance.""" # Initialize members of the class if price_point is not APIHelper.SKIP: - self.price_point = price_point + self.price_point = price_point if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if name is not APIHelper.SKIP: - self.name = name + self.name = name if price is not APIHelper.SKIP: - self.price = price + self.price = price if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents + self.price_in_cents = price_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +74,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,19 +85,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point = dictionary.get("price_point") if dictionary.get("price_point") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - price = dictionary.get("price") if dictionary.get("price") else APIHelper.SKIP - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") else APIHelper.SKIP + price_point =\ + dictionary.get("price_point")\ + if dictionary.get("price_point")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if dictionary.get("interval_unit")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + price =\ + dictionary.get("price")\ + if dictionary.get("price")\ + else APIHelper.SKIP + price_in_cents =\ + dictionary.get("price_in_cents")\ + if dictionary.get("price_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point, interval, @@ -110,21 +128,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'price={(self.price if hasattr(self, "price") else None)!r}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"name={_name!r}, " + f"price={_price!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'price={(self.price if hasattr(self, "price") else None)!s}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _price=( + self.price + if hasattr(self, "price") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"name={_name!s}, " + f"price={_price!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/product_price_point_response.py b/advancedbilling/models/product_price_point_response.py index a0cedf89..57727d02 100644 --- a/advancedbilling/models/product_price_point_response.py +++ b/advancedbilling/models/product_price_point_response.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.product_price_point import ProductPricePoint +# ruff: noqa: E501 +from advancedbilling.models.product_price_point import ( + ProductPricePoint, +) -class ProductPricePointResponse(object): +class ProductPricePointResponse(object): """Implementation of the 'Product Price Point Response' model. Attributes: - price_point (ProductPricePoint): The model property of type - ProductPricePoint. - additional_properties (Dict[str, object]): The additional properties - for the model. + price_point (ProductPricePoint): The model property of type ProductPricePoint. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point": 'price_point' + "price_point": "price_point", } - def __init__(self, - price_point=None, - additional_properties=None): - """Constructor for the ProductPricePointResponse class""" - + def __init__( + self, + price_point=None, + additional_properties=None): + """Initialize a ProductPricePointResponse instance.""" # Initialize members of the class - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point = ProductPricePoint.from_dictionary(dictionary.get('price_point')) if dictionary.get('price_point') else None + price_point =\ + ProductPricePoint.from_dictionary( + dictionary.get("price_point"))\ + if dictionary.get("price_point") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/product_response.py b/advancedbilling/models/product_response.py index db146952..e7d4146d 100644 --- a/advancedbilling/models/product_response.py +++ b/advancedbilling/models/product_response.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.models.product import Product class ProductResponse(object): - """Implementation of the 'Product Response' model. Attributes: product (Product): The model property of type Product. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product": 'product' + "product": "product", } - def __init__(self, - product=None, - additional_properties=None): - """Constructor for the ProductResponse class""" - + def __init__( + self, + product=None, + additional_properties=None): + """Initialize a ProductResponse instance.""" # Initialize members of the class - self.product = product + self.product = product # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +50,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product = Product.from_dictionary(dictionary.get('product')) if dictionary.get('product') else None + product =\ + Product.from_dictionary( + dictionary.get("product"))\ + if dictionary.get("product") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product={self.product!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product=self.product + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product={_product!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product={self.product!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product=self.product + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product={_product!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_error.py b/advancedbilling/models/proforma_error.py index 1c7ca088..346df41e 100644 --- a/advancedbilling/models/proforma_error.py +++ b/advancedbilling/models/proforma_error.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.base_string_error import BaseStringError +from advancedbilling.models.base_string_error import ( + BaseStringError, +) class ProformaError(object): - """Implementation of the 'Proforma Error' model. Attributes: - subscription (BaseStringError): The error is base if it is not - directly associated with a single attribute. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscription (BaseStringError): The error is base if it is not directly + associated with a single attribute. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription": 'subscription' + "subscription": "subscription", } _optionals = [ - 'subscription', + "subscription", ] - def __init__(self, - subscription=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProformaError class""" - + def __init__( + self, + subscription=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProformaError instance.""" # Initialize members of the class if subscription is not APIHelper.SKIP: - self.subscription = subscription + self.subscription = subscription # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,24 +59,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription = BaseStringError.from_dictionary(dictionary.get('subscription')) if 'subscription' in dictionary.keys() else APIHelper.SKIP + subscription =\ + BaseStringError.from_dictionary( + dictionary.get("subscription"))\ + if "subscription" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_invoice.py b/advancedbilling/models/proforma_invoice.py index 5454e501..82fbe118 100644 --- a/advancedbilling/models/proforma_invoice.py +++ b/advancedbilling/models/proforma_invoice.py @@ -1,27 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_address import InvoiceAddress -from advancedbilling.models.invoice_custom_field import InvoiceCustomField -from advancedbilling.models.invoice_customer import InvoiceCustomer -from advancedbilling.models.invoice_line_item import InvoiceLineItem -from advancedbilling.models.invoice_seller import InvoiceSeller -from advancedbilling.models.proforma_invoice_credit import ProformaInvoiceCredit -from advancedbilling.models.proforma_invoice_discount import ProformaInvoiceDiscount -from advancedbilling.models.proforma_invoice_payment import ProformaInvoicePayment -from advancedbilling.models.proforma_invoice_tax import ProformaInvoiceTax +from advancedbilling.models.available_actions import ( + AvailableActions, +) +from advancedbilling.models.invoice_address import ( + InvoiceAddress, +) +from advancedbilling.models.invoice_custom_field import ( + InvoiceCustomField, +) +from advancedbilling.models.invoice_customer import ( + InvoiceCustomer, +) +from advancedbilling.models.invoice_line_item import ( + InvoiceLineItem, +) +from advancedbilling.models.invoice_seller import ( + InvoiceSeller, +) +from advancedbilling.models.proforma_invoice_credit import ( + ProformaInvoiceCredit, +) +from advancedbilling.models.proforma_invoice_discount import ( + ProformaInvoiceDiscount, +) +from advancedbilling.models.proforma_invoice_payment import ( + ProformaInvoicePayment, +) +from advancedbilling.models.proforma_invoice_tax import ( + ProformaInvoiceTax, +) class ProformaInvoice(object): - """Implementation of the 'Proforma Invoice' model. Attributes: @@ -35,37 +54,33 @@ class ProformaInvoice(object): delivery_date (date): The model property of type date. status (ProformaInvoiceStatus): The model property of type ProformaInvoiceStatus. - collection_method (CollectionMethod): The type of payment collection - to be used in the subscription. For legacy Statements Architecture - valid options are - `invoice`, `automatic`. For current - Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. + collection_method (CollectionMethod): The type of payment collection to be + used in the subscription. For legacy Statements Architecture valid + options are - `invoice`, `automatic`. For current Relationship Invoicing + Architecture valid options are - `remittance`, `automatic`, `prepaid`. payment_instructions (str): The model property of type str. currency (str): The model property of type str. - consolidation_level (InvoiceConsolidationLevel): Consolidation level - of the invoice, which is applicable to invoice consolidation. It - will hold one of the following values: * "none": A normal invoice - with no consolidation. * "child": An invoice segment which has - been combined into a consolidated invoice. * "parent": A - consolidated invoice, whose contents are composed of invoice - segments. "Parent" invoices do not have lines of their own, but - they have subtotals and totals which aggregate the member invoice - segments. See also the [invoice consolidation - documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269 - 909389-Invoice-Consolidation). + consolidation_level (InvoiceConsolidationLevel): Consolidation level of the + invoice, which is applicable to invoice consolidation. It will hold one + of the following values: * "none": A normal invoice with no + consolidation. * "child": An invoice segment which has been combined into + a consolidated invoice. * "parent": A consolidated invoice, whose + contents are composed of invoice segments. "Parent" invoices do not have + lines of their own, but they have subtotals and totals which aggregate + the member invoice segments. See also the [invoice consolidation + documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389- + Invoice-Consolidation). product_name (str): The model property of type str. product_family_name (str): The model property of type str. role (ProformaInvoiceRole): 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic - seller (InvoiceSeller): Information about the seller (merchant) listed - on the masthead of the invoice. - customer (InvoiceCustomer): Information about the customer who is - owner or recipient the invoiced subscription. + seller (InvoiceSeller): Information about the seller (merchant) listed on the + masthead of the invoice. + customer (InvoiceCustomer): Information about the customer who is owner or + recipient the invoiced subscription. memo (str): The model property of type str. - billing_address (InvoiceAddress): The model property of type - InvoiceAddress. - shipping_address (InvoiceAddress): The model property of type - InvoiceAddress. + billing_address (InvoiceAddress): The model property of type InvoiceAddress. + shipping_address (InvoiceAddress): The model property of type InvoiceAddress. subtotal_amount (str): The model property of type str. discount_amount (str): The model property of type str. tax_amount (str): The model property of type str. @@ -87,211 +102,221 @@ class ProformaInvoice(object): custom_fields (List[InvoiceCustomField]): The model property of type List[InvoiceCustomField]. public_url (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + available_actions (AvailableActions): The model property of type + AvailableActions. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "site_id": 'site_id', - "customer_id": 'customer_id', - "subscription_id": 'subscription_id', - "number": 'number', - "sequence_number": 'sequence_number', - "created_at": 'created_at', - "delivery_date": 'delivery_date', - "status": 'status', - "collection_method": 'collection_method', - "payment_instructions": 'payment_instructions', - "currency": 'currency', - "consolidation_level": 'consolidation_level', - "product_name": 'product_name', - "product_family_name": 'product_family_name', - "role": 'role', - "seller": 'seller', - "customer": 'customer', - "memo": 'memo', - "billing_address": 'billing_address', - "shipping_address": 'shipping_address', - "subtotal_amount": 'subtotal_amount', - "discount_amount": 'discount_amount', - "tax_amount": 'tax_amount', - "total_amount": 'total_amount', - "credit_amount": 'credit_amount', - "paid_amount": 'paid_amount', - "refund_amount": 'refund_amount', - "due_amount": 'due_amount', - "line_items": 'line_items', - "discounts": 'discounts', - "taxes": 'taxes', - "credits": 'credits', - "payments": 'payments', - "custom_fields": 'custom_fields', - "public_url": 'public_url' + "uid": "uid", + "site_id": "site_id", + "customer_id": "customer_id", + "subscription_id": "subscription_id", + "number": "number", + "sequence_number": "sequence_number", + "created_at": "created_at", + "delivery_date": "delivery_date", + "status": "status", + "collection_method": "collection_method", + "payment_instructions": "payment_instructions", + "currency": "currency", + "consolidation_level": "consolidation_level", + "product_name": "product_name", + "product_family_name": "product_family_name", + "role": "role", + "seller": "seller", + "customer": "customer", + "memo": "memo", + "billing_address": "billing_address", + "shipping_address": "shipping_address", + "subtotal_amount": "subtotal_amount", + "discount_amount": "discount_amount", + "tax_amount": "tax_amount", + "total_amount": "total_amount", + "credit_amount": "credit_amount", + "paid_amount": "paid_amount", + "refund_amount": "refund_amount", + "due_amount": "due_amount", + "line_items": "line_items", + "discounts": "discounts", + "taxes": "taxes", + "credits": "credits", + "payments": "payments", + "custom_fields": "custom_fields", + "public_url": "public_url", + "available_actions": "available_actions", } _optionals = [ - 'uid', - 'site_id', - 'customer_id', - 'subscription_id', - 'number', - 'sequence_number', - 'created_at', - 'delivery_date', - 'status', - 'collection_method', - 'payment_instructions', - 'currency', - 'consolidation_level', - 'product_name', - 'product_family_name', - 'role', - 'seller', - 'customer', - 'memo', - 'billing_address', - 'shipping_address', - 'subtotal_amount', - 'discount_amount', - 'tax_amount', - 'total_amount', - 'credit_amount', - 'paid_amount', - 'refund_amount', - 'due_amount', - 'line_items', - 'discounts', - 'taxes', - 'credits', - 'payments', - 'custom_fields', - 'public_url', + "uid", + "site_id", + "customer_id", + "subscription_id", + "number", + "sequence_number", + "created_at", + "delivery_date", + "status", + "collection_method", + "payment_instructions", + "currency", + "consolidation_level", + "product_name", + "product_family_name", + "role", + "seller", + "customer", + "memo", + "billing_address", + "shipping_address", + "subtotal_amount", + "discount_amount", + "tax_amount", + "total_amount", + "credit_amount", + "paid_amount", + "refund_amount", + "due_amount", + "line_items", + "discounts", + "taxes", + "credits", + "payments", + "custom_fields", + "public_url", + "available_actions", ] _nullables = [ - 'customer_id', - 'subscription_id', - 'number', - 'sequence_number', - 'public_url', + "customer_id", + "subscription_id", + "number", + "sequence_number", + "public_url", ] - def __init__(self, - uid=APIHelper.SKIP, - site_id=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - number=APIHelper.SKIP, - sequence_number=APIHelper.SKIP, - created_at=APIHelper.SKIP, - delivery_date=APIHelper.SKIP, - status=APIHelper.SKIP, - collection_method=APIHelper.SKIP, - payment_instructions=APIHelper.SKIP, - currency=APIHelper.SKIP, - consolidation_level=APIHelper.SKIP, - product_name=APIHelper.SKIP, - product_family_name=APIHelper.SKIP, - role=APIHelper.SKIP, - seller=APIHelper.SKIP, - customer=APIHelper.SKIP, - memo=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - shipping_address=APIHelper.SKIP, - subtotal_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - total_amount=APIHelper.SKIP, - credit_amount=APIHelper.SKIP, - paid_amount=APIHelper.SKIP, - refund_amount=APIHelper.SKIP, - due_amount=APIHelper.SKIP, - line_items=APIHelper.SKIP, - discounts=APIHelper.SKIP, - taxes=APIHelper.SKIP, - credits=APIHelper.SKIP, - payments=APIHelper.SKIP, - custom_fields=APIHelper.SKIP, - public_url=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProformaInvoice class""" - + def __init__( + self, + uid=APIHelper.SKIP, + site_id=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + number=APIHelper.SKIP, + sequence_number=APIHelper.SKIP, + created_at=APIHelper.SKIP, + delivery_date=APIHelper.SKIP, + status=APIHelper.SKIP, + collection_method=APIHelper.SKIP, + payment_instructions=APIHelper.SKIP, + currency=APIHelper.SKIP, + consolidation_level=APIHelper.SKIP, + product_name=APIHelper.SKIP, + product_family_name=APIHelper.SKIP, + role=APIHelper.SKIP, + seller=APIHelper.SKIP, + customer=APIHelper.SKIP, + memo=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + subtotal_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + total_amount=APIHelper.SKIP, + credit_amount=APIHelper.SKIP, + paid_amount=APIHelper.SKIP, + refund_amount=APIHelper.SKIP, + due_amount=APIHelper.SKIP, + line_items=APIHelper.SKIP, + discounts=APIHelper.SKIP, + taxes=APIHelper.SKIP, + credits=APIHelper.SKIP, + payments=APIHelper.SKIP, + custom_fields=APIHelper.SKIP, + public_url=APIHelper.SKIP, + available_actions=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProformaInvoice instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if number is not APIHelper.SKIP: - self.number = number + self.number = number if sequence_number is not APIHelper.SKIP: - self.sequence_number = sequence_number + self.sequence_number = sequence_number if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if delivery_date is not APIHelper.SKIP: - self.delivery_date = delivery_date + self.delivery_date = delivery_date if status is not APIHelper.SKIP: - self.status = status + self.status = status if collection_method is not APIHelper.SKIP: - self.collection_method = collection_method + self.collection_method = collection_method if payment_instructions is not APIHelper.SKIP: - self.payment_instructions = payment_instructions + self.payment_instructions = payment_instructions if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if consolidation_level is not APIHelper.SKIP: - self.consolidation_level = consolidation_level + self.consolidation_level = consolidation_level if product_name is not APIHelper.SKIP: - self.product_name = product_name + self.product_name = product_name if product_family_name is not APIHelper.SKIP: - self.product_family_name = product_family_name + self.product_family_name = product_family_name if role is not APIHelper.SKIP: - self.role = role + self.role = role if seller is not APIHelper.SKIP: - self.seller = seller + self.seller = seller if customer is not APIHelper.SKIP: - self.customer = customer + self.customer = customer if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if shipping_address is not APIHelper.SKIP: - self.shipping_address = shipping_address + self.shipping_address = shipping_address if subtotal_amount is not APIHelper.SKIP: - self.subtotal_amount = subtotal_amount + self.subtotal_amount = subtotal_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if total_amount is not APIHelper.SKIP: - self.total_amount = total_amount + self.total_amount = total_amount if credit_amount is not APIHelper.SKIP: - self.credit_amount = credit_amount + self.credit_amount = credit_amount if paid_amount is not APIHelper.SKIP: - self.paid_amount = paid_amount + self.paid_amount = paid_amount if refund_amount is not APIHelper.SKIP: - self.refund_amount = refund_amount + self.refund_amount = refund_amount if due_amount is not APIHelper.SKIP: - self.due_amount = due_amount + self.due_amount = due_amount if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items if discounts is not APIHelper.SKIP: - self.discounts = discounts + self.discounts = discounts if taxes is not APIHelper.SKIP: - self.taxes = taxes + self.taxes = taxes if credits is not APIHelper.SKIP: - self.credits = credits + self.credits = credits if payments is not APIHelper.SKIP: - self.payments = payments + self.payments = payments if custom_fields is not APIHelper.SKIP: - self.custom_fields = custom_fields + self.custom_fields = custom_fields if public_url is not APIHelper.SKIP: - self.public_url = public_url + self.public_url = public_url + if available_actions is not APIHelper.SKIP: + self.available_actions = available_actions # Add additional model properties to the instance if additional_properties is None: @@ -301,7 +326,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -312,73 +337,190 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if "customer_id" in dictionary.keys() else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if "subscription_id" in dictionary.keys() else APIHelper.SKIP - number = dictionary.get("number") if "number" in dictionary.keys() else APIHelper.SKIP - sequence_number = dictionary.get("sequence_number") if "sequence_number" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - delivery_date = dateutil.parser.parse(dictionary.get('delivery_date')).date() if dictionary.get('delivery_date') else APIHelper.SKIP - status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP - collection_method = dictionary.get("collection_method") if dictionary.get("collection_method") else APIHelper.SKIP - payment_instructions = dictionary.get("payment_instructions") if dictionary.get("payment_instructions") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - consolidation_level = dictionary.get("consolidation_level") if dictionary.get("consolidation_level") else APIHelper.SKIP - product_name = dictionary.get("product_name") if dictionary.get("product_name") else APIHelper.SKIP - product_family_name = dictionary.get("product_family_name") if dictionary.get("product_family_name") else APIHelper.SKIP - role = dictionary.get("role") if dictionary.get("role") else APIHelper.SKIP - seller = InvoiceSeller.from_dictionary(dictionary.get('seller')) if 'seller' in dictionary.keys() else APIHelper.SKIP - customer = InvoiceCustomer.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - billing_address = InvoiceAddress.from_dictionary(dictionary.get('billing_address')) if 'billing_address' in dictionary.keys() else APIHelper.SKIP - shipping_address = InvoiceAddress.from_dictionary(dictionary.get('shipping_address')) if 'shipping_address' in dictionary.keys() else APIHelper.SKIP - subtotal_amount = dictionary.get("subtotal_amount") if dictionary.get("subtotal_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else APIHelper.SKIP - credit_amount = dictionary.get("credit_amount") if dictionary.get("credit_amount") else APIHelper.SKIP - paid_amount = dictionary.get("paid_amount") if dictionary.get("paid_amount") else APIHelper.SKIP - refund_amount = dictionary.get("refund_amount") if dictionary.get("refund_amount") else APIHelper.SKIP - due_amount = dictionary.get("due_amount") if dictionary.get("due_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if "customer_id" in dictionary.keys()\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if "subscription_id" in dictionary.keys()\ + else APIHelper.SKIP + number =\ + dictionary.get("number")\ + if "number" in dictionary.keys()\ + else APIHelper.SKIP + sequence_number =\ + dictionary.get("sequence_number")\ + if "sequence_number" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + delivery_date = dateutil.parser.parse( + dictionary.get("delivery_date")).date()\ + if dictionary.get("delivery_date") else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + collection_method =\ + dictionary.get("collection_method")\ + if dictionary.get("collection_method")\ + else APIHelper.SKIP + payment_instructions =\ + dictionary.get("payment_instructions")\ + if dictionary.get("payment_instructions")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + consolidation_level =\ + dictionary.get("consolidation_level")\ + if dictionary.get("consolidation_level")\ + else APIHelper.SKIP + product_name =\ + dictionary.get("product_name")\ + if dictionary.get("product_name")\ + else APIHelper.SKIP + product_family_name =\ + dictionary.get("product_family_name")\ + if dictionary.get("product_family_name")\ + else APIHelper.SKIP + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else APIHelper.SKIP + seller =\ + InvoiceSeller.from_dictionary( + dictionary.get("seller"))\ + if "seller" in dictionary.keys()\ + else APIHelper.SKIP + customer =\ + InvoiceCustomer.from_dictionary( + dictionary.get("customer"))\ + if "customer" in dictionary.keys()\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + billing_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("billing_address"))\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + shipping_address =\ + InvoiceAddress.from_dictionary( + dictionary.get("shipping_address"))\ + if "shipping_address" in dictionary.keys()\ + else APIHelper.SKIP + subtotal_amount =\ + dictionary.get("subtotal_amount")\ + if dictionary.get("subtotal_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else APIHelper.SKIP + credit_amount =\ + dictionary.get("credit_amount")\ + if dictionary.get("credit_amount")\ + else APIHelper.SKIP + paid_amount =\ + dictionary.get("paid_amount")\ + if dictionary.get("paid_amount")\ + else APIHelper.SKIP + refund_amount =\ + dictionary.get("refund_amount")\ + if dictionary.get("refund_amount")\ + else APIHelper.SKIP + due_amount =\ + dictionary.get("due_amount")\ + if dictionary.get("due_amount")\ + else APIHelper.SKIP line_items = None - if dictionary.get('line_items') is not None: - line_items = [InvoiceLineItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + InvoiceLineItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP discounts = None - if dictionary.get('discounts') is not None: - discounts = [ProformaInvoiceDiscount.from_dictionary(x) for x in dictionary.get('discounts')] + if dictionary.get("discounts") is not None: + discounts = [ + ProformaInvoiceDiscount.from_dictionary(x) + for x in dictionary.get("discounts") + ] else: discounts = APIHelper.SKIP taxes = None - if dictionary.get('taxes') is not None: - taxes = [ProformaInvoiceTax.from_dictionary(x) for x in dictionary.get('taxes')] + if dictionary.get("taxes") is not None: + taxes = [ + ProformaInvoiceTax.from_dictionary(x) + for x in dictionary.get("taxes") + ] else: taxes = APIHelper.SKIP credits = None - if dictionary.get('credits') is not None: - credits = [ProformaInvoiceCredit.from_dictionary(x) for x in dictionary.get('credits')] + if dictionary.get("credits") is not None: + credits = [ + ProformaInvoiceCredit.from_dictionary(x) + for x in dictionary.get("credits") + ] else: credits = APIHelper.SKIP payments = None - if dictionary.get('payments') is not None: - payments = [ProformaInvoicePayment.from_dictionary(x) for x in dictionary.get('payments')] + if dictionary.get("payments") is not None: + payments = [ + ProformaInvoicePayment.from_dictionary(x) + for x in dictionary.get("payments") + ] else: payments = APIHelper.SKIP custom_fields = None - if dictionary.get('custom_fields') is not None: - custom_fields = [InvoiceCustomField.from_dictionary(x) for x in dictionary.get('custom_fields')] + if dictionary.get("custom_fields") is not None: + custom_fields = [ + InvoiceCustomField.from_dictionary(x) + for x in dictionary.get("custom_fields") + ] else: custom_fields = APIHelper.SKIP - public_url = dictionary.get("public_url") if "public_url" in dictionary.keys() else APIHelper.SKIP + public_url =\ + dictionary.get("public_url")\ + if "public_url" in dictionary.keys()\ + else APIHelper.SKIP + available_actions =\ + AvailableActions.from_dictionary( + dictionary.get("available_actions"))\ + if "available_actions" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, site_id, @@ -416,84 +558,467 @@ def from_dictionary(cls, payments, custom_fields, public_url, + available_actions, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'number={(self.number if hasattr(self, "number") else None)!r}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'delivery_date={(self.delivery_date if hasattr(self, "delivery_date") else None)!r}, ' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'collection_method={(self.collection_method if hasattr(self, "collection_method") else None)!r}, ' - f'payment_instructions={(self.payment_instructions if hasattr(self, "payment_instructions") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!r}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!r}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!r}, ' - f'role={(self.role if hasattr(self, "role") else None)!r}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!r}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!r}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!r}, ' - f'credit_amount={(self.credit_amount if hasattr(self, "credit_amount") else None)!r}, ' - f'paid_amount={(self.paid_amount if hasattr(self, "paid_amount") else None)!r}, ' - f'refund_amount={(self.refund_amount if hasattr(self, "refund_amount") else None)!r}, ' - f'due_amount={(self.due_amount if hasattr(self, "due_amount") else None)!r}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!r}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!r}, ' - f'credits={(self.credits if hasattr(self, "credits") else None)!r}, ' - f'payments={(self.payments if hasattr(self, "payments") else None)!r}, ' - f'custom_fields={(self.custom_fields if hasattr(self, "custom_fields") else None)!r}, ' - f'public_url={(self.public_url if hasattr(self, "public_url") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _delivery_date=( + self.delivery_date + if hasattr(self, "delivery_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _collection_method=( + self.collection_method + if hasattr(self, "collection_method") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _credit_amount=( + self.credit_amount + if hasattr(self, "credit_amount") + else None + ) + _paid_amount=( + self.paid_amount + if hasattr(self, "paid_amount") + else None + ) + _refund_amount=( + self.refund_amount + if hasattr(self, "refund_amount") + else None + ) + _due_amount=( + self.due_amount + if hasattr(self, "due_amount") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _credits=( + self.credits + if hasattr(self, "credits") + else None + ) + _payments=( + self.payments + if hasattr(self, "payments") + else None + ) + _custom_fields=( + self.custom_fields + if hasattr(self, "custom_fields") + else None + ) + _public_url=( + self.public_url + if hasattr(self, "public_url") + else None + ) + _available_actions=( + self.available_actions + if hasattr(self, "available_actions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"site_id={_site_id!r}, " + f"customer_id={_customer_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"number={_number!r}, " + f"sequence_number={_sequence_number!r}, " + f"created_at={_created_at!r}, " + f"delivery_date={_delivery_date!r}, " + f"status={_status!r}, " + f"collection_method={_collection_method!r}, " + f"payment_instructions={_payment_instructions!r}, " + f"currency={_currency!r}, " + f"consolidation_level={_consolidation_level!r}, " + f"product_name={_product_name!r}, " + f"product_family_name={_product_family_name!r}, " + f"role={_role!r}, " + f"seller={_seller!r}, " + f"customer={_customer!r}, " + f"memo={_memo!r}, " + f"billing_address={_billing_address!r}, " + f"shipping_address={_shipping_address!r}, " + f"subtotal_amount={_subtotal_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"total_amount={_total_amount!r}, " + f"credit_amount={_credit_amount!r}, " + f"paid_amount={_paid_amount!r}, " + f"refund_amount={_refund_amount!r}, " + f"due_amount={_due_amount!r}, " + f"line_items={_line_items!r}, " + f"discounts={_discounts!r}, " + f"taxes={_taxes!r}, " + f"credits={_credits!r}, " + f"payments={_payments!r}, " + f"custom_fields={_custom_fields!r}, " + f"public_url={_public_url!r}, " + f"available_actions={_available_actions!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'number={(self.number if hasattr(self, "number") else None)!s}, ' - f'sequence_number={(self.sequence_number if hasattr(self, "sequence_number") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'delivery_date={(self.delivery_date if hasattr(self, "delivery_date") else None)!s}, ' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'collection_method={(self.collection_method if hasattr(self, "collection_method") else None)!s}, ' - f'payment_instructions={(self.payment_instructions if hasattr(self, "payment_instructions") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!s}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!s}, ' - f'product_family_name={(self.product_family_name if hasattr(self, "product_family_name") else None)!s}, ' - f'role={(self.role if hasattr(self, "role") else None)!s}, ' - f'seller={(self.seller if hasattr(self, "seller") else None)!s}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'shipping_address={(self.shipping_address if hasattr(self, "shipping_address") else None)!s}, ' - f'subtotal_amount={(self.subtotal_amount if hasattr(self, "subtotal_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'total_amount={(self.total_amount if hasattr(self, "total_amount") else None)!s}, ' - f'credit_amount={(self.credit_amount if hasattr(self, "credit_amount") else None)!s}, ' - f'paid_amount={(self.paid_amount if hasattr(self, "paid_amount") else None)!s}, ' - f'refund_amount={(self.refund_amount if hasattr(self, "refund_amount") else None)!s}, ' - f'due_amount={(self.due_amount if hasattr(self, "due_amount") else None)!s}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'discounts={(self.discounts if hasattr(self, "discounts") else None)!s}, ' - f'taxes={(self.taxes if hasattr(self, "taxes") else None)!s}, ' - f'credits={(self.credits if hasattr(self, "credits") else None)!s}, ' - f'payments={(self.payments if hasattr(self, "payments") else None)!s}, ' - f'custom_fields={(self.custom_fields if hasattr(self, "custom_fields") else None)!s}, ' - f'public_url={(self.public_url if hasattr(self, "public_url") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _number=( + self.number + if hasattr(self, "number") + else None + ) + _sequence_number=( + self.sequence_number + if hasattr(self, "sequence_number") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _delivery_date=( + self.delivery_date + if hasattr(self, "delivery_date") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _collection_method=( + self.collection_method + if hasattr(self, "collection_method") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _product_family_name=( + self.product_family_name + if hasattr(self, "product_family_name") + else None + ) + _role=( + self.role + if hasattr(self, "role") + else None + ) + _seller=( + self.seller + if hasattr(self, "seller") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _subtotal_amount=( + self.subtotal_amount + if hasattr(self, "subtotal_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _total_amount=( + self.total_amount + if hasattr(self, "total_amount") + else None + ) + _credit_amount=( + self.credit_amount + if hasattr(self, "credit_amount") + else None + ) + _paid_amount=( + self.paid_amount + if hasattr(self, "paid_amount") + else None + ) + _refund_amount=( + self.refund_amount + if hasattr(self, "refund_amount") + else None + ) + _due_amount=( + self.due_amount + if hasattr(self, "due_amount") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _discounts=( + self.discounts + if hasattr(self, "discounts") + else None + ) + _taxes=( + self.taxes + if hasattr(self, "taxes") + else None + ) + _credits=( + self.credits + if hasattr(self, "credits") + else None + ) + _payments=( + self.payments + if hasattr(self, "payments") + else None + ) + _custom_fields=( + self.custom_fields + if hasattr(self, "custom_fields") + else None + ) + _public_url=( + self.public_url + if hasattr(self, "public_url") + else None + ) + _available_actions=( + self.available_actions + if hasattr(self, "available_actions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"site_id={_site_id!s}, " + f"customer_id={_customer_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"number={_number!s}, " + f"sequence_number={_sequence_number!s}, " + f"created_at={_created_at!s}, " + f"delivery_date={_delivery_date!s}, " + f"status={_status!s}, " + f"collection_method={_collection_method!s}, " + f"payment_instructions={_payment_instructions!s}, " + f"currency={_currency!s}, " + f"consolidation_level={_consolidation_level!s}, " + f"product_name={_product_name!s}, " + f"product_family_name={_product_family_name!s}, " + f"role={_role!s}, " + f"seller={_seller!s}, " + f"customer={_customer!s}, " + f"memo={_memo!s}, " + f"billing_address={_billing_address!s}, " + f"shipping_address={_shipping_address!s}, " + f"subtotal_amount={_subtotal_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"total_amount={_total_amount!s}, " + f"credit_amount={_credit_amount!s}, " + f"paid_amount={_paid_amount!s}, " + f"refund_amount={_refund_amount!s}, " + f"due_amount={_due_amount!s}, " + f"line_items={_line_items!s}, " + f"discounts={_discounts!s}, " + f"taxes={_taxes!s}, " + f"credits={_credits!s}, " + f"payments={_payments!s}, " + f"custom_fields={_custom_fields!s}, " + f"public_url={_public_url!s}, " + f"available_actions={_available_actions!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_invoice_credit.py b/advancedbilling/models/proforma_invoice_credit.py index 94da34e3..22d85dc3 100644 --- a/advancedbilling/models/proforma_invoice_credit.py +++ b/advancedbilling/models/proforma_invoice_credit.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ProformaInvoiceCredit(object): - """Implementation of the 'Proforma Invoice Credit' model. Attributes: @@ -18,43 +16,43 @@ class ProformaInvoiceCredit(object): memo (str): The model property of type str. original_amount (str): The model property of type str. applied_amount (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "memo": 'memo', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount' + "uid": "uid", + "memo": "memo", + "original_amount": "original_amount", + "applied_amount": "applied_amount", } _optionals = [ - 'uid', - 'memo', - 'original_amount', - 'applied_amount', + "uid", + "memo", + "original_amount", + "applied_amount", ] - def __init__(self, - uid=APIHelper.SKIP, - memo=APIHelper.SKIP, - original_amount=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProformaInvoiceCredit class""" - + def __init__( + self, + uid=APIHelper.SKIP, + memo=APIHelper.SKIP, + original_amount=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProformaInvoiceCredit instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount + self.original_amount = original_amount if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, memo, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_invoice_discount.py b/advancedbilling/models/proforma_invoice_discount.py index b74a48b4..b2a10551 100644 --- a/advancedbilling/models/proforma_invoice_discount.py +++ b/advancedbilling/models/proforma_invoice_discount.py @@ -1,88 +1,88 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_discount_breakout import InvoiceDiscountBreakout +from advancedbilling.models.invoice_discount_breakout import ( + InvoiceDiscountBreakout, +) class ProformaInvoiceDiscount(object): - """Implementation of the 'Proforma Invoice Discount' model. Attributes: uid (str): The model property of type str. title (str): The model property of type str. code (str): The model property of type str. - source_type (ProformaInvoiceDiscountSourceType): The model property of - type ProformaInvoiceDiscountSourceType. + source_type (ProformaInvoiceDiscountSourceType): The model property of type + ProformaInvoiceDiscountSourceType. discount_type (InvoiceDiscountType): The model property of type InvoiceDiscountType. eligible_amount (str): The model property of type str. discount_amount (str): The model property of type str. - line_item_breakouts (List[InvoiceDiscountBreakout]): The model - property of type List[InvoiceDiscountBreakout]. - additional_properties (Dict[str, object]): The additional properties - for the model. + line_item_breakouts (List[InvoiceDiscountBreakout]): The model property of + type List[InvoiceDiscountBreakout]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "title": 'title', - "code": 'code', - "source_type": 'source_type', - "discount_type": 'discount_type', - "eligible_amount": 'eligible_amount', - "discount_amount": 'discount_amount', - "line_item_breakouts": 'line_item_breakouts' + "uid": "uid", + "title": "title", + "code": "code", + "source_type": "source_type", + "discount_type": "discount_type", + "eligible_amount": "eligible_amount", + "discount_amount": "discount_amount", + "line_item_breakouts": "line_item_breakouts", } _optionals = [ - 'uid', - 'title', - 'code', - 'source_type', - 'discount_type', - 'eligible_amount', - 'discount_amount', - 'line_item_breakouts', + "uid", + "title", + "code", + "source_type", + "discount_type", + "eligible_amount", + "discount_amount", + "line_item_breakouts", ] - def __init__(self, - uid=APIHelper.SKIP, - title=APIHelper.SKIP, - code=APIHelper.SKIP, - source_type=APIHelper.SKIP, - discount_type=APIHelper.SKIP, - eligible_amount=APIHelper.SKIP, - discount_amount=APIHelper.SKIP, - line_item_breakouts=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProformaInvoiceDiscount class""" - + def __init__( + self, + uid=APIHelper.SKIP, + title=APIHelper.SKIP, + code=APIHelper.SKIP, + source_type=APIHelper.SKIP, + discount_type=APIHelper.SKIP, + eligible_amount=APIHelper.SKIP, + discount_amount=APIHelper.SKIP, + line_item_breakouts=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProformaInvoiceDiscount instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if title is not APIHelper.SKIP: - self.title = title + self.title = title if code is not APIHelper.SKIP: - self.code = code + self.code = code if source_type is not APIHelper.SKIP: - self.source_type = source_type + self.source_type = source_type if discount_type is not APIHelper.SKIP: - self.discount_type = discount_type + self.discount_type = discount_type if eligible_amount is not APIHelper.SKIP: - self.eligible_amount = eligible_amount + self.eligible_amount = eligible_amount if discount_amount is not APIHelper.SKIP: - self.discount_amount = discount_amount + self.discount_amount = discount_amount if line_item_breakouts is not APIHelper.SKIP: - self.line_item_breakouts = line_item_breakouts + self.line_item_breakouts = line_item_breakouts # Add additional model properties to the instance if additional_properties is None: @@ -92,7 +92,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -103,25 +103,51 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - source_type = dictionary.get("source_type") if dictionary.get("source_type") else APIHelper.SKIP - discount_type = dictionary.get("discount_type") if dictionary.get("discount_type") else APIHelper.SKIP - eligible_amount = dictionary.get("eligible_amount") if dictionary.get("eligible_amount") else APIHelper.SKIP - discount_amount = dictionary.get("discount_amount") if dictionary.get("discount_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + source_type =\ + dictionary.get("source_type")\ + if dictionary.get("source_type")\ + else APIHelper.SKIP + discount_type =\ + dictionary.get("discount_type")\ + if dictionary.get("discount_type")\ + else APIHelper.SKIP + eligible_amount =\ + dictionary.get("eligible_amount")\ + if dictionary.get("eligible_amount")\ + else APIHelper.SKIP + discount_amount =\ + dictionary.get("discount_amount")\ + if dictionary.get("discount_amount")\ + else APIHelper.SKIP line_item_breakouts = None - if dictionary.get('line_item_breakouts') is not None: - line_item_breakouts = [InvoiceDiscountBreakout.from_dictionary(x) for x in dictionary.get('line_item_breakouts')] + if dictionary.get("line_item_breakouts") is not None: + line_item_breakouts = [ + InvoiceDiscountBreakout.from_dictionary(x) + for x in dictionary.get("line_item_breakouts") + ] else: line_item_breakouts = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, title, @@ -134,25 +160,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!r}, ' - f'discount_type={(self.discount_type if hasattr(self, "discount_type") else None)!r}, ' - f'eligible_amount={(self.eligible_amount if hasattr(self, "eligible_amount") else None)!r}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!r}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _discount_type=( + self.discount_type + if hasattr(self, "discount_type") + else None + ) + _eligible_amount=( + self.eligible_amount + if hasattr(self, "eligible_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"title={_title!r}, " + f"code={_code!r}, " + f"source_type={_source_type!r}, " + f"discount_type={_discount_type!r}, " + f"eligible_amount={_eligible_amount!r}, " + f"discount_amount={_discount_amount!r}, " + f"line_item_breakouts={_line_item_breakouts!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!s}, ' - f'discount_type={(self.discount_type if hasattr(self, "discount_type") else None)!s}, ' - f'eligible_amount={(self.eligible_amount if hasattr(self, "eligible_amount") else None)!s}, ' - f'discount_amount={(self.discount_amount if hasattr(self, "discount_amount") else None)!s}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _discount_type=( + self.discount_type + if hasattr(self, "discount_type") + else None + ) + _eligible_amount=( + self.eligible_amount + if hasattr(self, "eligible_amount") + else None + ) + _discount_amount=( + self.discount_amount + if hasattr(self, "discount_amount") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"title={_title!s}, " + f"code={_code!s}, " + f"source_type={_source_type!s}, " + f"discount_type={_discount_type!s}, " + f"eligible_amount={_eligible_amount!s}, " + f"discount_amount={_discount_amount!s}, " + f"line_item_breakouts={_line_item_breakouts!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_invoice_discount_source_type.py b/advancedbilling/models/proforma_invoice_discount_source_type.py index 4a99f9ab..4c30c745 100644 --- a/advancedbilling/models/proforma_invoice_discount_source_type.py +++ b/advancedbilling/models/proforma_invoice_discount_source_type.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ProformaInvoiceDiscountSourceType(object): - """Implementation of the 'Proforma Invoice Discount Source Type' enum. Attributes: COUPON: The enum member of type str. REFERRAL: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - COUPON = 'Coupon' - REFERRAL = 'Referral' + COUPON = "Coupon" + + REFERRAL = "Referral" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/proforma_invoice_issued.py b/advancedbilling/models/proforma_invoice_issued.py index 0597ec80..d38ad08d 100644 --- a/advancedbilling/models/proforma_invoice_issued.py +++ b/advancedbilling/models/proforma_invoice_issued.py @@ -1,20 +1,21 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 +from datetime import date + import dateutil.parser from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_line_item_event_data import InvoiceLineItemEventData -from datetime import date +from advancedbilling.models.invoice_line_item_event_data import ( + InvoiceLineItemEventData, +) class ProformaInvoiceIssued(object): - """Implementation of the 'Proforma Invoice Issued' model. Attributes: @@ -28,55 +29,58 @@ class ProformaInvoiceIssued(object): tax_amount (str): The model property of type str. total_amount (str): The model property of type str. product_name (str): The model property of type str. - line_items (List[InvoiceLineItemEventData]): The model property of - type List[InvoiceLineItemEventData]. - additional_properties (Dict[str, object]): The additional properties - for the model. + line_items (List[InvoiceLineItemEventData]): The model property of type + List[InvoiceLineItemEventData]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "number": 'number', - "role": 'role', - "delivery_date": 'delivery_date', - "created_at": 'created_at', - "due_amount": 'due_amount', - "paid_amount": 'paid_amount', - "tax_amount": 'tax_amount', - "total_amount": 'total_amount', - "product_name": 'product_name', - "line_items": 'line_items' + "uid": "uid", + "number": "number", + "role": "role", + "delivery_date": "delivery_date", + "created_at": "created_at", + "due_amount": "due_amount", + "paid_amount": "paid_amount", + "tax_amount": "tax_amount", + "total_amount": "total_amount", + "product_name": "product_name", + "line_items": "line_items", } - def __init__(self, - uid=None, - number=None, - role=None, - delivery_date=None, - created_at=None, - due_amount=None, - paid_amount=None, - tax_amount=None, - total_amount=None, - product_name=None, - line_items=None, - additional_properties=None): - """Constructor for the ProformaInvoiceIssued class""" - + def __init__( + self, + uid=None, + number=None, + role=None, + delivery_date=None, + created_at=None, + due_amount=None, + paid_amount=None, + tax_amount=None, + total_amount=None, + product_name=None, + line_items=None, + additional_properties=None): + """Initialize a ProformaInvoiceIssued instance.""" # Initialize members of the class - self.uid = uid - self.number = number - self.role = role - self.delivery_date = delivery_date - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None - self.due_amount = due_amount - self.paid_amount = paid_amount - self.tax_amount = tax_amount - self.total_amount = total_amount - self.product_name = product_name - self.line_items = line_items + self.uid = uid + self.number = number + self.role = role + self.delivery_date = delivery_date + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None + self.due_amount = due_amount + self.paid_amount = paid_amount + self.tax_amount = tax_amount + self.total_amount = total_amount + self.product_name = product_name + self.line_items = line_items # Add additional model properties to the instance if additional_properties is None: @@ -86,7 +90,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -97,26 +101,59 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else None - number = dictionary.get("number") if dictionary.get("number") else None - role = dictionary.get("role") if dictionary.get("role") else None - delivery_date = dateutil.parser.parse(dictionary.get('delivery_date')).date() if dictionary.get('delivery_date') else None - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else None - due_amount = dictionary.get("due_amount") if dictionary.get("due_amount") else None - paid_amount = dictionary.get("paid_amount") if dictionary.get("paid_amount") else None - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else None - total_amount = dictionary.get("total_amount") if dictionary.get("total_amount") else None - product_name = dictionary.get("product_name") if dictionary.get("product_name") else None + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else None + number =\ + dictionary.get("number")\ + if dictionary.get("number")\ + else None + role =\ + dictionary.get("role")\ + if dictionary.get("role")\ + else None + delivery_date = dateutil.parser.parse( + dictionary.get("delivery_date")).date()\ + if dictionary.get("delivery_date") else None + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else None + due_amount =\ + dictionary.get("due_amount")\ + if dictionary.get("due_amount")\ + else None + paid_amount =\ + dictionary.get("paid_amount")\ + if dictionary.get("paid_amount")\ + else None + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else None + total_amount =\ + dictionary.get("total_amount")\ + if dictionary.get("total_amount")\ + else None + product_name =\ + dictionary.get("product_name")\ + if dictionary.get("product_name")\ + else None line_items = None - if dictionary.get('line_items') is not None: - line_items = [InvoiceLineItemEventData.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + InvoiceLineItemEventData.from_dictionary(x) + for x in dictionary.get("line_items") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, number, @@ -133,7 +170,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -144,87 +181,222 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.uid, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.number, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.role, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.delivery_date, - type_callable=lambda value: isinstance(value, date)) \ - and APIHelper.is_valid_type(value=dictionary.created_at, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.due_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.paid_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.tax_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.total_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.product_name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.line_items, - type_callable=lambda value: InvoiceLineItemEventData.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.uid, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.role, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.delivery_date, + type_callable=lambda value: + isinstance( + value, + date, + )) \ + and APIHelper.is_valid_type( + value=dictionary.created_at, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.due_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.paid_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.tax_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.total_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.product_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.line_items, + type_callable=lambda value: + InvoiceLineItemEventData.validate(value), + is_model_dict=True, + is_inner_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('uid'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('number'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('role'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('delivery_date'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('created_at'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('due_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('paid_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('tax_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('total_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('product_name'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('line_items'), - type_callable=lambda value: InvoiceLineItemEventData.validate(value), - is_model_dict=True, - is_inner_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("uid"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("role"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("delivery_date"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("created_at"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("due_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("paid_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("tax_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("total_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("product_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("line_items"), + type_callable=lambda value: + InvoiceLineItemEventData.validate(value), + is_model_dict=True, + is_inner_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={self.uid!r}, ' - f'number={self.number!r}, ' - f'role={self.role!r}, ' - f'delivery_date={self.delivery_date!r}, ' - f'created_at={self.created_at!r}, ' - f'due_amount={self.due_amount!r}, ' - f'paid_amount={self.paid_amount!r}, ' - f'tax_amount={self.tax_amount!r}, ' - f'total_amount={self.total_amount!r}, ' - f'product_name={self.product_name!r}, ' - f'line_items={self.line_items!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=self.uid + _number=self.number + _role=self.role + _delivery_date=self.delivery_date + _created_at=self.created_at + _due_amount=self.due_amount + _paid_amount=self.paid_amount + _tax_amount=self.tax_amount + _total_amount=self.total_amount + _product_name=self.product_name + _line_items=self.line_items + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"number={_number!r}, " + f"role={_role!r}, " + f"delivery_date={_delivery_date!r}, " + f"created_at={_created_at!r}, " + f"due_amount={_due_amount!r}, " + f"paid_amount={_paid_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"total_amount={_total_amount!r}, " + f"product_name={_product_name!r}, " + f"line_items={_line_items!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={self.uid!s}, ' - f'number={self.number!s}, ' - f'role={self.role!s}, ' - f'delivery_date={self.delivery_date!s}, ' - f'created_at={self.created_at!s}, ' - f'due_amount={self.due_amount!s}, ' - f'paid_amount={self.paid_amount!s}, ' - f'tax_amount={self.tax_amount!s}, ' - f'total_amount={self.total_amount!s}, ' - f'product_name={self.product_name!s}, ' - f'line_items={self.line_items!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=self.uid + _number=self.number + _role=self.role + _delivery_date=self.delivery_date + _created_at=self.created_at + _due_amount=self.due_amount + _paid_amount=self.paid_amount + _tax_amount=self.tax_amount + _total_amount=self.total_amount + _product_name=self.product_name + _line_items=self.line_items + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"number={_number!s}, " + f"role={_role!s}, " + f"delivery_date={_delivery_date!s}, " + f"created_at={_created_at!s}, " + f"due_amount={_due_amount!s}, " + f"paid_amount={_paid_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"total_amount={_total_amount!s}, " + f"product_name={_product_name!s}, " + f"line_items={_line_items!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_invoice_payment.py b/advancedbilling/models/proforma_invoice_payment.py index 3eb82995..ef1b9f04 100644 --- a/advancedbilling/models/proforma_invoice_payment.py +++ b/advancedbilling/models/proforma_invoice_payment.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ProformaInvoicePayment(object): - """Implementation of the 'Proforma Invoice Payment' model. Attributes: @@ -18,43 +16,43 @@ class ProformaInvoicePayment(object): original_amount (str): The model property of type str. applied_amount (str): The model property of type str. prepayment (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "memo": 'memo', - "original_amount": 'original_amount', - "applied_amount": 'applied_amount', - "prepayment": 'prepayment' + "memo": "memo", + "original_amount": "original_amount", + "applied_amount": "applied_amount", + "prepayment": "prepayment", } _optionals = [ - 'memo', - 'original_amount', - 'applied_amount', - 'prepayment', + "memo", + "original_amount", + "applied_amount", + "prepayment", ] - def __init__(self, - memo=APIHelper.SKIP, - original_amount=APIHelper.SKIP, - applied_amount=APIHelper.SKIP, - prepayment=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProformaInvoicePayment class""" - + def __init__( + self, + memo=APIHelper.SKIP, + original_amount=APIHelper.SKIP, + applied_amount=APIHelper.SKIP, + prepayment=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProformaInvoicePayment instance.""" # Initialize members of the class if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount + self.original_amount = original_amount if applied_amount is not APIHelper.SKIP: - self.applied_amount = applied_amount + self.applied_amount = applied_amount if prepayment is not APIHelper.SKIP: - self.prepayment = prepayment + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else APIHelper.SKIP - prepayment = dictionary.get("prepayment") if "prepayment" in dictionary.keys() else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else APIHelper.SKIP + prepayment =\ + dictionary.get("prepayment")\ + if "prepayment" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(memo, original_amount, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!r}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'applied_amount={(self.applied_amount if hasattr(self, "applied_amount") else None)!s}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=( + self.applied_amount + if hasattr(self, "applied_amount") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_invoice_role.py b/advancedbilling/models/proforma_invoice_role.py index 27cf496d..b3198e69 100644 --- a/advancedbilling/models/proforma_invoice_role.py +++ b/advancedbilling/models/proforma_invoice_role.py @@ -1,39 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ProformaInvoiceRole(object): - """Implementation of the 'Proforma Invoice Role' enum. - 'proforma' value is deprecated in favor of proforma_adhoc and - proforma_automatic + 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic Attributes: UNSET: The enum member of type str. PROFORMA: The enum member of type str. PROFORMA_ADHOC: The enum member of type str. PROFORMA_AUTOMATIC: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - UNSET = 'unset' - PROFORMA = 'proforma' + UNSET = "unset" + + PROFORMA = "proforma" - PROFORMA_ADHOC = 'proforma_adhoc' + PROFORMA_ADHOC = "proforma_adhoc" - PROFORMA_AUTOMATIC = 'proforma_automatic' + PROFORMA_AUTOMATIC = "proforma_automatic" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/proforma_invoice_status.py b/advancedbilling/models/proforma_invoice_status.py index 502b5a8d..26fb133a 100644 --- a/advancedbilling/models/proforma_invoice_status.py +++ b/advancedbilling/models/proforma_invoice_status.py @@ -1,33 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ProformaInvoiceStatus(object): - """Implementation of the 'Proforma Invoice Status' enum. Attributes: DRAFT: The enum member of type str. VOIDED: The enum member of type str. ARCHIVED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - DRAFT = 'draft' - VOIDED = 'voided' + DRAFT = "draft" + + VOIDED = "voided" - ARCHIVED = 'archived' + ARCHIVED = "archived" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/proforma_invoice_tax.py b/advancedbilling/models/proforma_invoice_tax.py index b060f4c8..0de116ad 100644 --- a/advancedbilling/models/proforma_invoice_tax.py +++ b/advancedbilling/models/proforma_invoice_tax.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_tax_breakout import InvoiceTaxBreakout +from advancedbilling.models.invoice_tax_breakout import ( + InvoiceTaxBreakout, +) class ProformaInvoiceTax(object): - """Implementation of the 'Proforma Invoice Tax' model. Attributes: @@ -22,60 +22,60 @@ class ProformaInvoiceTax(object): percentage (str): The model property of type str. taxable_amount (str): The model property of type str. tax_amount (str): The model property of type str. - line_item_breakouts (List[InvoiceTaxBreakout]): The model property of - type List[InvoiceTaxBreakout]. - additional_properties (Dict[str, object]): The additional properties - for the model. + line_item_breakouts (List[InvoiceTaxBreakout]): The model property of type + List[InvoiceTaxBreakout]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "title": 'title', - "source_type": 'source_type', - "percentage": 'percentage', - "taxable_amount": 'taxable_amount', - "tax_amount": 'tax_amount', - "line_item_breakouts": 'line_item_breakouts' + "uid": "uid", + "title": "title", + "source_type": "source_type", + "percentage": "percentage", + "taxable_amount": "taxable_amount", + "tax_amount": "tax_amount", + "line_item_breakouts": "line_item_breakouts", } _optionals = [ - 'uid', - 'title', - 'source_type', - 'percentage', - 'taxable_amount', - 'tax_amount', - 'line_item_breakouts', + "uid", + "title", + "source_type", + "percentage", + "taxable_amount", + "tax_amount", + "line_item_breakouts", ] - def __init__(self, - uid=APIHelper.SKIP, - title=APIHelper.SKIP, - source_type=APIHelper.SKIP, - percentage=APIHelper.SKIP, - taxable_amount=APIHelper.SKIP, - tax_amount=APIHelper.SKIP, - line_item_breakouts=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ProformaInvoiceTax class""" - + def __init__( + self, + uid=APIHelper.SKIP, + title=APIHelper.SKIP, + source_type=APIHelper.SKIP, + percentage=APIHelper.SKIP, + taxable_amount=APIHelper.SKIP, + tax_amount=APIHelper.SKIP, + line_item_breakouts=APIHelper.SKIP, + additional_properties=None): + """Initialize a ProformaInvoiceTax instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if title is not APIHelper.SKIP: - self.title = title + self.title = title if source_type is not APIHelper.SKIP: - self.source_type = source_type + self.source_type = source_type if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage if taxable_amount is not APIHelper.SKIP: - self.taxable_amount = taxable_amount + self.taxable_amount = taxable_amount if tax_amount is not APIHelper.SKIP: - self.tax_amount = tax_amount + self.tax_amount = tax_amount if line_item_breakouts is not APIHelper.SKIP: - self.line_item_breakouts = line_item_breakouts + self.line_item_breakouts = line_item_breakouts # Add additional model properties to the instance if additional_properties is None: @@ -85,7 +85,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -96,24 +96,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP - source_type = dictionary.get("source_type") if dictionary.get("source_type") else APIHelper.SKIP - percentage = dictionary.get("percentage") if dictionary.get("percentage") else APIHelper.SKIP - taxable_amount = dictionary.get("taxable_amount") if dictionary.get("taxable_amount") else APIHelper.SKIP - tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + source_type =\ + dictionary.get("source_type")\ + if dictionary.get("source_type")\ + else APIHelper.SKIP + percentage =\ + dictionary.get("percentage")\ + if dictionary.get("percentage")\ + else APIHelper.SKIP + taxable_amount =\ + dictionary.get("taxable_amount")\ + if dictionary.get("taxable_amount")\ + else APIHelper.SKIP + tax_amount =\ + dictionary.get("tax_amount")\ + if dictionary.get("tax_amount")\ + else APIHelper.SKIP line_item_breakouts = None - if dictionary.get('line_item_breakouts') is not None: - line_item_breakouts = [InvoiceTaxBreakout.from_dictionary(x) for x in dictionary.get('line_item_breakouts')] + if dictionary.get("line_item_breakouts") is not None: + line_item_breakouts = [ + InvoiceTaxBreakout.from_dictionary(x) + for x in dictionary.get("line_item_breakouts") + ] else: line_item_breakouts = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, title, @@ -125,23 +148,103 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'title={(self.title if hasattr(self, "title") else None)!r}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!r}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!r}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"title={_title!r}, " + f"source_type={_source_type!r}, " + f"percentage={_percentage!r}, " + f"taxable_amount={_taxable_amount!r}, " + f"tax_amount={_tax_amount!r}, " + f"line_item_breakouts={_line_item_breakouts!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'title={(self.title if hasattr(self, "title") else None)!s}, ' - f'source_type={(self.source_type if hasattr(self, "source_type") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'taxable_amount={(self.taxable_amount if hasattr(self, "taxable_amount") else None)!s}, ' - f'tax_amount={(self.tax_amount if hasattr(self, "tax_amount") else None)!s}, ' - f'line_item_breakouts={(self.line_item_breakouts if hasattr(self, "line_item_breakouts") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _title=( + self.title + if hasattr(self, "title") + else None + ) + _source_type=( + self.source_type + if hasattr(self, "source_type") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _taxable_amount=( + self.taxable_amount + if hasattr(self, "taxable_amount") + else None + ) + _tax_amount=( + self.tax_amount + if hasattr(self, "tax_amount") + else None + ) + _line_item_breakouts=( + self.line_item_breakouts + if hasattr(self, "line_item_breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"title={_title!s}, " + f"source_type={_source_type!s}, " + f"percentage={_percentage!s}, " + f"taxable_amount={_taxable_amount!s}, " + f"tax_amount={_tax_amount!s}, " + f"line_item_breakouts={_line_item_breakouts!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/proforma_invoice_tax_source_type.py b/advancedbilling/models/proforma_invoice_tax_source_type.py index 09a696db..97c48f84 100644 --- a/advancedbilling/models/proforma_invoice_tax_source_type.py +++ b/advancedbilling/models/proforma_invoice_tax_source_type.py @@ -1,32 +1,30 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ProformaInvoiceTaxSourceType(object): - """Implementation of the 'Proforma Invoice Tax Source Type' enum. Attributes: TAX: The enum member of type str. AVALARA: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['Tax', 'Avalara'] - TAX = 'Tax' - AVALARA = 'Avalara' + _all_values = ["Tax", "Avalara"] + TAX = "Tax" + + AVALARA = "Avalara" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -36,9 +34,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/proration.py b/advancedbilling/models/proration.py index 729151e0..0a719ad4 100644 --- a/advancedbilling/models/proration.py +++ b/advancedbilling/models/proration.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Proration(object): - """Implementation of the 'Proration' model. Attributes: - preserve_period (bool): The alternative to sending preserve_period as - a direct attribute to migration - additional_properties (Dict[str, object]): The additional properties - for the model. + preserve_period (bool): The alternative to sending preserve_period as a + direct attribute to migration + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "preserve_period": 'preserve_period' + "preserve_period": "preserve_period", } _optionals = [ - 'preserve_period', + "preserve_period", ] - def __init__(self, - preserve_period=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Proration class""" - + def __init__( + self, + preserve_period=APIHelper.SKIP, + additional_properties=None): + """Initialize a Proration instance.""" # Initialize members of the class if preserve_period is not APIHelper.SKIP: - self.preserve_period = preserve_period + self.preserve_period = preserve_period # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +56,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - preserve_period = dictionary.get("preserve_period") if "preserve_period" in dictionary.keys() else APIHelper.SKIP + preserve_period =\ + dictionary.get("preserve_period")\ + if "preserve_period" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(preserve_period, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'preserve_period={(self.preserve_period if hasattr(self, "preserve_period") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _preserve_period=( + self.preserve_period + if hasattr(self, "preserve_period") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"preserve_period={_preserve_period!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'preserve_period={(self.preserve_period if hasattr(self, "preserve_period") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _preserve_period=( + self.preserve_period + if hasattr(self, "preserve_period") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"preserve_period={_preserve_period!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/public_key.py b/advancedbilling/models/public_key.py index b0b870bc..b7a259ea 100644 --- a/advancedbilling/models/public_key.py +++ b/advancedbilling/models/public_key.py @@ -1,54 +1,55 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PublicKey(object): - """Implementation of the 'Public Key' model. Attributes: public_key (str): The model property of type str. requires_security_token (bool): The model property of type bool. created_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "public_key": 'public_key', - "requires_security_token": 'requires_security_token', - "created_at": 'created_at' + "public_key": "public_key", + "requires_security_token": "requires_security_token", + "created_at": "created_at", } _optionals = [ - 'public_key', - 'requires_security_token', - 'created_at', + "public_key", + "requires_security_token", + "created_at", ] - def __init__(self, - public_key=APIHelper.SKIP, - requires_security_token=APIHelper.SKIP, - created_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PublicKey class""" - + def __init__( + self, + public_key=APIHelper.SKIP, + requires_security_token=APIHelper.SKIP, + created_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a PublicKey instance.""" # Initialize members of the class if public_key is not APIHelper.SKIP: - self.public_key = public_key + self.public_key = public_key if requires_security_token is not APIHelper.SKIP: - self.requires_security_token = requires_security_token + self.requires_security_token = requires_security_token if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +59,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +70,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - public_key = dictionary.get("public_key") if dictionary.get("public_key") else APIHelper.SKIP - requires_security_token = dictionary.get("requires_security_token") if "requires_security_token" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP + public_key =\ + dictionary.get("public_key")\ + if dictionary.get("public_key")\ + else APIHelper.SKIP + requires_security_token =\ + dictionary.get("requires_security_token")\ + if "requires_security_token" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(public_key, requires_security_token, @@ -86,15 +97,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'public_key={(self.public_key if hasattr(self, "public_key") else None)!r}, ' - f'requires_security_token={(self.requires_security_token if hasattr(self, "requires_security_token") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _public_key=( + self.public_key + if hasattr(self, "public_key") + else None + ) + _requires_security_token=( + self.requires_security_token + if hasattr(self, "requires_security_token") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"public_key={_public_key!r}, " + f"requires_security_token={_requires_security_token!r}, " + f"created_at={_created_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'public_key={(self.public_key if hasattr(self, "public_key") else None)!s}, ' - f'requires_security_token={(self.requires_security_token if hasattr(self, "requires_security_token") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _public_key=( + self.public_key + if hasattr(self, "public_key") + else None + ) + _requires_security_token=( + self.requires_security_token + if hasattr(self, "requires_security_token") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"public_key={_public_key!s}, " + f"requires_security_token={_requires_security_token!s}, " + f"created_at={_created_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/public_signup_page.py b/advancedbilling/models/public_signup_page.py index a6326e40..4985bed6 100644 --- a/advancedbilling/models/public_signup_page.py +++ b/advancedbilling/models/public_signup_page.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class PublicSignupPage(object): - """Implementation of the 'Public Signup Page' model. Attributes: @@ -19,50 +17,50 @@ class PublicSignupPage(object): successful signup (public_signup_pages only) return_params (str): The params to be appended to the return_url (public_signup_pages only) - url (str): The url where the signup page can be viewed - (public_signup_pages only) - additional_properties (Dict[str, object]): The additional properties - for the model. + url (str): The url where the signup page can be viewed (public_signup_pages + only) + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "return_url": 'return_url', - "return_params": 'return_params', - "url": 'url' + "id": "id", + "return_url": "return_url", + "return_params": "return_params", + "url": "url", } _optionals = [ - 'id', - 'return_url', - 'return_params', - 'url', + "id", + "return_url", + "return_params", + "url", ] _nullables = [ - 'return_url', - 'return_params', + "return_url", + "return_params", ] - def __init__(self, - id=APIHelper.SKIP, - return_url=APIHelper.SKIP, - return_params=APIHelper.SKIP, - url=APIHelper.SKIP, - additional_properties=None): - """Constructor for the PublicSignupPage class""" - + def __init__( + self, + id=APIHelper.SKIP, + return_url=APIHelper.SKIP, + return_params=APIHelper.SKIP, + url=APIHelper.SKIP, + additional_properties=None): + """Initialize a PublicSignupPage instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if return_url is not APIHelper.SKIP: - self.return_url = return_url + self.return_url = return_url if return_params is not APIHelper.SKIP: - self.return_params = return_params + self.return_params = return_params if url is not APIHelper.SKIP: - self.url = url + self.url = url # Add additional model properties to the instance if additional_properties is None: @@ -72,7 +70,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -83,17 +81,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - return_url = dictionary.get("return_url") if "return_url" in dictionary.keys() else APIHelper.SKIP - return_params = dictionary.get("return_params") if "return_params" in dictionary.keys() else APIHelper.SKIP - url = dictionary.get("url") if dictionary.get("url") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + return_url =\ + dictionary.get("return_url")\ + if "return_url" in dictionary.keys()\ + else APIHelper.SKIP + return_params =\ + dictionary.get("return_params")\ + if "return_params" in dictionary.keys()\ + else APIHelper.SKIP + url =\ + dictionary.get("url")\ + if dictionary.get("url")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, return_url, @@ -103,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -114,7 +126,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -124,17 +135,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'return_url={(self.return_url if hasattr(self, "return_url") else None)!r}, ' - f'return_params={(self.return_params if hasattr(self, "return_params") else None)!r}, ' - f'url={(self.url if hasattr(self, "url") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _return_url=( + self.return_url + if hasattr(self, "return_url") + else None + ) + _return_params=( + self.return_params + if hasattr(self, "return_params") + else None + ) + _url=( + self.url + if hasattr(self, "url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"return_url={_return_url!r}, " + f"return_params={_return_params!r}, " + f"url={_url!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'return_url={(self.return_url if hasattr(self, "return_url") else None)!s}, ' - f'return_params={(self.return_params if hasattr(self, "return_params") else None)!s}, ' - f'url={(self.url if hasattr(self, "url") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _return_url=( + self.return_url + if hasattr(self, "return_url") + else None + ) + _return_params=( + self.return_params + if hasattr(self, "return_params") + else None + ) + _url=( + self.url + if hasattr(self, "url") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"return_url={_return_url!s}, " + f"return_params={_return_params!s}, " + f"url={_url!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/quantity_based_component.py b/advancedbilling/models/quantity_based_component.py index aa026302..022bede5 100644 --- a/advancedbilling/models/quantity_based_component.py +++ b/advancedbilling/models/quantity_based_component.py @@ -1,192 +1,185 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.component_price_point_item import ( + ComponentPricePointItem, +) from advancedbilling.models.price import Price class QuantityBasedComponent(object): - """Implementation of the 'Quantity Based Component' model. Attributes: - name (str): A name for this component that is suitable for showing - customers and displaying on billing statements, ie. "Minutes". - unit_name (str): The name of the unit of measurement for the - component. It should be singular since it will be automatically - pluralized when necessary. i.e. “message”, which may then be shown - as “5 messages” on a subscription’s component line-item - description (str): A description for the component that will be - displayed to the user on the hosted signup page. - handle (str): A unique identifier for your use that can be used to - retrieve this component is subsequent requests. Must start with a - letter or number and may only contain lowercase letters, numbers, - or the characters '.', ':', '-', or '_'. - taxable (bool): Boolean flag describing whether a component is taxable - or not. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. - prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) - One or more price brackets. See [Price Bracket - Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-C - omponent-Pricing-Schemes#price-bracket-rules) for an overview of - how price brackets work for different pricing schemes. + name (str): A name for this component that is suitable for showing customers + and displaying on billing statements, ie. "Minutes". + unit_name (str): The name of the unit of measurement for the component. It + should be singular since it will be automatically pluralized when + necessary. i.e. “message”, which may then be shown as “5 messages” on a + subscription’s component line-item + description (str): A description for the component that will be displayed to + the user on the hosted signup page. + handle (str): A unique identifier for your use that can be used to retrieve + this component is subsequent requests. Must start with a letter or + number and may only contain lowercase letters, numbers, or the characters + '.', ':', '-', or '_'. + taxable (bool): Boolean flag describing whether a component is taxable or not. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. + prices (List[Price]): (Not required for ‘per_unit’ pricing schemes) One or + more price brackets. See [Price Bracket + Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Componen + t-Pricing-Schemes#price-bracket-rules) for an overview of how price + brackets work for different pricing schemes. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - price_points (List[ComponentPricePointItem]): The model property of - type List[ComponentPricePointItem]. - unit_price (str | float | None): The amount the customer will be - charged per unit when the pricing scheme is “per_unit”. For On/Off - Components, this is the amount that the customer will be charged - when they turn the component on for the subscription. The price - can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or - 0.00000065 - tax_code (str): A string representing the tax code related to the - component type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. - hide_date_range_on_invoice (bool): (Only available on Relationship - Invoicing sites) Boolean flag describing if the service date range - should show for the component on generated invoices. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. + price_points (List[ComponentPricePointItem]): The model property of type + List[ComponentPricePointItem]. + unit_price (str | float | None): The amount the customer will be charged per + unit when the pricing scheme is “per_unit”. For On/Off Components, this + is the amount that the customer will be charged when they turn the + component on for the subscription. The price can contain up to 8 decimal + places. i.e. 1.00 or 0.0012 or 0.00000065 + tax_code (str): A string representing the tax code related to the component + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. + hide_date_range_on_invoice (bool): (Only available on Relationship Invoicing + sites) Boolean flag describing if the service date range should show for + the component on generated invoices. recurring (bool): The model property of type bool. display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. - public_signup_page_ids (List[int]): The model property of type - List[int]. - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component's - default price point would renew every 30 days. This property is - only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component's default price point, either month or day. - This property is only available for sites with Multifrequency - enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + public_signup_page_ids (List[int]): The model property of type List[int]. + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component's default price point + would renew every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component's default price point, either month or day. This property + is only available for sites with Multifrequency enabled. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "unit_name": 'unit_name', - "pricing_scheme": 'pricing_scheme', - "description": 'description', - "handle": 'handle', - "taxable": 'taxable', - "prices": 'prices', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "price_points": 'price_points', - "unit_price": 'unit_price', - "tax_code": 'tax_code', - "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "recurring": 'recurring', - "display_on_hosted_page": 'display_on_hosted_page', - "allow_fractional_quantities": 'allow_fractional_quantities', - "public_signup_page_ids": 'public_signup_page_ids', - "interval": 'interval', - "interval_unit": 'interval_unit' + "name": "name", + "unit_name": "unit_name", + "pricing_scheme": "pricing_scheme", + "description": "description", + "handle": "handle", + "taxable": "taxable", + "prices": "prices", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "price_points": "price_points", + "unit_price": "unit_price", + "tax_code": "tax_code", + "hide_date_range_on_invoice": "hide_date_range_on_invoice", + "recurring": "recurring", + "display_on_hosted_page": "display_on_hosted_page", + "allow_fractional_quantities": "allow_fractional_quantities", + "public_signup_page_ids": "public_signup_page_ids", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'description', - 'handle', - 'taxable', - 'prices', - 'upgrade_charge', - 'downgrade_credit', - 'price_points', - 'unit_price', - 'tax_code', - 'hide_date_range_on_invoice', - 'recurring', - 'display_on_hosted_page', - 'allow_fractional_quantities', - 'public_signup_page_ids', - 'interval', - 'interval_unit', + "description", + "handle", + "taxable", + "prices", + "upgrade_charge", + "downgrade_credit", + "price_points", + "unit_price", + "tax_code", + "hide_date_range_on_invoice", + "recurring", + "display_on_hosted_page", + "allow_fractional_quantities", + "public_signup_page_ids", + "interval", + "interval_unit", ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', - 'interval_unit', + "upgrade_charge", + "downgrade_credit", + "interval_unit", ] - def __init__(self, - name=None, - unit_name=None, - pricing_scheme=None, - description=APIHelper.SKIP, - handle=APIHelper.SKIP, - taxable=APIHelper.SKIP, - prices=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - price_points=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - hide_date_range_on_invoice=APIHelper.SKIP, - recurring=APIHelper.SKIP, - display_on_hosted_page=APIHelper.SKIP, - allow_fractional_quantities=APIHelper.SKIP, - public_signup_page_ids=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the QuantityBasedComponent class""" - + def __init__( + self, + name=None, + unit_name=None, + pricing_scheme=None, + description=APIHelper.SKIP, + handle=APIHelper.SKIP, + taxable=APIHelper.SKIP, + prices=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + price_points=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + hide_date_range_on_invoice=APIHelper.SKIP, + recurring=APIHelper.SKIP, + display_on_hosted_page=APIHelper.SKIP, + allow_fractional_quantities=APIHelper.SKIP, + public_signup_page_ids=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a QuantityBasedComponent instance.""" # Initialize members of the class - self.name = name - self.unit_name = unit_name + self.name = name + self.unit_name = unit_name if description is not APIHelper.SKIP: - self.description = description + self.description = description if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if taxable is not APIHelper.SKIP: - self.taxable = taxable - self.pricing_scheme = pricing_scheme + self.taxable = taxable + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if price_points is not APIHelper.SKIP: - self.price_points = price_points + self.price_points = price_points if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if hide_date_range_on_invoice is not APIHelper.SKIP: - self.hide_date_range_on_invoice = hide_date_range_on_invoice + self.hide_date_range_on_invoice = hide_date_range_on_invoice if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring if display_on_hosted_page is not APIHelper.SKIP: - self.display_on_hosted_page = display_on_hosted_page + self.display_on_hosted_page = display_on_hosted_page if allow_fractional_quantities is not APIHelper.SKIP: - self.allow_fractional_quantities = allow_fractional_quantities + self.allow_fractional_quantities = allow_fractional_quantities if public_signup_page_ids is not APIHelper.SKIP: - self.public_signup_page_ids = public_signup_page_ids + self.public_signup_page_ids = public_signup_page_ids if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -196,7 +189,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -207,41 +200,105 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - unit_name = dictionary.get("unit_name") if dictionary.get("unit_name") else None - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else None + unit_name =\ + dictionary.get("unit_name")\ + if dictionary.get("unit_name")\ + else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP price_points = None - if dictionary.get('price_points') is not None: - price_points = [ComponentPricePointItem.from_dictionary(x) for x in dictionary.get('price_points')] + if dictionary.get("price_points") is not None: + price_points = [ + ComponentPricePointItem.from_dictionary(x) + for x in dictionary.get("price_points") + ] else: price_points = APIHelper.SKIP - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('QuantityBasedComponentUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP - hide_date_range_on_invoice = dictionary.get("hide_date_range_on_invoice") if "hide_date_range_on_invoice" in dictionary.keys() else APIHelper.SKIP - recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP - display_on_hosted_page = dictionary.get("display_on_hosted_page") if "display_on_hosted_page" in dictionary.keys() else APIHelper.SKIP - allow_fractional_quantities = dictionary.get("allow_fractional_quantities") if "allow_fractional_quantities" in dictionary.keys() else APIHelper.SKIP - public_signup_page_ids = dictionary.get("public_signup_page_ids") if dictionary.get("public_signup_page_ids") else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("QuantityBasedComponentUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + hide_date_range_on_invoice =\ + dictionary.get("hide_date_range_on_invoice")\ + if "hide_date_range_on_invoice" in dictionary.keys()\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if "recurring" in dictionary.keys()\ + else APIHelper.SKIP + display_on_hosted_page =\ + dictionary.get("display_on_hosted_page")\ + if "display_on_hosted_page" in dictionary.keys()\ + else APIHelper.SKIP + allow_fractional_quantities =\ + dictionary.get("allow_fractional_quantities")\ + if "allow_fractional_quantities" in dictionary.keys()\ + else APIHelper.SKIP + public_signup_page_ids =\ + dictionary.get("public_signup_page_ids")\ + if dictionary.get("public_signup_page_ids")\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, unit_name, @@ -265,47 +322,223 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!r}, ' - f'unit_name={self.unit_name!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!r}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!r}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"unit_name={_unit_name!r}, " + f"description={_description!r}, " + f"handle={_handle!r}, " + f"taxable={_taxable!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"price_points={_price_points!r}, " + f"unit_price={_unit_price!r}, " + f"tax_code={_tax_code!r}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!r}, " + f"recurring={_recurring!r}, " + f"display_on_hosted_page={_display_on_hosted_page!r}, " + f"allow_fractional_quantities={_allow_fractional_quantities!r}, " + f"public_signup_page_ids={_public_signup_page_ids!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={self.name!s}, ' - f'unit_name={self.unit_name!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'price_points={(self.price_points if hasattr(self, "price_points") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'hide_date_range_on_invoice={(self.hide_date_range_on_invoice if hasattr(self, "hide_date_range_on_invoice") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!s}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!s}, ' - f'public_signup_page_ids={(self.public_signup_page_ids if hasattr(self, "public_signup_page_ids") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=self.name + _unit_name=self.unit_name + _description=( + self.description + if hasattr(self, "description") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _price_points=( + self.price_points + if hasattr(self, "price_points") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _hide_date_range_on_invoice=( + self.hide_date_range_on_invoice + if hasattr(self, "hide_date_range_on_invoice") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _public_signup_page_ids=( + self.public_signup_page_ids + if hasattr(self, "public_signup_page_ids") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"unit_name={_unit_name!s}, " + f"description={_description!s}, " + f"handle={_handle!s}, " + f"taxable={_taxable!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"price_points={_price_points!s}, " + f"unit_price={_unit_price!s}, " + f"tax_code={_tax_code!s}, " + f"hide_date_range_on_invoice={_hide_date_range_on_invoice!s}, " + f"recurring={_recurring!s}, " + f"display_on_hosted_page={_display_on_hosted_page!s}, " + f"allow_fractional_quantities={_allow_fractional_quantities!s}, " + f"public_signup_page_ids={_public_signup_page_ids!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/reactivate_subscription_group_request.py b/advancedbilling/models/reactivate_subscription_group_request.py index 1b085375..8e858305 100644 --- a/advancedbilling/models/reactivate_subscription_group_request.py +++ b/advancedbilling/models/reactivate_subscription_group_request.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ReactivateSubscriptionGroupRequest(object): - """Implementation of the 'Reactivate Subscription Group Request' model. Attributes: resume (bool): The model property of type bool. resume_members (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "resume": 'resume', - "resume_members": 'resume_members' + "resume": "resume", + "resume_members": "resume_members", } _optionals = [ - 'resume', - 'resume_members', + "resume", + "resume_members", ] - def __init__(self, - resume=APIHelper.SKIP, - resume_members=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ReactivateSubscriptionGroupRequest class""" - + def __init__( + self, + resume=APIHelper.SKIP, + resume_members=APIHelper.SKIP, + additional_properties=None): + """Initialize a ReactivateSubscriptionGroupRequest instance.""" # Initialize members of the class if resume is not APIHelper.SKIP: - self.resume = resume + self.resume = resume if resume_members is not APIHelper.SKIP: - self.resume_members = resume_members + self.resume_members = resume_members # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - resume = dictionary.get("resume") if "resume" in dictionary.keys() else APIHelper.SKIP - resume_members = dictionary.get("resume_members") if "resume_members" in dictionary.keys() else APIHelper.SKIP + resume =\ + dictionary.get("resume")\ + if "resume" in dictionary.keys()\ + else APIHelper.SKIP + resume_members =\ + dictionary.get("resume_members")\ + if "resume_members" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(resume, resume_members, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'resume={(self.resume if hasattr(self, "resume") else None)!r}, ' - f'resume_members={(self.resume_members if hasattr(self, "resume_members") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _resume=( + self.resume + if hasattr(self, "resume") + else None + ) + _resume_members=( + self.resume_members + if hasattr(self, "resume_members") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"resume={_resume!r}, " + f"resume_members={_resume_members!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'resume={(self.resume if hasattr(self, "resume") else None)!s}, ' - f'resume_members={(self.resume_members if hasattr(self, "resume_members") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _resume=( + self.resume + if hasattr(self, "resume") + else None + ) + _resume_members=( + self.resume_members + if hasattr(self, "resume_members") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"resume={_resume!s}, " + f"resume_members={_resume_members!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/reactivate_subscription_group_response.py b/advancedbilling/models/reactivate_subscription_group_response.py index 9d38edde..355f9e95 100644 --- a/advancedbilling/models/reactivate_subscription_group_response.py +++ b/advancedbilling/models/reactivate_subscription_group_response.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ReactivateSubscriptionGroupResponse(object): - """Implementation of the 'Reactivate Subscription Group Response' model. Attributes: @@ -23,68 +21,71 @@ class ReactivateSubscriptionGroupResponse(object): next_assessment_at (datetime): The model property of type datetime. state (str): The model property of type str. cancel_at_end_of_period (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "scheme": 'scheme', - "customer_id": 'customer_id', - "payment_profile_id": 'payment_profile_id', - "subscription_ids": 'subscription_ids', - "primary_subscription_id": 'primary_subscription_id', - "next_assessment_at": 'next_assessment_at', - "state": 'state', - "cancel_at_end_of_period": 'cancel_at_end_of_period' + "uid": "uid", + "scheme": "scheme", + "customer_id": "customer_id", + "payment_profile_id": "payment_profile_id", + "subscription_ids": "subscription_ids", + "primary_subscription_id": "primary_subscription_id", + "next_assessment_at": "next_assessment_at", + "state": "state", + "cancel_at_end_of_period": "cancel_at_end_of_period", } _optionals = [ - 'uid', - 'scheme', - 'customer_id', - 'payment_profile_id', - 'subscription_ids', - 'primary_subscription_id', - 'next_assessment_at', - 'state', - 'cancel_at_end_of_period', + "uid", + "scheme", + "customer_id", + "payment_profile_id", + "subscription_ids", + "primary_subscription_id", + "next_assessment_at", + "state", + "cancel_at_end_of_period", ] - def __init__(self, - uid=APIHelper.SKIP, - scheme=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - subscription_ids=APIHelper.SKIP, - primary_subscription_id=APIHelper.SKIP, - next_assessment_at=APIHelper.SKIP, - state=APIHelper.SKIP, - cancel_at_end_of_period=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ReactivateSubscriptionGroupResponse class""" - + def __init__( + self, + uid=APIHelper.SKIP, + scheme=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + subscription_ids=APIHelper.SKIP, + primary_subscription_id=APIHelper.SKIP, + next_assessment_at=APIHelper.SKIP, + state=APIHelper.SKIP, + cancel_at_end_of_period=APIHelper.SKIP, + additional_properties=None): + """Initialize a ReactivateSubscriptionGroupResponse instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if scheme is not APIHelper.SKIP: - self.scheme = scheme + self.scheme = scheme if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if subscription_ids is not APIHelper.SKIP: - self.subscription_ids = subscription_ids + self.subscription_ids = subscription_ids if primary_subscription_id is not APIHelper.SKIP: - self.primary_subscription_id = primary_subscription_id + self.primary_subscription_id = primary_subscription_id if next_assessment_at is not APIHelper.SKIP: - self.next_assessment_at = APIHelper.apply_datetime_converter(next_assessment_at, APIHelper.RFC3339DateTime) if next_assessment_at else None + self.next_assessment_at =\ + APIHelper.apply_datetime_converter( + next_assessment_at, APIHelper.RFC3339DateTime)\ + if next_assessment_at else None if state is not APIHelper.SKIP: - self.state = state + self.state = state if cancel_at_end_of_period is not APIHelper.SKIP: - self.cancel_at_end_of_period = cancel_at_end_of_period + self.cancel_at_end_of_period = cancel_at_end_of_period # Add additional model properties to the instance if additional_properties is None: @@ -94,7 +95,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -105,22 +106,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - scheme = dictionary.get("scheme") if dictionary.get("scheme") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - subscription_ids = dictionary.get("subscription_ids") if dictionary.get("subscription_ids") else APIHelper.SKIP - primary_subscription_id = dictionary.get("primary_subscription_id") if dictionary.get("primary_subscription_id") else APIHelper.SKIP - next_assessment_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_assessment_at")).datetime if dictionary.get("next_assessment_at") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - cancel_at_end_of_period = dictionary.get("cancel_at_end_of_period") if "cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + scheme =\ + dictionary.get("scheme")\ + if dictionary.get("scheme")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + subscription_ids =\ + dictionary.get("subscription_ids")\ + if dictionary.get("subscription_ids")\ + else APIHelper.SKIP + primary_subscription_id =\ + dictionary.get("primary_subscription_id")\ + if dictionary.get("primary_subscription_id")\ + else APIHelper.SKIP + next_assessment_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_assessment_at")).datetime\ + if dictionary.get("next_assessment_at") else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + cancel_at_end_of_period =\ + dictionary.get("cancel_at_end_of_period")\ + if "cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, scheme, @@ -134,27 +163,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!r}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!r}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"scheme={_scheme!r}, " + f"customer_id={_customer_id!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"subscription_ids={_subscription_ids!r}, " + f"primary_subscription_id={_primary_subscription_id!r}, " + f"next_assessment_at={_next_assessment_at!r}, " + f"state={_state!r}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!s}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!s}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"scheme={_scheme!s}, " + f"customer_id={_customer_id!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"subscription_ids={_subscription_ids!s}, " + f"primary_subscription_id={_primary_subscription_id!s}, " + f"next_assessment_at={_next_assessment_at!s}, " + f"state={_state!s}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/reactivate_subscription_request.py b/advancedbilling/models/reactivate_subscription_request.py index 73074d59..ff3834cd 100644 --- a/advancedbilling/models/reactivate_subscription_request.py +++ b/advancedbilling/models/reactivate_subscription_request.py @@ -1,83 +1,85 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.reactivation_billing import ReactivationBilling +from advancedbilling.models.reactivation_billing import ( + ReactivationBilling, +) class ReactivateSubscriptionRequest(object): - """Implementation of the 'Reactivate Subscription Request' model. Attributes: - calendar_billing (ReactivationBilling): These values are only - applicable to subscriptions using calendar billing - include_trial (bool): If `true` is sent, the reactivated Subscription - will include a trial if one is available. If `false` is sent, the - trial period will be ignored. - preserve_balance (bool): If `true` is passed, the existing - subscription balance will NOT be cleared/reset before adding the - additional reactivation charges. + calendar_billing (ReactivationBilling): These values are only applicable to + subscriptions using calendar billing + include_trial (bool): If `true` is sent, the reactivated Subscription will + include a trial if one is available. If `false` is sent, the trial period + will be ignored. + preserve_balance (bool): If `true` is passed, the existing subscription + balance will NOT be cleared/reset before adding the additional + reactivation charges. coupon_code (str): The coupon code to be applied during reactivation. - use_credits_and_prepayments (bool): If true is sent, Chargify will use - service credits and prepayments upon reactivation. If false is - sent, the service credits and prepayments will be ignored. - resume (bool | ResumeOptions | None): If `true`, Chargify will attempt - to resume the subscription's billing period. if not resumable, the - subscription will be reactivated with a new billing period. If - `false`: Chargify will only attempt to reactivate the subscription. - additional_properties (Dict[str, object]): The additional properties - for the model. + use_credits_and_prepayments (bool): If true is sent, Advanced Billing will + use service credits and prepayments upon reactivation. If false is sent, + the service credits and prepayments will be ignored. + resume (bool | ResumeOptions | None): If `true`, Advanced Billing will + attempt to resume the subscription's billing period. If not resumable, + the subscription will be reactivated with a new billing period. If + `false` or omitted, Advanced Billing will only attempt to reactivate the + subscription with a new billing period, regardless of whether or not the + subscription is resumable. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "calendar_billing": 'calendar_billing', - "include_trial": 'include_trial', - "preserve_balance": 'preserve_balance', - "coupon_code": 'coupon_code', - "use_credits_and_prepayments": 'use_credits_and_prepayments', - "resume": 'resume' + "calendar_billing": "calendar_billing", + "include_trial": "include_trial", + "preserve_balance": "preserve_balance", + "coupon_code": "coupon_code", + "use_credits_and_prepayments": "use_credits_and_prepayments", + "resume": "resume", } _optionals = [ - 'calendar_billing', - 'include_trial', - 'preserve_balance', - 'coupon_code', - 'use_credits_and_prepayments', - 'resume', + "calendar_billing", + "include_trial", + "preserve_balance", + "coupon_code", + "use_credits_and_prepayments", + "resume", ] - def __init__(self, - calendar_billing=APIHelper.SKIP, - include_trial=APIHelper.SKIP, - preserve_balance=APIHelper.SKIP, - coupon_code=APIHelper.SKIP, - use_credits_and_prepayments=APIHelper.SKIP, - resume=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ReactivateSubscriptionRequest class""" - + def __init__( + self, + calendar_billing=APIHelper.SKIP, + include_trial=APIHelper.SKIP, + preserve_balance=APIHelper.SKIP, + coupon_code=APIHelper.SKIP, + use_credits_and_prepayments=APIHelper.SKIP, + resume=APIHelper.SKIP, + additional_properties=None): + """Initialize a ReactivateSubscriptionRequest instance.""" # Initialize members of the class if calendar_billing is not APIHelper.SKIP: - self.calendar_billing = calendar_billing + self.calendar_billing = calendar_billing if include_trial is not APIHelper.SKIP: - self.include_trial = include_trial + self.include_trial = include_trial if preserve_balance is not APIHelper.SKIP: - self.preserve_balance = preserve_balance + self.preserve_balance = preserve_balance if coupon_code is not APIHelper.SKIP: - self.coupon_code = coupon_code + self.coupon_code = coupon_code if use_credits_and_prepayments is not APIHelper.SKIP: - self.use_credits_and_prepayments = use_credits_and_prepayments + self.use_credits_and_prepayments = use_credits_and_prepayments if resume is not APIHelper.SKIP: - self.resume = resume + self.resume = resume # Add additional model properties to the instance if additional_properties is None: @@ -87,7 +89,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -98,20 +100,46 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - calendar_billing = ReactivationBilling.from_dictionary(dictionary.get('calendar_billing')) if 'calendar_billing' in dictionary.keys() else APIHelper.SKIP - include_trial = dictionary.get("include_trial") if "include_trial" in dictionary.keys() else APIHelper.SKIP - preserve_balance = dictionary.get("preserve_balance") if "preserve_balance" in dictionary.keys() else APIHelper.SKIP - coupon_code = dictionary.get("coupon_code") if dictionary.get("coupon_code") else APIHelper.SKIP - use_credits_and_prepayments = dictionary.get("use_credits_and_prepayments") if "use_credits_and_prepayments" in dictionary.keys() else APIHelper.SKIP - resume = APIHelper.deserialize_union_type(UnionTypeLookUp.get('ReactivateSubscriptionRequestResume'), dictionary.get('resume'), False) if dictionary.get('resume') is not None else APIHelper.SKIP + calendar_billing =\ + ReactivationBilling.from_dictionary( + dictionary.get("calendar_billing"))\ + if "calendar_billing" in dictionary.keys()\ + else APIHelper.SKIP + include_trial =\ + dictionary.get("include_trial")\ + if "include_trial" in dictionary.keys()\ + else APIHelper.SKIP + preserve_balance =\ + dictionary.get("preserve_balance")\ + if "preserve_balance" in dictionary.keys()\ + else APIHelper.SKIP + coupon_code =\ + dictionary.get("coupon_code")\ + if dictionary.get("coupon_code")\ + else APIHelper.SKIP + use_credits_and_prepayments =\ + dictionary.get("use_credits_and_prepayments")\ + if "use_credits_and_prepayments" in dictionary.keys()\ + else APIHelper.SKIP + resume = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("ReactivateSubscriptionRequestResume"), + dictionary.get("resume"), + False)\ + if dictionary.get("resume") is not None\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(calendar_billing, include_trial, @@ -122,21 +150,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'calendar_billing={(self.calendar_billing if hasattr(self, "calendar_billing") else None)!r}, ' - f'include_trial={(self.include_trial if hasattr(self, "include_trial") else None)!r}, ' - f'preserve_balance={(self.preserve_balance if hasattr(self, "preserve_balance") else None)!r}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!r}, ' - f'use_credits_and_prepayments={(self.use_credits_and_prepayments if hasattr(self, "use_credits_and_prepayments") else None)!r}, ' - f'resume={(self.resume if hasattr(self, "resume") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _calendar_billing=( + self.calendar_billing + if hasattr(self, "calendar_billing") + else None + ) + _include_trial=( + self.include_trial + if hasattr(self, "include_trial") + else None + ) + _preserve_balance=( + self.preserve_balance + if hasattr(self, "preserve_balance") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _use_credits_and_prepayments=( + self.use_credits_and_prepayments + if hasattr(self, "use_credits_and_prepayments") + else None + ) + _resume=( + self.resume + if hasattr(self, "resume") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"calendar_billing={_calendar_billing!r}, " + f"include_trial={_include_trial!r}, " + f"preserve_balance={_preserve_balance!r}, " + f"coupon_code={_coupon_code!r}, " + f"use_credits_and_prepayments={_use_credits_and_prepayments!r}, " + f"resume={_resume!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'calendar_billing={(self.calendar_billing if hasattr(self, "calendar_billing") else None)!s}, ' - f'include_trial={(self.include_trial if hasattr(self, "include_trial") else None)!s}, ' - f'preserve_balance={(self.preserve_balance if hasattr(self, "preserve_balance") else None)!s}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!s}, ' - f'use_credits_and_prepayments={(self.use_credits_and_prepayments if hasattr(self, "use_credits_and_prepayments") else None)!s}, ' - f'resume={(self.resume if hasattr(self, "resume") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _calendar_billing=( + self.calendar_billing + if hasattr(self, "calendar_billing") + else None + ) + _include_trial=( + self.include_trial + if hasattr(self, "include_trial") + else None + ) + _preserve_balance=( + self.preserve_balance + if hasattr(self, "preserve_balance") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _use_credits_and_prepayments=( + self.use_credits_and_prepayments + if hasattr(self, "use_credits_and_prepayments") + else None + ) + _resume=( + self.resume + if hasattr(self, "resume") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"calendar_billing={_calendar_billing!s}, " + f"include_trial={_include_trial!s}, " + f"preserve_balance={_preserve_balance!s}, " + f"coupon_code={_coupon_code!s}, " + f"use_credits_and_prepayments={_use_credits_and_prepayments!s}, " + f"resume={_resume!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/reactivation_billing.py b/advancedbilling/models/reactivation_billing.py index 1e1d8ffb..17fe9113 100644 --- a/advancedbilling/models/reactivation_billing.py +++ b/advancedbilling/models/reactivation_billing.py @@ -1,49 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.api_helper import APIHelper - +# ruff: noqa: E501 class ReactivationBilling(object): - """Implementation of the 'Reactivation Billing' model. These values are only applicable to subscriptions using calendar billing Attributes: - reactivation_charge (ReactivationCharge): You may choose how to handle - the reactivation charge for that subscription: 1) `prorated` A - prorated charge for the product price will be attempted for to - complete the period 2) `immediate` A full-price charge for the - product price will be attempted immediately 3) `delayed` A - full-price charge for the product price will be attempted at the - next renewal - additional_properties (Dict[str, object]): The additional properties - for the model. + reactivation_charge (ReactivationCharge): You may choose how to handle the + reactivation charge for that subscription: 1) `prorated` A prorated + charge for the product price will be attempted for to complete the period + 2) `immediate` A full-price charge for the product price will be + attempted immediately 3) `delayed` A full-price charge for the product + price will be attempted at the next renewal + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reactivation_charge": 'reactivation_charge' + "reactivation_charge": "reactivation_charge", } _optionals = [ - 'reactivation_charge', + "reactivation_charge", ] - def __init__(self, - reactivation_charge='prorated', - additional_properties=None): - """Constructor for the ReactivationBilling class""" - + def __init__( + self, + reactivation_charge="prorated", + additional_properties=None): + """Initialize a ReactivationBilling instance.""" # Initialize members of the class - self.reactivation_charge = reactivation_charge + self.reactivation_charge = reactivation_charge # Add additional model properties to the instance if additional_properties is None: @@ -53,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -64,21 +58,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reactivation_charge = dictionary.get("reactivation_charge") if dictionary.get("reactivation_charge") else 'prorated' + reactivation_charge =\ + dictionary.get("reactivation_charge")\ + if dictionary.get("reactivation_charge")\ + else "prorated" + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reactivation_charge, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -89,7 +88,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -99,11 +97,31 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reactivation_charge={(self.reactivation_charge if hasattr(self, "reactivation_charge") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reactivation_charge=( + self.reactivation_charge + if hasattr(self, "reactivation_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reactivation_charge={_reactivation_charge!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reactivation_charge={(self.reactivation_charge if hasattr(self, "reactivation_charge") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reactivation_charge=( + self.reactivation_charge + if hasattr(self, "reactivation_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reactivation_charge={_reactivation_charge!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/reactivation_charge.py b/advancedbilling/models/reactivation_charge.py index 2258f372..ffa84f5e 100644 --- a/advancedbilling/models/reactivation_charge.py +++ b/advancedbilling/models/reactivation_charge.py @@ -1,42 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ReactivationCharge(object): - """Implementation of the 'Reactivation Charge' enum. - You may choose how to handle the reactivation charge for that - subscription: 1) `prorated` A prorated charge for the product price will - be attempted for to complete the period 2) `immediate` A full-price charge - for the product price will be attempted immediately 3) `delayed` A - full-price charge for the product price will be attempted at the next - renewal + You may choose how to handle the reactivation charge for that subscription: 1) + `prorated` A prorated charge for the product price will be attempted for to + complete the period 2) `immediate` A full-price charge for the product price will + be attempted immediately 3) `delayed` A full-price charge for the product price + will be attempted at the next renewal Attributes: PRORATED: The enum member of type str. IMMEDIATE: The enum member of type str. DELAYED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['prorated', 'immediate', 'delayed'] - PRORATED = 'prorated' - IMMEDIATE = 'immediate' + _all_values = ["prorated", "immediate", "delayed"] + PRORATED = "prorated" - DELAYED = 'delayed' + IMMEDIATE = "immediate" + + DELAYED = "delayed" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -46,9 +43,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/reason_code.py b/advancedbilling/models/reason_code.py index 159b60b7..21bb4efd 100644 --- a/advancedbilling/models/reason_code.py +++ b/advancedbilling/models/reason_code.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ReasonCode(object): - """Implementation of the 'Reason Code' model. Attributes: @@ -21,58 +19,64 @@ class ReasonCode(object): position (int): The model property of type int. created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "site_id": 'site_id', - "code": 'code', - "description": 'description', - "position": 'position', - "created_at": 'created_at', - "updated_at": 'updated_at' + "id": "id", + "site_id": "site_id", + "code": "code", + "description": "description", + "position": "position", + "created_at": "created_at", + "updated_at": "updated_at", } _optionals = [ - 'id', - 'site_id', - 'code', - 'description', - 'position', - 'created_at', - 'updated_at', + "id", + "site_id", + "code", + "description", + "position", + "created_at", + "updated_at", ] - def __init__(self, - id=APIHelper.SKIP, - site_id=APIHelper.SKIP, - code=APIHelper.SKIP, - description=APIHelper.SKIP, - position=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ReasonCode class""" - + def __init__( + self, + id=APIHelper.SKIP, + site_id=APIHelper.SKIP, + code=APIHelper.SKIP, + description=APIHelper.SKIP, + position=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ReasonCode instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if code is not APIHelper.SKIP: - self.code = code + self.code = code if description is not APIHelper.SKIP: - self.description = description + self.description = description if position is not APIHelper.SKIP: - self.position = position + self.position = position if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None # Add additional model properties to the instance if additional_properties is None: @@ -82,7 +86,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -93,20 +97,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - position = dictionary.get("position") if dictionary.get("position") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + position =\ + dictionary.get("position")\ + if dictionary.get("position")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, site_id, @@ -118,23 +143,103 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'position={(self.position if hasattr(self, "position") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _position=( + self.position + if hasattr(self, "position") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"site_id={_site_id!r}, " + f"code={_code!r}, " + f"description={_description!r}, " + f"position={_position!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'position={(self.position if hasattr(self, "position") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _position=( + self.position + if hasattr(self, "position") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"site_id={_site_id!s}, " + f"code={_code!s}, " + f"description={_description!s}, " + f"position={_position!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/reason_code_response.py b/advancedbilling/models/reason_code_response.py index b47bc49c..df1933c9 100644 --- a/advancedbilling/models/reason_code_response.py +++ b/advancedbilling/models/reason_code_response.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.reason_code import ReasonCode +# ruff: noqa: E501 +from advancedbilling.models.reason_code import ( + ReasonCode, +) -class ReasonCodeResponse(object): +class ReasonCodeResponse(object): """Implementation of the 'Reason Code Response' model. Attributes: reason_code (ReasonCode): The model property of type ReasonCode. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reason_code": 'reason_code' + "reason_code": "reason_code", } - def __init__(self, - reason_code=None, - additional_properties=None): - """Constructor for the ReasonCodeResponse class""" - + def __init__( + self, + reason_code=None, + additional_properties=None): + """Initialize a ReasonCodeResponse instance.""" # Initialize members of the class - self.reason_code = reason_code + self.reason_code = reason_code # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reason_code = ReasonCode.from_dictionary(dictionary.get('reason_code')) if dictionary.get('reason_code') else None + reason_code =\ + ReasonCode.from_dictionary( + dictionary.get("reason_code"))\ + if dictionary.get("reason_code") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reason_code, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reason_code={self.reason_code!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reason_code=self.reason_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason_code={_reason_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reason_code={self.reason_code!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reason_code=self.reason_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason_code={_reason_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/record_payment_request.py b/advancedbilling/models/record_payment_request.py index ac0f6a4e..920200cf 100644 --- a/advancedbilling/models/record_payment_request.py +++ b/advancedbilling/models/record_payment_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.create_payment import CreatePayment +# ruff: noqa: E501 +from advancedbilling.models.create_payment import ( + CreatePayment, +) -class RecordPaymentRequest(object): +class RecordPaymentRequest(object): """Implementation of the 'Record Payment Request' model. Attributes: payment (CreatePayment): The model property of type CreatePayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment": 'payment' + "payment": "payment", } - def __init__(self, - payment=None, - additional_properties=None): - """Constructor for the RecordPaymentRequest class""" - + def __init__( + self, + payment=None, + additional_properties=None): + """Initialize a RecordPaymentRequest instance.""" # Initialize members of the class - self.payment = payment + self.payment = payment # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment = CreatePayment.from_dictionary(dictionary.get('payment')) if dictionary.get('payment') else None + payment =\ + CreatePayment.from_dictionary( + dictionary.get("payment"))\ + if dictionary.get("payment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment=self.payment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment={self.payment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment=self.payment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment={_payment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/record_payment_response.py b/advancedbilling/models/record_payment_response.py index 70a8a8bd..a5812d17 100644 --- a/advancedbilling/models/record_payment_response.py +++ b/advancedbilling/models/record_payment_response.py @@ -1,56 +1,57 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.invoice_pre_payment import InvoicePrePayment -from advancedbilling.models.paid_invoice import PaidInvoice +from advancedbilling.models.invoice_pre_payment import ( + InvoicePrePayment, +) +from advancedbilling.models.paid_invoice import ( + PaidInvoice, +) class RecordPaymentResponse(object): - """Implementation of the 'Record Payment Response' model. Attributes: paid_invoices (List[PaidInvoice]): The model property of type List[PaidInvoice]. - prepayment (InvoicePrePayment): The model property of type - InvoicePrePayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayment (InvoicePrePayment): The model property of type InvoicePrePayment. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "paid_invoices": 'paid_invoices', - "prepayment": 'prepayment' + "paid_invoices": "paid_invoices", + "prepayment": "prepayment", } _optionals = [ - 'paid_invoices', - 'prepayment', + "paid_invoices", + "prepayment", ] _nullables = [ - 'prepayment', + "prepayment", ] - def __init__(self, - paid_invoices=APIHelper.SKIP, - prepayment=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RecordPaymentResponse class""" - + def __init__( + self, + paid_invoices=APIHelper.SKIP, + prepayment=APIHelper.SKIP, + additional_properties=None): + """Initialize a RecordPaymentResponse instance.""" # Initialize members of the class if paid_invoices is not APIHelper.SKIP: - self.paid_invoices = paid_invoices + self.paid_invoices = paid_invoices if prepayment is not APIHelper.SKIP: - self.prepayment = prepayment + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -60,7 +61,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -71,35 +72,73 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary paid_invoices = None - if dictionary.get('paid_invoices') is not None: - paid_invoices = [PaidInvoice.from_dictionary(x) for x in dictionary.get('paid_invoices')] + if dictionary.get("paid_invoices") is not None: + paid_invoices = [ + PaidInvoice.from_dictionary(x) + for x in dictionary.get("paid_invoices") + ] else: paid_invoices = APIHelper.SKIP - if 'prepayment' in dictionary.keys(): - prepayment = InvoicePrePayment.from_dictionary(dictionary.get('prepayment')) if dictionary.get('prepayment') else None + if "prepayment" in dictionary.keys(): + prepayment =\ + InvoicePrePayment.from_dictionary( + dictionary.get("prepayment"))\ + if dictionary.get("prepayment") else None else: prepayment = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(paid_invoices, prepayment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'paid_invoices={(self.paid_invoices if hasattr(self, "paid_invoices") else None)!r}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _paid_invoices=( + self.paid_invoices + if hasattr(self, "paid_invoices") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"paid_invoices={_paid_invoices!r}, " + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'paid_invoices={(self.paid_invoices if hasattr(self, "paid_invoices") else None)!s}, ' - f'prepayment={(self.prepayment if hasattr(self, "prepayment") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _paid_invoices=( + self.paid_invoices + if hasattr(self, "paid_invoices") + else None + ) + _prepayment=( + self.prepayment + if hasattr(self, "prepayment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"paid_invoices={_paid_invoices!s}, " + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/recurring_scheme.py b/advancedbilling/models/recurring_scheme.py index 6dfe1cd0..6522db5c 100644 --- a/advancedbilling/models/recurring_scheme.py +++ b/advancedbilling/models/recurring_scheme.py @@ -1,33 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class RecurringScheme(object): - """Implementation of the 'Recurring Scheme' enum. Attributes: DO_NOT_RECUR: The enum member of type str. RECUR_INDEFINITELY: The enum member of type str. RECUR_WITH_DURATION: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - DO_NOT_RECUR = 'do_not_recur' - RECUR_INDEFINITELY = 'recur_indefinitely' + DO_NOT_RECUR = "do_not_recur" + + RECUR_INDEFINITELY = "recur_indefinitely" - RECUR_WITH_DURATION = 'recur_with_duration' + RECUR_WITH_DURATION = "recur_with_duration" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/referral_code.py b/advancedbilling/models/referral_code.py index b7ac269c..123e6f73 100644 --- a/advancedbilling/models/referral_code.py +++ b/advancedbilling/models/referral_code.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ReferralCode(object): - """Implementation of the 'Referral Code' model. Attributes: @@ -18,43 +16,43 @@ class ReferralCode(object): site_id (int): The model property of type int. subscription_id (int): The model property of type int. code (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "site_id": 'site_id', - "subscription_id": 'subscription_id', - "code": 'code' + "id": "id", + "site_id": "site_id", + "subscription_id": "subscription_id", + "code": "code", } _optionals = [ - 'id', - 'site_id', - 'subscription_id', - 'code', + "id", + "site_id", + "subscription_id", + "code", ] - def __init__(self, - id=APIHelper.SKIP, - site_id=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - code=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ReferralCode class""" - + def __init__( + self, + id=APIHelper.SKIP, + site_id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + code=APIHelper.SKIP, + additional_properties=None): + """Initialize a ReferralCode instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if code is not APIHelper.SKIP: - self.code = code + self.code = code # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, site_id, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"site_id={_site_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"code={_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _code=( + self.code + if hasattr(self, "code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"site_id={_site_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"code={_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/referral_validation_response.py b/advancedbilling/models/referral_validation_response.py index 1ec23874..31e72151 100644 --- a/advancedbilling/models/referral_validation_response.py +++ b/advancedbilling/models/referral_validation_response.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.referral_code import ReferralCode +from advancedbilling.models.referral_code import ( + ReferralCode, +) class ReferralValidationResponse(object): - """Implementation of the 'Referral Validation Response' model. Attributes: referral_code (ReferralCode): The model property of type ReferralCode. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "referral_code": 'referral_code' + "referral_code": "referral_code", } _optionals = [ - 'referral_code', + "referral_code", ] - def __init__(self, - referral_code=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ReferralValidationResponse class""" - + def __init__( + self, + referral_code=APIHelper.SKIP, + additional_properties=None): + """Initialize a ReferralValidationResponse instance.""" # Initialize members of the class if referral_code is not APIHelper.SKIP: - self.referral_code = referral_code + self.referral_code = referral_code # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - referral_code = ReferralCode.from_dictionary(dictionary.get('referral_code')) if 'referral_code' in dictionary.keys() else APIHelper.SKIP + referral_code =\ + ReferralCode.from_dictionary( + dictionary.get("referral_code"))\ + if "referral_code" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(referral_code, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'referral_code={(self.referral_code if hasattr(self, "referral_code") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _referral_code=( + self.referral_code + if hasattr(self, "referral_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"referral_code={_referral_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'referral_code={(self.referral_code if hasattr(self, "referral_code") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _referral_code=( + self.referral_code + if hasattr(self, "referral_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"referral_code={_referral_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_consolidated_invoice.py b/advancedbilling/models/refund_consolidated_invoice.py index 439f29ca..8bb53dec 100644 --- a/advancedbilling/models/refund_consolidated_invoice.py +++ b/advancedbilling/models/refund_consolidated_invoice.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RefundConsolidatedInvoice(object): - """Implementation of the 'Refund Consolidated Invoice' model. Refund consolidated invoice @@ -18,56 +16,56 @@ class RefundConsolidatedInvoice(object): Attributes: memo (str): A description for the refund payment_id (int): The ID of the payment to be refunded - segment_uids (List[str] | str): An array of segment uids to refund or - the string 'all' to indicate that all segments should be refunded - external (bool): Flag that marks refund as external (no money is - returned to the customer). Defaults to `false`. - apply_credit (bool): If set to true, creates credit and applies it to - an invoice. Defaults to `false`. + segment_uids (List[str] | str): An array of segment uids to refund or the + string 'all' to indicate that all segments should be refunded + external (bool): Flag that marks refund as external (no money is returned to + the customer). Defaults to `false`. + apply_credit (bool): If set to true, creates credit and applies it to an + invoice. Defaults to `false`. amount (str): The amount of payment to be refunded in decimal format. - Example: "10.50". This will default to the full amount of the - payment if not provided. - additional_properties (Dict[str, object]): The additional properties - for the model. + Example: "10.50". This will default to the full amount of the payment if + not provided. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "memo": 'memo', - "payment_id": 'payment_id', - "segment_uids": 'segment_uids', - "external": 'external', - "apply_credit": 'apply_credit', - "amount": 'amount' + "memo": "memo", + "payment_id": "payment_id", + "segment_uids": "segment_uids", + "external": "external", + "apply_credit": "apply_credit", + "amount": "amount", } _optionals = [ - 'external', - 'apply_credit', - 'amount', + "external", + "apply_credit", + "amount", ] - def __init__(self, - memo=None, - payment_id=None, - segment_uids=None, - external=APIHelper.SKIP, - apply_credit=APIHelper.SKIP, - amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RefundConsolidatedInvoice class""" - + def __init__( + self, + memo=None, + payment_id=None, + segment_uids=None, + external=APIHelper.SKIP, + apply_credit=APIHelper.SKIP, + amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a RefundConsolidatedInvoice instance.""" # Initialize members of the class - self.memo = memo - self.payment_id = payment_id - self.segment_uids = segment_uids + self.memo = memo + self.payment_id = payment_id + self.segment_uids = segment_uids if external is not APIHelper.SKIP: - self.external = external + self.external = external if apply_credit is not APIHelper.SKIP: - self.apply_credit = apply_credit + self.apply_credit = apply_credit if amount is not APIHelper.SKIP: - self.amount = amount + self.amount = amount # Add additional model properties to the instance if additional_properties is None: @@ -77,7 +75,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -88,20 +86,45 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - memo = dictionary.get("memo") if dictionary.get("memo") else None - payment_id = dictionary.get("payment_id") if dictionary.get("payment_id") else None - segment_uids = APIHelper.deserialize_union_type(UnionTypeLookUp.get('RefundConsolidatedInvoiceSegmentUids'), dictionary.get('segment_uids'), False) if dictionary.get('segment_uids') is not None else None - external = dictionary.get("external") if "external" in dictionary.keys() else APIHelper.SKIP - apply_credit = dictionary.get("apply_credit") if "apply_credit" in dictionary.keys() else APIHelper.SKIP - amount = dictionary.get("amount") if dictionary.get("amount") else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + payment_id =\ + dictionary.get("payment_id")\ + if dictionary.get("payment_id")\ + else None + segment_uids = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("RefundConsolidatedInvoiceSegmentUids"), + dictionary.get("segment_uids"), + False)\ + if dictionary.get("segment_uids") is not None\ + else None + external =\ + dictionary.get("external")\ + if "external" in dictionary.keys()\ + else APIHelper.SKIP + apply_credit =\ + dictionary.get("apply_credit")\ + if "apply_credit" in dictionary.keys()\ + else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(memo, payment_id, @@ -113,7 +136,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -124,40 +147,110 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.payment_id, - type_callable=lambda value: isinstance(value, int)) \ - and UnionTypeLookUp.get('RefundConsolidatedInvoiceSegmentUids').validate(dictionary.segment_uids).is_valid + return APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.payment_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and (UnionTypeLookUp.get("RefundConsolidatedInvoiceSegmentUids") + .validate(dictionary.segment_uids).is_valid) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('payment_id'), - type_callable=lambda value: isinstance(value, int)) \ - and UnionTypeLookUp.get('RefundConsolidatedInvoiceSegmentUids').validate(dictionary.get('segment_uids')).is_valid + return APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("payment_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and (UnionTypeLookUp.get("RefundConsolidatedInvoiceSegmentUids") + .validate(dictionary.get("segment_uids")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'memo={self.memo!r}, ' - f'payment_id={self.payment_id!r}, ' - f'segment_uids={self.segment_uids!r}, ' - f'external={(self.external if hasattr(self, "external") else None)!r}, ' - f'apply_credit={(self.apply_credit if hasattr(self, "apply_credit") else None)!r}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _memo=self.memo + _payment_id=self.payment_id + _segment_uids=self.segment_uids + _external=( + self.external + if hasattr(self, "external") + else None + ) + _apply_credit=( + self.apply_credit + if hasattr(self, "apply_credit") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"memo={_memo!r}, " + f"payment_id={_payment_id!r}, " + f"segment_uids={_segment_uids!r}, " + f"external={_external!r}, " + f"apply_credit={_apply_credit!r}, " + f"amount={_amount!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'memo={self.memo!s}, ' - f'payment_id={self.payment_id!s}, ' - f'segment_uids={self.segment_uids!s}, ' - f'external={(self.external if hasattr(self, "external") else None)!s}, ' - f'apply_credit={(self.apply_credit if hasattr(self, "apply_credit") else None)!s}, ' - f'amount={(self.amount if hasattr(self, "amount") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _memo=self.memo + _payment_id=self.payment_id + _segment_uids=self.segment_uids + _external=( + self.external + if hasattr(self, "external") + else None + ) + _apply_credit=( + self.apply_credit + if hasattr(self, "apply_credit") + else None + ) + _amount=( + self.amount + if hasattr(self, "amount") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"memo={_memo!s}, " + f"payment_id={_payment_id!s}, " + f"segment_uids={_segment_uids!s}, " + f"external={_external!s}, " + f"apply_credit={_apply_credit!s}, " + f"amount={_amount!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_invoice.py b/advancedbilling/models/refund_invoice.py index 9232ec7b..f01db173 100644 --- a/advancedbilling/models/refund_invoice.py +++ b/advancedbilling/models/refund_invoice.py @@ -1,74 +1,72 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RefundInvoice(object): - """Implementation of the 'Refund Invoice' model. Refund an invoice or a segment of a consolidated invoice. Attributes: amount (str): The amount to be refunded in decimal format as a string. - Example: "10.50". Must not exceed the remaining refundable balance - of the payment. + Example: "10.50". Must not exceed the remaining refundable balance of the + payment. memo (str): A description that will be attached to the refund payment_id (int): The ID of the payment to be refunded - external (bool): Flag that marks refund as external (no money is - returned to the customer). Defaults to `false`. - apply_credit (bool): If set to true, creates credit and applies it to - an invoice. Defaults to `false`. + external (bool): Flag that marks refund as external (no money is returned to + the customer). Defaults to `false`. + apply_credit (bool): If set to true, creates credit and applies it to an + invoice. Defaults to `false`. void_invoice (bool): If `apply_credit` set to false and refunding full - amount, if `void_invoice` set to true, invoice will be voided - after refund. Defaults to `false`. - additional_properties (Dict[str, object]): The additional properties - for the model. + amount, if `void_invoice` set to true, invoice will be voided after + refund. Defaults to `false`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "memo": 'memo', - "payment_id": 'payment_id', - "external": 'external', - "apply_credit": 'apply_credit', - "void_invoice": 'void_invoice' + "amount": "amount", + "memo": "memo", + "payment_id": "payment_id", + "external": "external", + "apply_credit": "apply_credit", + "void_invoice": "void_invoice", } _optionals = [ - 'external', - 'apply_credit', - 'void_invoice', + "external", + "apply_credit", + "void_invoice", ] - def __init__(self, - amount=None, - memo=None, - payment_id=None, - external=APIHelper.SKIP, - apply_credit=APIHelper.SKIP, - void_invoice=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RefundInvoice class""" - + def __init__( + self, + amount=None, + memo=None, + payment_id=None, + external=APIHelper.SKIP, + apply_credit=APIHelper.SKIP, + void_invoice=APIHelper.SKIP, + additional_properties=None): + """Initialize a RefundInvoice instance.""" # Initialize members of the class - self.amount = amount - self.memo = memo - self.payment_id = payment_id + self.amount = amount + self.memo = memo + self.payment_id = payment_id if external is not APIHelper.SKIP: - self.external = external + self.external = external if apply_credit is not APIHelper.SKIP: - self.apply_credit = apply_credit + self.apply_credit = apply_credit if void_invoice is not APIHelper.SKIP: - self.void_invoice = void_invoice + self.void_invoice = void_invoice # Add additional model properties to the instance if additional_properties is None: @@ -78,7 +76,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -89,19 +87,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = dictionary.get("amount") if dictionary.get("amount") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - payment_id = dictionary.get("payment_id") if dictionary.get("payment_id") else None - external = dictionary.get("external") if "external" in dictionary.keys() else APIHelper.SKIP - apply_credit = dictionary.get("apply_credit") if "apply_credit" in dictionary.keys() else APIHelper.SKIP - void_invoice = dictionary.get("void_invoice") if "void_invoice" in dictionary.keys() else APIHelper.SKIP + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + payment_id =\ + dictionary.get("payment_id")\ + if dictionary.get("payment_id")\ + else None + external =\ + dictionary.get("external")\ + if "external" in dictionary.keys()\ + else APIHelper.SKIP + apply_credit =\ + dictionary.get("apply_credit")\ + if "apply_credit" in dictionary.keys()\ + else APIHelper.SKIP + void_invoice =\ + dictionary.get("void_invoice")\ + if "void_invoice" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, memo, @@ -113,7 +131,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -124,41 +142,116 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.payment_id, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.payment_id, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('payment_id'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("payment_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!r}, ' - f'memo={self.memo!r}, ' - f'payment_id={self.payment_id!r}, ' - f'external={(self.external if hasattr(self, "external") else None)!r}, ' - f'apply_credit={(self.apply_credit if hasattr(self, "apply_credit") else None)!r}, ' - f'void_invoice={(self.void_invoice if hasattr(self, "void_invoice") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=self.amount + _memo=self.memo + _payment_id=self.payment_id + _external=( + self.external + if hasattr(self, "external") + else None + ) + _apply_credit=( + self.apply_credit + if hasattr(self, "apply_credit") + else None + ) + _void_invoice=( + self.void_invoice + if hasattr(self, "void_invoice") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"memo={_memo!r}, " + f"payment_id={_payment_id!r}, " + f"external={_external!r}, " + f"apply_credit={_apply_credit!r}, " + f"void_invoice={_void_invoice!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!s}, ' - f'memo={self.memo!s}, ' - f'payment_id={self.payment_id!s}, ' - f'external={(self.external if hasattr(self, "external") else None)!s}, ' - f'apply_credit={(self.apply_credit if hasattr(self, "apply_credit") else None)!s}, ' - f'void_invoice={(self.void_invoice if hasattr(self, "void_invoice") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=self.amount + _memo=self.memo + _payment_id=self.payment_id + _external=( + self.external + if hasattr(self, "external") + else None + ) + _apply_credit=( + self.apply_credit + if hasattr(self, "apply_credit") + else None + ) + _void_invoice=( + self.void_invoice + if hasattr(self, "void_invoice") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"memo={_memo!s}, " + f"payment_id={_payment_id!s}, " + f"external={_external!s}, " + f"apply_credit={_apply_credit!s}, " + f"void_invoice={_void_invoice!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_invoice_event.py b/advancedbilling/models/refund_invoice_event.py index 26179d2c..a76cd42f 100644 --- a/advancedbilling/models/refund_invoice_event.py +++ b/advancedbilling/models/refund_invoice_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType -from advancedbilling.models.refund_invoice_event_data import RefundInvoiceEventData +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) +from advancedbilling.models.refund_invoice_event_data import ( + RefundInvoiceEventData, +) class RefundInvoiceEvent(object): - """Implementation of the 'Refund Invoice Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (RefundInvoiceEventData): Example schema for an - `refund_invoice` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (RefundInvoiceEventData): Example schema for an `refund_invoice` + event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='refund_invoice', - event_data=None, - additional_properties=None): - """Constructor for the RefundInvoiceEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="refund_invoice", + event_data=None, + additional_properties=None): + """Initialize a RefundInvoiceEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'refund_invoice' - event_data = RefundInvoiceEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "refund_invoice" + event_data =\ + RefundInvoiceEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: RefundInvoiceEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + RefundInvoiceEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: RefundInvoiceEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + RefundInvoiceEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_invoice_event_data.py b/advancedbilling/models/refund_invoice_event_data.py index f8d78f2c..cf0771e6 100644 --- a/advancedbilling/models/refund_invoice_event_data.py +++ b/advancedbilling/models/refund_invoice_event_data.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.credit_note import ( + CreditNote, +) class RefundInvoiceEventData(object): - """Implementation of the 'Refund Invoice Event Data' model. Example schema for an `refund_invoice` event @@ -19,76 +19,77 @@ class RefundInvoiceEventData(object): Attributes: apply_credit (bool): If true, credit was created and applied it to the invoice. - consolidation_level (InvoiceConsolidationLevel): Consolidation level - of the invoice, which is applicable to invoice consolidation. It - will hold one of the following values: * "none": A normal invoice - with no consolidation. * "child": An invoice segment which has - been combined into a consolidated invoice. * "parent": A - consolidated invoice, whose contents are composed of invoice - segments. "Parent" invoices do not have lines of their own, but - they have subtotals and totals which aggregate the member invoice - segments. See also the [invoice consolidation - documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269 - 909389-Invoice-Consolidation). - credit_note_attributes (CreditNote): The model property of type - CreditNote. + consolidation_level (InvoiceConsolidationLevel): Consolidation level of the + invoice, which is applicable to invoice consolidation. It will hold one + of the following values: * "none": A normal invoice with no + consolidation. * "child": An invoice segment which has been combined into + a consolidated invoice. * "parent": A consolidated invoice, whose + contents are composed of invoice segments. "Parent" invoices do not have + lines of their own, but they have subtotals and totals which aggregate + the member invoice segments. See also the [invoice consolidation + documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389- + Invoice-Consolidation). + credit_note_attributes (CreditNote): The model property of type CreditNote. memo (str): The refund memo. original_amount (str): The full, original amount of the refund. payment_id (int): The ID of the payment transaction to be refunded. refund_amount (str): The amount of the refund. refund_id (int): The ID of the refund transaction. - transaction_time (datetime): The time the refund was applied, in ISO - 8601 format, i.e. "2019-06-07T17:20:06Z" - additional_properties (Dict[str, object]): The additional properties - for the model. + transaction_time (datetime): The time the refund was applied, in ISO 8601 + format, i.e. "2019-06-07T17:20:06Z" + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "apply_credit": 'apply_credit', - "credit_note_attributes": 'credit_note_attributes', - "payment_id": 'payment_id', - "refund_amount": 'refund_amount', - "refund_id": 'refund_id', - "transaction_time": 'transaction_time', - "consolidation_level": 'consolidation_level', - "memo": 'memo', - "original_amount": 'original_amount' + "apply_credit": "apply_credit", + "credit_note_attributes": "credit_note_attributes", + "payment_id": "payment_id", + "refund_amount": "refund_amount", + "refund_id": "refund_id", + "transaction_time": "transaction_time", + "consolidation_level": "consolidation_level", + "memo": "memo", + "original_amount": "original_amount", } _optionals = [ - 'consolidation_level', - 'memo', - 'original_amount', + "consolidation_level", + "memo", + "original_amount", ] - def __init__(self, - apply_credit=None, - credit_note_attributes=None, - payment_id=None, - refund_amount=None, - refund_id=None, - transaction_time=None, - consolidation_level=APIHelper.SKIP, - memo=APIHelper.SKIP, - original_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RefundInvoiceEventData class""" - + def __init__( + self, + apply_credit=None, + credit_note_attributes=None, + payment_id=None, + refund_amount=None, + refund_id=None, + transaction_time=None, + consolidation_level=APIHelper.SKIP, + memo=APIHelper.SKIP, + original_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a RefundInvoiceEventData instance.""" # Initialize members of the class - self.apply_credit = apply_credit + self.apply_credit = apply_credit if consolidation_level is not APIHelper.SKIP: - self.consolidation_level = consolidation_level - self.credit_note_attributes = credit_note_attributes + self.consolidation_level = consolidation_level + self.credit_note_attributes = credit_note_attributes if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount - self.payment_id = payment_id - self.refund_amount = refund_amount - self.refund_id = refund_id - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.original_amount = original_amount + self.payment_id = payment_id + self.refund_amount = refund_amount + self.refund_id = refund_id + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None # Add additional model properties to the instance if additional_properties is None: @@ -98,7 +99,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -109,22 +110,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - apply_credit = dictionary.get("apply_credit") if "apply_credit" in dictionary.keys() else None - credit_note_attributes = CreditNote.from_dictionary(dictionary.get('credit_note_attributes')) if dictionary.get('credit_note_attributes') else None - payment_id = dictionary.get("payment_id") if dictionary.get("payment_id") else None - refund_amount = dictionary.get("refund_amount") if dictionary.get("refund_amount") else None - refund_id = dictionary.get("refund_id") if dictionary.get("refund_id") else None - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else None - consolidation_level = dictionary.get("consolidation_level") if dictionary.get("consolidation_level") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP + apply_credit =\ + dictionary.get("apply_credit")\ + if "apply_credit" in dictionary.keys()\ + else None + credit_note_attributes =\ + CreditNote.from_dictionary( + dictionary.get("credit_note_attributes"))\ + if dictionary.get("credit_note_attributes") else None + payment_id =\ + dictionary.get("payment_id")\ + if dictionary.get("payment_id")\ + else None + refund_amount =\ + dictionary.get("refund_amount")\ + if dictionary.get("refund_amount")\ + else None + refund_id =\ + dictionary.get("refund_id")\ + if dictionary.get("refund_id")\ + else None + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else None + consolidation_level =\ + dictionary.get("consolidation_level")\ + if dictionary.get("consolidation_level")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(apply_credit, credit_note_attributes, @@ -139,7 +168,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -150,61 +179,166 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.apply_credit, - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.credit_note_attributes, - type_callable=lambda value: CreditNote.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.payment_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.refund_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.refund_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.transaction_time, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) + return APIHelper.is_valid_type( + value=dictionary.apply_credit, + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.credit_note_attributes, + type_callable=lambda value: + CreditNote.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.payment_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.refund_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.refund_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.transaction_time, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('apply_credit'), - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.get('credit_note_attributes'), - type_callable=lambda value: CreditNote.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('payment_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('refund_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('refund_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('transaction_time'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("apply_credit"), + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("credit_note_attributes"), + type_callable=lambda value: + CreditNote.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("payment_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("refund_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("refund_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("transaction_time"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'apply_credit={self.apply_credit!r}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!r}, ' - f'credit_note_attributes={self.credit_note_attributes!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'payment_id={self.payment_id!r}, ' - f'refund_amount={self.refund_amount!r}, ' - f'refund_id={self.refund_id!r}, ' - f'transaction_time={self.transaction_time!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _apply_credit=self.apply_credit + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _credit_note_attributes=self.credit_note_attributes + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _payment_id=self.payment_id + _refund_amount=self.refund_amount + _refund_id=self.refund_id + _transaction_time=self.transaction_time + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"apply_credit={_apply_credit!r}, " + f"consolidation_level={_consolidation_level!r}, " + f"credit_note_attributes={_credit_note_attributes!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"payment_id={_payment_id!r}, " + f"refund_amount={_refund_amount!r}, " + f"refund_id={_refund_id!r}, " + f"transaction_time={_transaction_time!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'apply_credit={self.apply_credit!s}, ' - f'consolidation_level={(self.consolidation_level if hasattr(self, "consolidation_level") else None)!s}, ' - f'credit_note_attributes={self.credit_note_attributes!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'payment_id={self.payment_id!s}, ' - f'refund_amount={self.refund_amount!s}, ' - f'refund_id={self.refund_id!s}, ' - f'transaction_time={self.transaction_time!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _apply_credit=self.apply_credit + _consolidation_level=( + self.consolidation_level + if hasattr(self, "consolidation_level") + else None + ) + _credit_note_attributes=self.credit_note_attributes + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _payment_id=self.payment_id + _refund_amount=self.refund_amount + _refund_id=self.refund_id + _transaction_time=self.transaction_time + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"apply_credit={_apply_credit!s}, " + f"consolidation_level={_consolidation_level!s}, " + f"credit_note_attributes={_credit_note_attributes!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"payment_id={_payment_id!s}, " + f"refund_amount={_refund_amount!s}, " + f"refund_id={_refund_id!s}, " + f"transaction_time={_transaction_time!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_invoice_request.py b/advancedbilling/models/refund_invoice_request.py index f0b0ef11..847bcdd0 100644 --- a/advancedbilling/models/refund_invoice_request.py +++ b/advancedbilling/models/refund_invoice_request.py @@ -1,38 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RefundInvoiceRequest(object): - """Implementation of the 'Refund Invoice Request' model. Attributes: - refund (RefundInvoice | RefundConsolidatedInvoice): The model property - of type RefundInvoice | RefundConsolidatedInvoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + refund (RefundInvoice | RefundConsolidatedInvoice): The model property of + type RefundInvoice | RefundConsolidatedInvoice. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "refund": 'refund' + "refund": "refund", } - def __init__(self, - refund=None, - additional_properties=None): - """Constructor for the RefundInvoiceRequest class""" - + def __init__( + self, + refund=None, + additional_properties=None): + """Initialize a RefundInvoiceRequest instance.""" # Initialize members of the class - self.refund = refund + self.refund = refund # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +40,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,22 +51,32 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - refund = APIHelper.deserialize_union_type(UnionTypeLookUp.get('RefundInvoiceRequestRefund'), dictionary.get('refund'), False) if dictionary.get('refund') is not None else None + refund = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("RefundInvoiceRequestRefund"), + dictionary.get("refund"), + False)\ + if dictionary.get("refund") is not None\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(refund, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -79,22 +87,38 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('RefundInvoiceRequestRefund').validate(dictionary.refund).is_valid + return (UnionTypeLookUp.get("RefundInvoiceRequestRefund") + .validate(dictionary.refund).is_valid) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('RefundInvoiceRequestRefund').validate(dictionary.get('refund')).is_valid + return (UnionTypeLookUp.get("RefundInvoiceRequestRefund") + .validate(dictionary.get("refund")).is_valid) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'refund={self.refund!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _refund=self.refund + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund={_refund!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'refund={self.refund!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _refund=self.refund + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund={_refund!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_prepayment.py b/advancedbilling/models/refund_prepayment.py index 50432758..210209da 100644 --- a/advancedbilling/models/refund_prepayment.py +++ b/advancedbilling/models/refund_prepayment.py @@ -1,63 +1,59 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RefundPrepayment(object): - """Implementation of the 'Refund Prepayment' model. Attributes: - amount_in_cents (int): `amount` is not required if you pass - `amount_in_cents`. - amount (str | float): `amount_in_cents` is not required if you pass - `amount`. + amount_in_cents (int): `amount` is not required if you pass `amount_in_cents`. + amount (str | float): `amount_in_cents` is not required if you pass `amount`. memo (str): The model property of type str. - external (bool): Specify the type of refund you wish to initiate. When - the prepayment is external, the `external` flag is optional. But - if the prepayment was made through a payment profile, the - `external` flag is required. - additional_properties (Dict[str, object]): The additional properties - for the model. + external (bool): Specify the type of refund you wish to initiate. When the + prepayment is external, the `external` flag is optional. But if the + prepayment was made through a payment profile, the `external` flag is + required. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount_in_cents": 'amount_in_cents', - "amount": 'amount', - "memo": 'memo', - "external": 'external' + "amount_in_cents": "amount_in_cents", + "amount": "amount", + "memo": "memo", + "external": "external", } _optionals = [ - 'external', + "external", ] _nullables = [ - 'amount_in_cents', + "amount_in_cents", ] - def __init__(self, - amount_in_cents=None, - amount=None, - memo=None, - external=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RefundPrepayment class""" - + def __init__( + self, + amount_in_cents=None, + amount=None, + memo=None, + external=APIHelper.SKIP, + additional_properties=None): + """Initialize a RefundPrepayment instance.""" # Initialize members of the class - self.amount_in_cents = amount_in_cents - self.amount = amount - self.memo = memo + self.amount_in_cents = amount_in_cents + self.amount = amount + self.memo = memo if external is not APIHelper.SKIP: - self.external = external + self.external = external # Add additional model properties to the instance if additional_properties is None: @@ -67,7 +63,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -78,18 +74,37 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else None - amount = APIHelper.deserialize_union_type(UnionTypeLookUp.get('RefundPrepaymentAmount'), dictionary.get('amount'), False) if dictionary.get('amount') is not None else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - external = dictionary.get("external") if "external" in dictionary.keys() else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else None + amount = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("RefundPrepaymentAmount"), + dictionary.get("amount"), + False)\ + if dictionary.get("amount") is not None\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + external =\ + dictionary.get("external")\ + if "external" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount_in_cents, amount, @@ -99,7 +114,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -110,38 +125,88 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.amount_in_cents, - type_callable=lambda value: isinstance(value, int), - is_value_nullable=True) \ - and UnionTypeLookUp.get('RefundPrepaymentAmount').validate(dictionary.amount).is_valid \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.amount_in_cents, + type_callable=lambda value: + isinstance( + value, + int, + ), + is_value_nullable=True) \ + and (UnionTypeLookUp.get("RefundPrepaymentAmount") + .validate(dictionary.amount).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('amount_in_cents'), - type_callable=lambda value: isinstance(value, int), - is_value_nullable=True) \ - and UnionTypeLookUp.get('RefundPrepaymentAmount').validate(dictionary.get('amount')).is_valid \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("amount_in_cents"), + type_callable=lambda value: + isinstance( + value, + int, + ), + is_value_nullable=True) \ + and (UnionTypeLookUp.get("RefundPrepaymentAmount") + .validate(dictionary.get("amount")).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount_in_cents={self.amount_in_cents!r}, ' - f'amount={self.amount!r}, ' - f'memo={self.memo!r}, ' - f'external={(self.external if hasattr(self, "external") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount_in_cents=self.amount_in_cents + _amount=self.amount + _memo=self.memo + _external=( + self.external + if hasattr(self, "external") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount_in_cents={_amount_in_cents!r}, " + f"amount={_amount!r}, " + f"memo={_memo!r}, " + f"external={_external!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount_in_cents={self.amount_in_cents!s}, ' - f'amount={self.amount!s}, ' - f'memo={self.memo!s}, ' - f'external={(self.external if hasattr(self, "external") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount_in_cents=self.amount_in_cents + _amount=self.amount + _memo=self.memo + _external=( + self.external + if hasattr(self, "external") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount_in_cents={_amount_in_cents!s}, " + f"amount={_amount!s}, " + f"memo={_memo!s}, " + f"external={_external!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_prepayment_base_refund_error.py b/advancedbilling/models/refund_prepayment_base_refund_error.py index b2a6ad12..628d918d 100644 --- a/advancedbilling/models/refund_prepayment_base_refund_error.py +++ b/advancedbilling/models/refund_prepayment_base_refund_error.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.base_refund_error import BaseRefundError +from advancedbilling.models.base_refund_error import ( + BaseRefundError, +) class RefundPrepaymentBaseRefundError(object): - """Implementation of the 'Refund Prepayment Base Refund Error' model. Attributes: refund (BaseRefundError): The model property of type BaseRefundError. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "refund": 'refund' + "refund": "refund", } _optionals = [ - 'refund', + "refund", ] - def __init__(self, - refund=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RefundPrepaymentBaseRefundError class""" - + def __init__( + self, + refund=APIHelper.SKIP, + additional_properties=None): + """Initialize a RefundPrepaymentBaseRefundError instance.""" # Initialize members of the class if refund is not APIHelper.SKIP: - self.refund = refund + self.refund = refund # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - refund = BaseRefundError.from_dictionary(dictionary.get('refund')) if 'refund' in dictionary.keys() else APIHelper.SKIP + refund =\ + BaseRefundError.from_dictionary( + dictionary.get("refund"))\ + if "refund" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(refund, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'refund={(self.refund if hasattr(self, "refund") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _refund=( + self.refund + if hasattr(self, "refund") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund={_refund!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'refund={(self.refund if hasattr(self, "refund") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _refund=( + self.refund + if hasattr(self, "refund") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund={_refund!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_prepayment_request.py b/advancedbilling/models/refund_prepayment_request.py index a4237a46..645592f4 100644 --- a/advancedbilling/models/refund_prepayment_request.py +++ b/advancedbilling/models/refund_prepayment_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.refund_prepayment import RefundPrepayment +# ruff: noqa: E501 +from advancedbilling.models.refund_prepayment import ( + RefundPrepayment, +) -class RefundPrepaymentRequest(object): +class RefundPrepaymentRequest(object): """Implementation of the 'Refund Prepayment Request' model. Attributes: refund (RefundPrepayment): The model property of type RefundPrepayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "refund": 'refund' + "refund": "refund", } - def __init__(self, - refund=None, - additional_properties=None): - """Constructor for the RefundPrepaymentRequest class""" - + def __init__( + self, + refund=None, + additional_properties=None): + """Initialize a RefundPrepaymentRequest instance.""" # Initialize members of the class - self.refund = refund + self.refund = refund # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - refund = RefundPrepayment.from_dictionary(dictionary.get('refund')) if dictionary.get('refund') else None + refund =\ + RefundPrepayment.from_dictionary( + dictionary.get("refund"))\ + if dictionary.get("refund") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(refund, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'refund={self.refund!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _refund=self.refund + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund={_refund!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'refund={self.refund!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _refund=self.refund + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund={_refund!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/refund_success.py b/advancedbilling/models/refund_success.py index acc59939..098bc361 100644 --- a/advancedbilling/models/refund_success.py +++ b/advancedbilling/models/refund_success.py @@ -1,45 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RefundSuccess(object): - """Implementation of the 'Refund Success' model. Attributes: refund_id (int): The model property of type int. gateway_transaction_id (int): The model property of type int. product_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "refund_id": 'refund_id', - "gateway_transaction_id": 'gateway_transaction_id', - "product_id": 'product_id' + "refund_id": "refund_id", + "gateway_transaction_id": "gateway_transaction_id", + "product_id": "product_id", } - def __init__(self, - refund_id=None, - gateway_transaction_id=None, - product_id=None, - additional_properties=None): - """Constructor for the RefundSuccess class""" - + def __init__( + self, + refund_id=None, + gateway_transaction_id=None, + product_id=None, + additional_properties=None): + """Initialize a RefundSuccess instance.""" # Initialize members of the class - self.refund_id = refund_id - self.gateway_transaction_id = gateway_transaction_id - self.product_id = product_id + self.refund_id = refund_id + self.gateway_transaction_id = gateway_transaction_id + self.product_id = product_id # Add additional model properties to the instance if additional_properties is None: @@ -49,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -60,16 +58,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - refund_id = dictionary.get("refund_id") if dictionary.get("refund_id") else None - gateway_transaction_id = dictionary.get("gateway_transaction_id") if dictionary.get("gateway_transaction_id") else None - product_id = dictionary.get("product_id") if dictionary.get("product_id") else None + refund_id =\ + dictionary.get("refund_id")\ + if dictionary.get("refund_id")\ + else None + gateway_transaction_id =\ + dictionary.get("gateway_transaction_id")\ + if dictionary.get("gateway_transaction_id")\ + else None + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(refund_id, gateway_transaction_id, @@ -78,7 +87,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -89,35 +98,80 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.refund_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.gateway_transaction_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.product_id, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.refund_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.gateway_transaction_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.product_id, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('refund_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('gateway_transaction_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('product_id'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("refund_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("gateway_transaction_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("product_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'refund_id={self.refund_id!r}, ' - f'gateway_transaction_id={self.gateway_transaction_id!r}, ' - f'product_id={self.product_id!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _refund_id=self.refund_id + _gateway_transaction_id=self.gateway_transaction_id + _product_id=self.product_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund_id={_refund_id!r}, " + f"gateway_transaction_id={_gateway_transaction_id!r}, " + f"product_id={_product_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'refund_id={self.refund_id!s}, ' - f'gateway_transaction_id={self.gateway_transaction_id!s}, ' - f'product_id={self.product_id!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _refund_id=self.refund_id + _gateway_transaction_id=self.gateway_transaction_id + _product_id=self.product_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"refund_id={_refund_id!s}, " + f"gateway_transaction_id={_gateway_transaction_id!s}, " + f"product_id={_product_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/register.py b/advancedbilling/models/register.py new file mode 100644 index 00000000..de9d4c08 --- /dev/null +++ b/advancedbilling/models/register.py @@ -0,0 +1,173 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class Register(object): + """Implementation of the 'Register' model. + + Attributes: + id (int): The model property of type int. + maxio_id (str): The model property of type str. + name (str): The model property of type str. + currency_code (str): The ISO 4217 currency code (3 character string) + representing the currency of invoice transaction. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": "id", + "maxio_id": "maxio_id", + "name": "name", + "currency_code": "currency_code", + } + + _optionals = [ + "id", + "maxio_id", + "name", + "currency_code", + ] + + def __init__( + self, + id=APIHelper.SKIP, + maxio_id=APIHelper.SKIP, + name=APIHelper.SKIP, + currency_code=APIHelper.SKIP, + additional_properties=None): + """Initialize a Register instance.""" + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if maxio_id is not APIHelper.SKIP: + self.maxio_id = maxio_id + if name is not APIHelper.SKIP: + self.name = name + if currency_code is not APIHelper.SKIP: + self.currency_code = currency_code + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + maxio_id =\ + dictionary.get("maxio_id")\ + if dictionary.get("maxio_id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + currency_code =\ + dictionary.get("currency_code")\ + if dictionary.get("currency_code")\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(id, + maxio_id, + name, + currency_code, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _maxio_id=( + self.maxio_id + if hasattr(self, "maxio_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _currency_code=( + self.currency_code + if hasattr(self, "currency_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"maxio_id={_maxio_id!r}, " + f"name={_name!r}, " + f"currency_code={_currency_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _maxio_id=( + self.maxio_id + if hasattr(self, "maxio_id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _currency_code=( + self.currency_code + if hasattr(self, "currency_code") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"maxio_id={_maxio_id!s}, " + f"name={_name!s}, " + f"currency_code={_currency_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/remove_payment_event.py b/advancedbilling/models/remove_payment_event.py index 95520ae1..7a015125 100644 --- a/advancedbilling/models/remove_payment_event.py +++ b/advancedbilling/models/remove_payment_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType -from advancedbilling.models.remove_payment_event_data import RemovePaymentEventData +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) +from advancedbilling.models.remove_payment_event_data import ( + RemovePaymentEventData, +) class RemovePaymentEvent(object): - """Implementation of the 'Remove Payment Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (RemovePaymentEventData): Example schema for an - `remove_payment` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (RemovePaymentEventData): Example schema for an `remove_payment` + event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='remove_payment', - event_data=None, - additional_properties=None): - """Constructor for the RemovePaymentEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="remove_payment", + event_data=None, + additional_properties=None): + """Initialize a RemovePaymentEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'remove_payment' - event_data = RemovePaymentEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "remove_payment" + event_data =\ + RemovePaymentEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: RemovePaymentEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + RemovePaymentEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: RemovePaymentEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + RemovePaymentEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/remove_payment_event_data.py b/advancedbilling/models/remove_payment_event_data.py index ce356fbb..278560f0 100644 --- a/advancedbilling/models/remove_payment_event_data.py +++ b/advancedbilling/models/remove_payment_event_data.py @@ -1,74 +1,73 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RemovePaymentEventData(object): - """Implementation of the 'Remove Payment Event Data' model. Example schema for an `remove_payment` event Attributes: - transaction_id (int): Transaction ID of the original payment that was - removed + transaction_id (int): Transaction ID of the original payment that was removed memo (str): Memo of the original payment original_amount (str): Full amount of the original payment applied_amount (str): Applied amount of the original payment - transaction_time (datetime): Transaction time of the original payment, - in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" + transaction_time (datetime): Transaction time of the original payment, in ISO + 8601 format, i.e. "2019-06-07T17:20:06Z" payment_method (PaymentMethodApplePay | PaymentMethodBankAccount | - PaymentMethodCreditCard | PaymentMethodExternal | - PaymentMethodPaypal): A nested data structure detailing the method - of payment - prepayment (bool): The flag that shows whether the original payment - was a prepayment or not - additional_properties (Dict[str, object]): The additional properties - for the model. + PaymentMethodCreditCard | PaymentMethodExternal | PaymentMethodPaypal): A + nested data structure detailing the method of payment + prepayment (bool): The flag that shows whether the original payment was a + prepayment or not + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "transaction_id": 'transaction_id', - "memo": 'memo', - "applied_amount": 'applied_amount', - "transaction_time": 'transaction_time', - "payment_method": 'payment_method', - "prepayment": 'prepayment', - "original_amount": 'original_amount' + "transaction_id": "transaction_id", + "memo": "memo", + "applied_amount": "applied_amount", + "transaction_time": "transaction_time", + "payment_method": "payment_method", + "prepayment": "prepayment", + "original_amount": "original_amount", } _optionals = [ - 'original_amount', + "original_amount", ] - def __init__(self, - transaction_id=None, - memo=None, - applied_amount=None, - transaction_time=None, - payment_method=None, - prepayment=None, - original_amount=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RemovePaymentEventData class""" - + def __init__( + self, + transaction_id=None, + memo=None, + applied_amount=None, + transaction_time=None, + payment_method=None, + prepayment=None, + original_amount=APIHelper.SKIP, + additional_properties=None): + """Initialize a RemovePaymentEventData instance.""" # Initialize members of the class - self.transaction_id = transaction_id - self.memo = memo + self.transaction_id = transaction_id + self.memo = memo if original_amount is not APIHelper.SKIP: - self.original_amount = original_amount - self.applied_amount = applied_amount - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None - self.payment_method = payment_method - self.prepayment = prepayment + self.original_amount = original_amount + self.applied_amount = applied_amount + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None + self.payment_method = payment_method + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -78,7 +77,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -89,21 +88,48 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - transaction_id = dictionary.get("transaction_id") if dictionary.get("transaction_id") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else None - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else None - payment_method = APIHelper.deserialize_union_type(UnionTypeLookUp.get('Invoice-Event-Payment'), dictionary.get('payment_method'), False) if dictionary.get('payment_method') is not None else None - prepayment = dictionary.get("prepayment") if "prepayment" in dictionary.keys() else None - original_amount = dictionary.get("original_amount") if dictionary.get("original_amount") else APIHelper.SKIP + transaction_id =\ + dictionary.get("transaction_id")\ + if dictionary.get("transaction_id")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else None + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else None + payment_method = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("Invoice-Event-Payment"), + dictionary.get("payment_method"), + False)\ + if dictionary.get("payment_method") is not None\ + else None + prepayment =\ + dictionary.get("prepayment")\ + if "prepayment" in dictionary.keys()\ + else None + original_amount =\ + dictionary.get("original_amount")\ + if dictionary.get("original_amount")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(transaction_id, memo, @@ -116,7 +142,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -127,54 +153,140 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.transaction_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.applied_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.transaction_time, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and UnionTypeLookUp.get('Invoice-Event-Payment').validate(dictionary.payment_method).is_valid \ - and APIHelper.is_valid_type(value=dictionary.prepayment, - type_callable=lambda value: isinstance(value, bool)) + return APIHelper.is_valid_type( + value=dictionary.transaction_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.applied_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.transaction_time, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and (UnionTypeLookUp.get("Invoice-Event-Payment") + .validate(dictionary.payment_method).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.prepayment, + type_callable=lambda value: + isinstance( + value, + bool, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('transaction_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('applied_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('transaction_time'), - type_callable=lambda value: isinstance(value, str)) \ - and UnionTypeLookUp.get('Invoice-Event-Payment').validate(dictionary.get('payment_method')).is_valid \ - and APIHelper.is_valid_type(value=dictionary.get('prepayment'), - type_callable=lambda value: isinstance(value, bool)) + return APIHelper.is_valid_type( + value=dictionary.get("transaction_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("applied_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("transaction_time"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and (UnionTypeLookUp.get("Invoice-Event-Payment") + .validate(dictionary.get("payment_method")).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.get("prepayment"), + type_callable=lambda value: + isinstance( + value, + bool, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'transaction_id={self.transaction_id!r}, ' - f'memo={self.memo!r}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!r}, ' - f'applied_amount={self.applied_amount!r}, ' - f'transaction_time={self.transaction_time!r}, ' - f'payment_method={self.payment_method!r}, ' - f'prepayment={self.prepayment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _transaction_id=self.transaction_id + _memo=self.memo + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _payment_method=self.payment_method + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_id={_transaction_id!r}, " + f"memo={_memo!r}, " + f"original_amount={_original_amount!r}, " + f"applied_amount={_applied_amount!r}, " + f"transaction_time={_transaction_time!r}, " + f"payment_method={_payment_method!r}, " + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'transaction_id={self.transaction_id!s}, ' - f'memo={self.memo!s}, ' - f'original_amount={(self.original_amount if hasattr(self, "original_amount") else None)!s}, ' - f'applied_amount={self.applied_amount!s}, ' - f'transaction_time={self.transaction_time!s}, ' - f'payment_method={self.payment_method!s}, ' - f'prepayment={self.prepayment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _transaction_id=self.transaction_id + _memo=self.memo + _original_amount=( + self.original_amount + if hasattr(self, "original_amount") + else None + ) + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _payment_method=self.payment_method + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_id={_transaction_id!s}, " + f"memo={_memo!s}, " + f"original_amount={_original_amount!s}, " + f"applied_amount={_applied_amount!s}, " + f"transaction_time={_transaction_time!s}, " + f"payment_method={_payment_method!s}, " + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/renewal_preview.py b/advancedbilling/models/renewal_preview.py index caeb7642..88afbfe2 100644 --- a/advancedbilling/models/renewal_preview.py +++ b/advancedbilling/models/renewal_preview.py @@ -1,104 +1,105 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.renewal_preview_line_item import RenewalPreviewLineItem +from advancedbilling.models.renewal_preview_line_item import ( + RenewalPreviewLineItem, +) class RenewalPreview(object): - """Implementation of the 'Renewal Preview' model. Attributes: - next_assessment_at (datetime): The timestamp for the subscription’s - next renewal - subtotal_in_cents (int): An integer representing the amount of the - total pre-tax, pre-discount charges that will be assessed at the - next renewal - total_tax_in_cents (int): An integer representing the total tax - charges that will be assessed at the next renewal - total_discount_in_cents (int): An integer representing the amount of - the coupon discounts that will be applied to the next renewal - total_in_cents (int): An integer representing the total amount owed, - less any discounts, that will be assessed at the next renewal - existing_balance_in_cents (int): An integer representing the amount of - the subscription’s current balance + next_assessment_at (datetime): The timestamp for the subscription’s next + renewal + subtotal_in_cents (int): An integer representing the amount of the total + pre-tax, pre-discount charges that will be assessed at the next renewal + total_tax_in_cents (int): An integer representing the total tax charges that + will be assessed at the next renewal + total_discount_in_cents (int): An integer representing the amount of the + coupon discounts that will be applied to the next renewal + total_in_cents (int): An integer representing the total amount owed, less any + discounts, that will be assessed at the next renewal + existing_balance_in_cents (int): An integer representing the amount of the + subscription’s current balance total_amount_due_in_cents (int): An integer representing the existing_balance_in_cents plus the total_in_cents - uncalculated_taxes (bool): A boolean indicating whether or not - additional taxes will be calculated at the time of renewal. This - will be true if you are using Avalara and the address of the - subscription is in one of your defined taxable regions. - line_items (List[RenewalPreviewLineItem]): An array of objects - representing the individual transactions that will be created at - the next renewal - additional_properties (Dict[str, object]): The additional properties - for the model. + uncalculated_taxes (bool): A boolean indicating whether or not additional + taxes will be calculated at the time of renewal. This will be true if you + are using Avalara and the address of the subscription is in one of your + defined taxable regions. + line_items (List[RenewalPreviewLineItem]): An array of objects representing + the individual transactions that will be created at the next renewal + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "next_assessment_at": 'next_assessment_at', - "subtotal_in_cents": 'subtotal_in_cents', - "total_tax_in_cents": 'total_tax_in_cents', - "total_discount_in_cents": 'total_discount_in_cents', - "total_in_cents": 'total_in_cents', - "existing_balance_in_cents": 'existing_balance_in_cents', - "total_amount_due_in_cents": 'total_amount_due_in_cents', - "uncalculated_taxes": 'uncalculated_taxes', - "line_items": 'line_items' + "next_assessment_at": "next_assessment_at", + "subtotal_in_cents": "subtotal_in_cents", + "total_tax_in_cents": "total_tax_in_cents", + "total_discount_in_cents": "total_discount_in_cents", + "total_in_cents": "total_in_cents", + "existing_balance_in_cents": "existing_balance_in_cents", + "total_amount_due_in_cents": "total_amount_due_in_cents", + "uncalculated_taxes": "uncalculated_taxes", + "line_items": "line_items", } _optionals = [ - 'next_assessment_at', - 'subtotal_in_cents', - 'total_tax_in_cents', - 'total_discount_in_cents', - 'total_in_cents', - 'existing_balance_in_cents', - 'total_amount_due_in_cents', - 'uncalculated_taxes', - 'line_items', + "next_assessment_at", + "subtotal_in_cents", + "total_tax_in_cents", + "total_discount_in_cents", + "total_in_cents", + "existing_balance_in_cents", + "total_amount_due_in_cents", + "uncalculated_taxes", + "line_items", ] - def __init__(self, - next_assessment_at=APIHelper.SKIP, - subtotal_in_cents=APIHelper.SKIP, - total_tax_in_cents=APIHelper.SKIP, - total_discount_in_cents=APIHelper.SKIP, - total_in_cents=APIHelper.SKIP, - existing_balance_in_cents=APIHelper.SKIP, - total_amount_due_in_cents=APIHelper.SKIP, - uncalculated_taxes=APIHelper.SKIP, - line_items=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RenewalPreview class""" - + def __init__( + self, + next_assessment_at=APIHelper.SKIP, + subtotal_in_cents=APIHelper.SKIP, + total_tax_in_cents=APIHelper.SKIP, + total_discount_in_cents=APIHelper.SKIP, + total_in_cents=APIHelper.SKIP, + existing_balance_in_cents=APIHelper.SKIP, + total_amount_due_in_cents=APIHelper.SKIP, + uncalculated_taxes=APIHelper.SKIP, + line_items=APIHelper.SKIP, + additional_properties=None): + """Initialize a RenewalPreview instance.""" # Initialize members of the class if next_assessment_at is not APIHelper.SKIP: - self.next_assessment_at = APIHelper.apply_datetime_converter(next_assessment_at, APIHelper.RFC3339DateTime) if next_assessment_at else None + self.next_assessment_at =\ + APIHelper.apply_datetime_converter( + next_assessment_at, APIHelper.RFC3339DateTime)\ + if next_assessment_at else None if subtotal_in_cents is not APIHelper.SKIP: - self.subtotal_in_cents = subtotal_in_cents + self.subtotal_in_cents = subtotal_in_cents if total_tax_in_cents is not APIHelper.SKIP: - self.total_tax_in_cents = total_tax_in_cents + self.total_tax_in_cents = total_tax_in_cents if total_discount_in_cents is not APIHelper.SKIP: - self.total_discount_in_cents = total_discount_in_cents + self.total_discount_in_cents = total_discount_in_cents if total_in_cents is not APIHelper.SKIP: - self.total_in_cents = total_in_cents + self.total_in_cents = total_in_cents if existing_balance_in_cents is not APIHelper.SKIP: - self.existing_balance_in_cents = existing_balance_in_cents + self.existing_balance_in_cents = existing_balance_in_cents if total_amount_due_in_cents is not APIHelper.SKIP: - self.total_amount_due_in_cents = total_amount_due_in_cents + self.total_amount_due_in_cents = total_amount_due_in_cents if uncalculated_taxes is not APIHelper.SKIP: - self.uncalculated_taxes = uncalculated_taxes + self.uncalculated_taxes = uncalculated_taxes if line_items is not APIHelper.SKIP: - self.line_items = line_items + self.line_items = line_items # Add additional model properties to the instance if additional_properties is None: @@ -108,7 +109,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -119,26 +120,54 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - next_assessment_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_assessment_at")).datetime if dictionary.get("next_assessment_at") else APIHelper.SKIP - subtotal_in_cents = dictionary.get("subtotal_in_cents") if dictionary.get("subtotal_in_cents") else APIHelper.SKIP - total_tax_in_cents = dictionary.get("total_tax_in_cents") if dictionary.get("total_tax_in_cents") else APIHelper.SKIP - total_discount_in_cents = dictionary.get("total_discount_in_cents") if dictionary.get("total_discount_in_cents") else APIHelper.SKIP - total_in_cents = dictionary.get("total_in_cents") if dictionary.get("total_in_cents") else APIHelper.SKIP - existing_balance_in_cents = dictionary.get("existing_balance_in_cents") if dictionary.get("existing_balance_in_cents") else APIHelper.SKIP - total_amount_due_in_cents = dictionary.get("total_amount_due_in_cents") if dictionary.get("total_amount_due_in_cents") else APIHelper.SKIP - uncalculated_taxes = dictionary.get("uncalculated_taxes") if "uncalculated_taxes" in dictionary.keys() else APIHelper.SKIP + next_assessment_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_assessment_at")).datetime\ + if dictionary.get("next_assessment_at") else APIHelper.SKIP + subtotal_in_cents =\ + dictionary.get("subtotal_in_cents")\ + if dictionary.get("subtotal_in_cents")\ + else APIHelper.SKIP + total_tax_in_cents =\ + dictionary.get("total_tax_in_cents")\ + if dictionary.get("total_tax_in_cents")\ + else APIHelper.SKIP + total_discount_in_cents =\ + dictionary.get("total_discount_in_cents")\ + if dictionary.get("total_discount_in_cents")\ + else APIHelper.SKIP + total_in_cents =\ + dictionary.get("total_in_cents")\ + if dictionary.get("total_in_cents")\ + else APIHelper.SKIP + existing_balance_in_cents =\ + dictionary.get("existing_balance_in_cents")\ + if dictionary.get("existing_balance_in_cents")\ + else APIHelper.SKIP + total_amount_due_in_cents =\ + dictionary.get("total_amount_due_in_cents")\ + if dictionary.get("total_amount_due_in_cents")\ + else APIHelper.SKIP + uncalculated_taxes =\ + dictionary.get("uncalculated_taxes")\ + if "uncalculated_taxes" in dictionary.keys()\ + else APIHelper.SKIP line_items = None - if dictionary.get('line_items') is not None: - line_items = [RenewalPreviewLineItem.from_dictionary(x) for x in dictionary.get('line_items')] + if dictionary.get("line_items") is not None: + line_items = [ + RenewalPreviewLineItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] else: line_items = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(next_assessment_at, subtotal_in_cents, @@ -152,27 +181,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!r}, ' - f'subtotal_in_cents={(self.subtotal_in_cents if hasattr(self, "subtotal_in_cents") else None)!r}, ' - f'total_tax_in_cents={(self.total_tax_in_cents if hasattr(self, "total_tax_in_cents") else None)!r}, ' - f'total_discount_in_cents={(self.total_discount_in_cents if hasattr(self, "total_discount_in_cents") else None)!r}, ' - f'total_in_cents={(self.total_in_cents if hasattr(self, "total_in_cents") else None)!r}, ' - f'existing_balance_in_cents={(self.existing_balance_in_cents if hasattr(self, "existing_balance_in_cents") else None)!r}, ' - f'total_amount_due_in_cents={(self.total_amount_due_in_cents if hasattr(self, "total_amount_due_in_cents") else None)!r}, ' - f'uncalculated_taxes={(self.uncalculated_taxes if hasattr(self, "uncalculated_taxes") else None)!r}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _subtotal_in_cents=( + self.subtotal_in_cents + if hasattr(self, "subtotal_in_cents") + else None + ) + _total_tax_in_cents=( + self.total_tax_in_cents + if hasattr(self, "total_tax_in_cents") + else None + ) + _total_discount_in_cents=( + self.total_discount_in_cents + if hasattr(self, "total_discount_in_cents") + else None + ) + _total_in_cents=( + self.total_in_cents + if hasattr(self, "total_in_cents") + else None + ) + _existing_balance_in_cents=( + self.existing_balance_in_cents + if hasattr(self, "existing_balance_in_cents") + else None + ) + _total_amount_due_in_cents=( + self.total_amount_due_in_cents + if hasattr(self, "total_amount_due_in_cents") + else None + ) + _uncalculated_taxes=( + self.uncalculated_taxes + if hasattr(self, "uncalculated_taxes") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"next_assessment_at={_next_assessment_at!r}, " + f"subtotal_in_cents={_subtotal_in_cents!r}, " + f"total_tax_in_cents={_total_tax_in_cents!r}, " + f"total_discount_in_cents={_total_discount_in_cents!r}, " + f"total_in_cents={_total_in_cents!r}, " + f"existing_balance_in_cents={_existing_balance_in_cents!r}, " + f"total_amount_due_in_cents={_total_amount_due_in_cents!r}, " + f"uncalculated_taxes={_uncalculated_taxes!r}, " + f"line_items={_line_items!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!s}, ' - f'subtotal_in_cents={(self.subtotal_in_cents if hasattr(self, "subtotal_in_cents") else None)!s}, ' - f'total_tax_in_cents={(self.total_tax_in_cents if hasattr(self, "total_tax_in_cents") else None)!s}, ' - f'total_discount_in_cents={(self.total_discount_in_cents if hasattr(self, "total_discount_in_cents") else None)!s}, ' - f'total_in_cents={(self.total_in_cents if hasattr(self, "total_in_cents") else None)!s}, ' - f'existing_balance_in_cents={(self.existing_balance_in_cents if hasattr(self, "existing_balance_in_cents") else None)!s}, ' - f'total_amount_due_in_cents={(self.total_amount_due_in_cents if hasattr(self, "total_amount_due_in_cents") else None)!s}, ' - f'uncalculated_taxes={(self.uncalculated_taxes if hasattr(self, "uncalculated_taxes") else None)!s}, ' - f'line_items={(self.line_items if hasattr(self, "line_items") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _subtotal_in_cents=( + self.subtotal_in_cents + if hasattr(self, "subtotal_in_cents") + else None + ) + _total_tax_in_cents=( + self.total_tax_in_cents + if hasattr(self, "total_tax_in_cents") + else None + ) + _total_discount_in_cents=( + self.total_discount_in_cents + if hasattr(self, "total_discount_in_cents") + else None + ) + _total_in_cents=( + self.total_in_cents + if hasattr(self, "total_in_cents") + else None + ) + _existing_balance_in_cents=( + self.existing_balance_in_cents + if hasattr(self, "existing_balance_in_cents") + else None + ) + _total_amount_due_in_cents=( + self.total_amount_due_in_cents + if hasattr(self, "total_amount_due_in_cents") + else None + ) + _uncalculated_taxes=( + self.uncalculated_taxes + if hasattr(self, "uncalculated_taxes") + else None + ) + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"next_assessment_at={_next_assessment_at!s}, " + f"subtotal_in_cents={_subtotal_in_cents!s}, " + f"total_tax_in_cents={_total_tax_in_cents!s}, " + f"total_discount_in_cents={_total_discount_in_cents!s}, " + f"total_in_cents={_total_in_cents!s}, " + f"existing_balance_in_cents={_existing_balance_in_cents!s}, " + f"total_amount_due_in_cents={_total_amount_due_in_cents!s}, " + f"uncalculated_taxes={_uncalculated_taxes!s}, " + f"line_items={_line_items!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/renewal_preview_component.py b/advancedbilling/models/renewal_preview_component.py index 49759b67..b2ca845a 100644 --- a/advancedbilling/models/renewal_preview_component.py +++ b/advancedbilling/models/renewal_preview_component.py @@ -1,63 +1,60 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RenewalPreviewComponent(object): - """Implementation of the 'Renewal Preview Component' model. Attributes: - component_id (str | int | None): Either the component's Chargify id or - its handle prefixed with `handle:` - quantity (int): The quantity for which you wish to preview billing. - This is useful if you want to preview a predicted, higher usage - value than is currently present on the subscription. This - quantity represents: - Whether or not an on/off component is - enabled - use 0 for disabled or 1 for enabled - The desired - allocated_quantity for a quantity-based component - The desired - unit_balance for a metered component - The desired metric quantity - for an events-based component + component_id (str | int | None): Either the component's Chargify id or its + handle prefixed with `handle:` + quantity (int): The quantity for which you wish to preview billing. This is + useful if you want to preview a predicted, higher usage value than is + currently present on the subscription. This quantity represents: - + Whether or not an on/off component is enabled - use 0 for disabled or 1 + for enabled - The desired allocated_quantity for a quantity-based + component - The desired unit_balance for a metered component - The + desired metric quantity for an events-based component price_point_id (str | int | None): Either the component price point's Chargify id or its handle prefixed with `handle:` - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "quantity": 'quantity', - "price_point_id": 'price_point_id' + "component_id": "component_id", + "quantity": "quantity", + "price_point_id": "price_point_id", } _optionals = [ - 'component_id', - 'quantity', - 'price_point_id', + "component_id", + "quantity", + "price_point_id", ] - def __init__(self, - component_id=APIHelper.SKIP, - quantity=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RenewalPreviewComponent class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a RenewalPreviewComponent instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id # Add additional model properties to the instance if additional_properties is None: @@ -67,7 +64,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -78,17 +75,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('RenewalPreviewComponentComponentId'), dictionary.get('component_id'), False) if dictionary.get('component_id') is not None else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - price_point_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('RenewalPreviewComponentPricePointId'), dictionary.get('price_point_id'), False) if dictionary.get('price_point_id') is not None else APIHelper.SKIP + component_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("RenewalPreviewComponentComponentId"), + dictionary.get("component_id"), + False)\ + if dictionary.get("component_id") is not None\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("RenewalPreviewComponentPricePointId"), + dictionary.get("price_point_id"), + False)\ + if dictionary.get("price_point_id") is not None\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, quantity, @@ -96,15 +111,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"quantity={_quantity!r}, " + f"price_point_id={_price_point_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"quantity={_quantity!s}, " + f"price_point_id={_price_point_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/renewal_preview_line_item.py b/advancedbilling/models/renewal_preview_line_item.py index b518d7bd..9d2f9c33 100644 --- a/advancedbilling/models/renewal_preview_line_item.py +++ b/advancedbilling/models/renewal_preview_line_item.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RenewalPreviewLineItem(object): - """Implementation of the 'Renewal Preview Line Item' model. Attributes: @@ -29,93 +27,93 @@ class RenewalPreviewLineItem(object): product_handle (str): The model property of type str. period_range_start (str): The model property of type str. period_range_end (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "transaction_type": 'transaction_type', - "kind": 'kind', - "amount_in_cents": 'amount_in_cents', - "memo": 'memo', - "discount_amount_in_cents": 'discount_amount_in_cents', - "taxable_amount_in_cents": 'taxable_amount_in_cents', - "product_id": 'product_id', - "product_name": 'product_name', - "component_id": 'component_id', - "component_handle": 'component_handle', - "component_name": 'component_name', - "product_handle": 'product_handle', - "period_range_start": 'period_range_start', - "period_range_end": 'period_range_end' + "transaction_type": "transaction_type", + "kind": "kind", + "amount_in_cents": "amount_in_cents", + "memo": "memo", + "discount_amount_in_cents": "discount_amount_in_cents", + "taxable_amount_in_cents": "taxable_amount_in_cents", + "product_id": "product_id", + "product_name": "product_name", + "component_id": "component_id", + "component_handle": "component_handle", + "component_name": "component_name", + "product_handle": "product_handle", + "period_range_start": "period_range_start", + "period_range_end": "period_range_end", } _optionals = [ - 'transaction_type', - 'kind', - 'amount_in_cents', - 'memo', - 'discount_amount_in_cents', - 'taxable_amount_in_cents', - 'product_id', - 'product_name', - 'component_id', - 'component_handle', - 'component_name', - 'product_handle', - 'period_range_start', - 'period_range_end', + "transaction_type", + "kind", + "amount_in_cents", + "memo", + "discount_amount_in_cents", + "taxable_amount_in_cents", + "product_id", + "product_name", + "component_id", + "component_handle", + "component_name", + "product_handle", + "period_range_start", + "period_range_end", ] - def __init__(self, - transaction_type=APIHelper.SKIP, - kind=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - memo=APIHelper.SKIP, - discount_amount_in_cents=APIHelper.SKIP, - taxable_amount_in_cents=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_name=APIHelper.SKIP, - component_id=APIHelper.SKIP, - component_handle=APIHelper.SKIP, - component_name=APIHelper.SKIP, - product_handle=APIHelper.SKIP, - period_range_start=APIHelper.SKIP, - period_range_end=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RenewalPreviewLineItem class""" - + def __init__( + self, + transaction_type=APIHelper.SKIP, + kind=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + memo=APIHelper.SKIP, + discount_amount_in_cents=APIHelper.SKIP, + taxable_amount_in_cents=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_name=APIHelper.SKIP, + component_id=APIHelper.SKIP, + component_handle=APIHelper.SKIP, + component_name=APIHelper.SKIP, + product_handle=APIHelper.SKIP, + period_range_start=APIHelper.SKIP, + period_range_end=APIHelper.SKIP, + additional_properties=None): + """Initialize a RenewalPreviewLineItem instance.""" # Initialize members of the class if transaction_type is not APIHelper.SKIP: - self.transaction_type = transaction_type + self.transaction_type = transaction_type if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if discount_amount_in_cents is not APIHelper.SKIP: - self.discount_amount_in_cents = discount_amount_in_cents + self.discount_amount_in_cents = discount_amount_in_cents if taxable_amount_in_cents is not APIHelper.SKIP: - self.taxable_amount_in_cents = taxable_amount_in_cents + self.taxable_amount_in_cents = taxable_amount_in_cents if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_name is not APIHelper.SKIP: - self.product_name = product_name + self.product_name = product_name if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if component_handle is not APIHelper.SKIP: - self.component_handle = component_handle + self.component_handle = component_handle if component_name is not APIHelper.SKIP: - self.component_name = component_name + self.component_name = component_name if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if period_range_start is not APIHelper.SKIP: - self.period_range_start = period_range_start + self.period_range_start = period_range_start if period_range_end is not APIHelper.SKIP: - self.period_range_end = period_range_end + self.period_range_end = period_range_end # Add additional model properties to the instance if additional_properties is None: @@ -125,7 +123,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -136,27 +134,71 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - transaction_type = dictionary.get("transaction_type") if dictionary.get("transaction_type") else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - discount_amount_in_cents = dictionary.get("discount_amount_in_cents") if dictionary.get("discount_amount_in_cents") else APIHelper.SKIP - taxable_amount_in_cents = dictionary.get("taxable_amount_in_cents") if dictionary.get("taxable_amount_in_cents") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_name = dictionary.get("product_name") if dictionary.get("product_name") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else APIHelper.SKIP - component_name = dictionary.get("component_name") if dictionary.get("component_name") else APIHelper.SKIP - product_handle = dictionary.get("product_handle") if dictionary.get("product_handle") else APIHelper.SKIP - period_range_start = dictionary.get("period_range_start") if dictionary.get("period_range_start") else APIHelper.SKIP - period_range_end = dictionary.get("period_range_end") if dictionary.get("period_range_end") else APIHelper.SKIP + transaction_type =\ + dictionary.get("transaction_type")\ + if dictionary.get("transaction_type")\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + discount_amount_in_cents =\ + dictionary.get("discount_amount_in_cents")\ + if dictionary.get("discount_amount_in_cents")\ + else APIHelper.SKIP + taxable_amount_in_cents =\ + dictionary.get("taxable_amount_in_cents")\ + if dictionary.get("taxable_amount_in_cents")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_name =\ + dictionary.get("product_name")\ + if dictionary.get("product_name")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + component_handle =\ + dictionary.get("component_handle")\ + if dictionary.get("component_handle")\ + else APIHelper.SKIP + component_name =\ + dictionary.get("component_name")\ + if dictionary.get("component_name")\ + else APIHelper.SKIP + product_handle =\ + dictionary.get("product_handle")\ + if dictionary.get("product_handle")\ + else APIHelper.SKIP + period_range_start =\ + dictionary.get("period_range_start")\ + if dictionary.get("period_range_start")\ + else APIHelper.SKIP + period_range_end =\ + dictionary.get("period_range_end")\ + if dictionary.get("period_range_end")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(transaction_type, kind, @@ -175,37 +217,187 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'transaction_type={(self.transaction_type if hasattr(self, "transaction_type") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'discount_amount_in_cents={(self.discount_amount_in_cents if hasattr(self, "discount_amount_in_cents") else None)!r}, ' - f'taxable_amount_in_cents={(self.taxable_amount_in_cents if hasattr(self, "taxable_amount_in_cents") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!r}, ' - f'component_name={(self.component_name if hasattr(self, "component_name") else None)!r}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!r}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _transaction_type=( + self.transaction_type + if hasattr(self, "transaction_type") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _discount_amount_in_cents=( + self.discount_amount_in_cents + if hasattr(self, "discount_amount_in_cents") + else None + ) + _taxable_amount_in_cents=( + self.taxable_amount_in_cents + if hasattr(self, "taxable_amount_in_cents") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _component_name=( + self.component_name + if hasattr(self, "component_name") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_type={_transaction_type!r}, " + f"kind={_kind!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"memo={_memo!r}, " + f"discount_amount_in_cents={_discount_amount_in_cents!r}, " + f"taxable_amount_in_cents={_taxable_amount_in_cents!r}, " + f"product_id={_product_id!r}, " + f"product_name={_product_name!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"component_name={_component_name!r}, " + f"product_handle={_product_handle!r}, " + f"period_range_start={_period_range_start!r}, " + f"period_range_end={_period_range_end!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'transaction_type={(self.transaction_type if hasattr(self, "transaction_type") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'discount_amount_in_cents={(self.discount_amount_in_cents if hasattr(self, "discount_amount_in_cents") else None)!s}, ' - f'taxable_amount_in_cents={(self.taxable_amount_in_cents if hasattr(self, "taxable_amount_in_cents") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_name={(self.product_name if hasattr(self, "product_name") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!s}, ' - f'component_name={(self.component_name if hasattr(self, "component_name") else None)!s}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'period_range_start={(self.period_range_start if hasattr(self, "period_range_start") else None)!s}, ' - f'period_range_end={(self.period_range_end if hasattr(self, "period_range_end") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _transaction_type=( + self.transaction_type + if hasattr(self, "transaction_type") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _discount_amount_in_cents=( + self.discount_amount_in_cents + if hasattr(self, "discount_amount_in_cents") + else None + ) + _taxable_amount_in_cents=( + self.taxable_amount_in_cents + if hasattr(self, "taxable_amount_in_cents") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_name=( + self.product_name + if hasattr(self, "product_name") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _component_name=( + self.component_name + if hasattr(self, "component_name") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"transaction_type={_transaction_type!s}, " + f"kind={_kind!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"memo={_memo!s}, " + f"discount_amount_in_cents={_discount_amount_in_cents!s}, " + f"taxable_amount_in_cents={_taxable_amount_in_cents!s}, " + f"product_id={_product_id!s}, " + f"product_name={_product_name!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"component_name={_component_name!s}, " + f"product_handle={_product_handle!s}, " + f"period_range_start={_period_range_start!s}, " + f"period_range_end={_period_range_end!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/renewal_preview_request.py b/advancedbilling/models/renewal_preview_request.py index 42147fcd..cc35c7d6 100644 --- a/advancedbilling/models/renewal_preview_request.py +++ b/advancedbilling/models/renewal_preview_request.py @@ -1,48 +1,47 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.renewal_preview_component import RenewalPreviewComponent +from advancedbilling.models.renewal_preview_component import ( + RenewalPreviewComponent, +) class RenewalPreviewRequest(object): - """Implementation of the 'Renewal Preview Request' model. Attributes: - components (List[RenewalPreviewComponent]): An optional array of - component definitions to preview. Providing any component - definitions here will override the actual components on the - subscription (and their quantities), and the billing preview will - contain only these components (in addition to any product base - fees). - additional_properties (Dict[str, object]): The additional properties - for the model. + components (List[RenewalPreviewComponent]): An optional array of component + definitions to preview. Providing any component definitions here will + override the actual components on the subscription (and their + quantities), and the billing preview will contain only these components + (in addition to any product base fees). + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "components": 'components' + "components": "components", } _optionals = [ - 'components', + "components", ] - def __init__(self, - components=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RenewalPreviewRequest class""" - + def __init__( + self, + components=APIHelper.SKIP, + additional_properties=None): + """Initialize a RenewalPreviewRequest instance.""" # Initialize members of the class if components is not APIHelper.SKIP: - self.components = components + self.components = components # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +51,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +62,53 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary components = None - if dictionary.get('components') is not None: - components = [RenewalPreviewComponent.from_dictionary(x) for x in dictionary.get('components')] + if dictionary.get("components") is not None: + components = [ + RenewalPreviewComponent.from_dictionary(x) + for x in dictionary.get("components") + ] else: components = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(components, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'components={(self.components if hasattr(self, "components") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _components=( + self.components + if hasattr(self, "components") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"components={_components!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'components={(self.components if hasattr(self, "components") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _components=( + self.components + if hasattr(self, "components") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"components={_components!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/renewal_preview_response.py b/advancedbilling/models/renewal_preview_response.py index a5dde2f5..d4a37385 100644 --- a/advancedbilling/models/renewal_preview_response.py +++ b/advancedbilling/models/renewal_preview_response.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.renewal_preview import RenewalPreview +# ruff: noqa: E501 +from advancedbilling.models.renewal_preview import ( + RenewalPreview, +) -class RenewalPreviewResponse(object): +class RenewalPreviewResponse(object): """Implementation of the 'Renewal Preview Response' model. Attributes: - renewal_preview (RenewalPreview): The model property of type - RenewalPreview. - additional_properties (Dict[str, object]): The additional properties - for the model. + renewal_preview (RenewalPreview): The model property of type RenewalPreview. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "renewal_preview": 'renewal_preview' + "renewal_preview": "renewal_preview", } - def __init__(self, - renewal_preview=None, - additional_properties=None): - """Constructor for the RenewalPreviewResponse class""" - + def __init__( + self, + renewal_preview=None, + additional_properties=None): + """Initialize a RenewalPreviewResponse instance.""" # Initialize members of the class - self.renewal_preview = renewal_preview + self.renewal_preview = renewal_preview # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - renewal_preview = RenewalPreview.from_dictionary(dictionary.get('renewal_preview')) if dictionary.get('renewal_preview') else None + renewal_preview =\ + RenewalPreview.from_dictionary( + dictionary.get("renewal_preview"))\ + if dictionary.get("renewal_preview") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(renewal_preview, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'renewal_preview={self.renewal_preview!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _renewal_preview=self.renewal_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_preview={_renewal_preview!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'renewal_preview={self.renewal_preview!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _renewal_preview=self.renewal_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_preview={_renewal_preview!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/replay_webhooks_request.py b/advancedbilling/models/replay_webhooks_request.py index 07b351c8..65759ee1 100644 --- a/advancedbilling/models/replay_webhooks_request.py +++ b/advancedbilling/models/replay_webhooks_request.py @@ -1,36 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class ReplayWebhooksRequest(object): - """Implementation of the 'Replay Webhooks Request' model. Attributes: ids (List[int]): The model property of type List[int]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "ids": 'ids' + "ids": "ids", } - def __init__(self, - ids=None, - additional_properties=None): - """Constructor for the ReplayWebhooksRequest class""" - + def __init__( + self, + ids=None, + additional_properties=None): + """Initialize a ReplayWebhooksRequest instance.""" # Initialize members of the class - self.ids = ids + self.ids = ids # Add additional model properties to the instance if additional_properties is None: @@ -40,7 +36,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -51,24 +47,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - ids = dictionary.get("ids") if dictionary.get("ids") else None + ids =\ + dictionary.get("ids")\ + if dictionary.get("ids")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(ids, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'ids={self.ids!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _ids=self.ids + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ids={_ids!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'ids={self.ids!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _ids=self.ids + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"ids={_ids!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/replay_webhooks_response.py b/advancedbilling/models/replay_webhooks_response.py index b870a1fe..8ad66008 100644 --- a/advancedbilling/models/replay_webhooks_response.py +++ b/advancedbilling/models/replay_webhooks_response.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ReplayWebhooksResponse(object): - """Implementation of the 'Replay Webhooks Response' model. Attributes: status (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "status": 'status' + "status": "status", } _optionals = [ - 'status', + "status", ] - def __init__(self, - status=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ReplayWebhooksResponse class""" - + def __init__( + self, + status=APIHelper.SKIP, + additional_properties=None): + """Initialize a ReplayWebhooksResponse instance.""" # Initialize members of the class if status is not APIHelper.SKIP: - self.status = status + self.status = status # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(status, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'status={(self.status if hasattr(self, "status") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _status=( + self.status + if hasattr(self, "status") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"status={_status!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'status={(self.status if hasattr(self, "status") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _status=( + self.status + if hasattr(self, "status") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"status={_status!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/resent_invitation.py b/advancedbilling/models/resent_invitation.py index ef251642..2df29dfe 100644 --- a/advancedbilling/models/resent_invitation.py +++ b/advancedbilling/models/resent_invitation.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ResentInvitation(object): - """Implementation of the 'Resent Invitation' model. Attributes: @@ -19,55 +17,60 @@ class ResentInvitation(object): send_invite_link_text (str): The model property of type str. uninvited_count (int): The model property of type int. last_invite_sent_at (datetime): The model property of type datetime. - last_invite_accepted_at (datetime): The model property of type - datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + last_invite_accepted_at (datetime): The model property of type datetime. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "last_sent_at": 'last_sent_at', - "last_accepted_at": 'last_accepted_at', - "send_invite_link_text": 'send_invite_link_text', - "uninvited_count": 'uninvited_count', - "last_invite_sent_at": 'last_invite_sent_at', - "last_invite_accepted_at": 'last_invite_accepted_at' + "last_sent_at": "last_sent_at", + "last_accepted_at": "last_accepted_at", + "send_invite_link_text": "send_invite_link_text", + "uninvited_count": "uninvited_count", + "last_invite_sent_at": "last_invite_sent_at", + "last_invite_accepted_at": "last_invite_accepted_at", } _optionals = [ - 'last_sent_at', - 'last_accepted_at', - 'send_invite_link_text', - 'uninvited_count', - 'last_invite_sent_at', - 'last_invite_accepted_at', + "last_sent_at", + "last_accepted_at", + "send_invite_link_text", + "uninvited_count", + "last_invite_sent_at", + "last_invite_accepted_at", ] - def __init__(self, - last_sent_at=APIHelper.SKIP, - last_accepted_at=APIHelper.SKIP, - send_invite_link_text=APIHelper.SKIP, - uninvited_count=APIHelper.SKIP, - last_invite_sent_at=APIHelper.SKIP, - last_invite_accepted_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ResentInvitation class""" - + def __init__( + self, + last_sent_at=APIHelper.SKIP, + last_accepted_at=APIHelper.SKIP, + send_invite_link_text=APIHelper.SKIP, + uninvited_count=APIHelper.SKIP, + last_invite_sent_at=APIHelper.SKIP, + last_invite_accepted_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ResentInvitation instance.""" # Initialize members of the class if last_sent_at is not APIHelper.SKIP: - self.last_sent_at = last_sent_at + self.last_sent_at = last_sent_at if last_accepted_at is not APIHelper.SKIP: - self.last_accepted_at = last_accepted_at + self.last_accepted_at = last_accepted_at if send_invite_link_text is not APIHelper.SKIP: - self.send_invite_link_text = send_invite_link_text + self.send_invite_link_text = send_invite_link_text if uninvited_count is not APIHelper.SKIP: - self.uninvited_count = uninvited_count + self.uninvited_count = uninvited_count if last_invite_sent_at is not APIHelper.SKIP: - self.last_invite_sent_at = APIHelper.apply_datetime_converter(last_invite_sent_at, APIHelper.RFC3339DateTime) if last_invite_sent_at else None + self.last_invite_sent_at =\ + APIHelper.apply_datetime_converter( + last_invite_sent_at, APIHelper.RFC3339DateTime)\ + if last_invite_sent_at else None if last_invite_accepted_at is not APIHelper.SKIP: - self.last_invite_accepted_at = APIHelper.apply_datetime_converter(last_invite_accepted_at, APIHelper.RFC3339DateTime) if last_invite_accepted_at else None + self.last_invite_accepted_at =\ + APIHelper.apply_datetime_converter( + last_invite_accepted_at, APIHelper.RFC3339DateTime)\ + if last_invite_accepted_at else None # Add additional model properties to the instance if additional_properties is None: @@ -77,7 +80,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -88,19 +91,37 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - last_sent_at = dictionary.get("last_sent_at") if dictionary.get("last_sent_at") else APIHelper.SKIP - last_accepted_at = dictionary.get("last_accepted_at") if dictionary.get("last_accepted_at") else APIHelper.SKIP - send_invite_link_text = dictionary.get("send_invite_link_text") if dictionary.get("send_invite_link_text") else APIHelper.SKIP - uninvited_count = dictionary.get("uninvited_count") if dictionary.get("uninvited_count") else APIHelper.SKIP - last_invite_sent_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("last_invite_sent_at")).datetime if dictionary.get("last_invite_sent_at") else APIHelper.SKIP - last_invite_accepted_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("last_invite_accepted_at")).datetime if dictionary.get("last_invite_accepted_at") else APIHelper.SKIP + last_sent_at =\ + dictionary.get("last_sent_at")\ + if dictionary.get("last_sent_at")\ + else APIHelper.SKIP + last_accepted_at =\ + dictionary.get("last_accepted_at")\ + if dictionary.get("last_accepted_at")\ + else APIHelper.SKIP + send_invite_link_text =\ + dictionary.get("send_invite_link_text")\ + if dictionary.get("send_invite_link_text")\ + else APIHelper.SKIP + uninvited_count =\ + dictionary.get("uninvited_count")\ + if dictionary.get("uninvited_count")\ + else APIHelper.SKIP + last_invite_sent_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("last_invite_sent_at")).datetime\ + if dictionary.get("last_invite_sent_at") else APIHelper.SKIP + last_invite_accepted_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("last_invite_accepted_at")).datetime\ + if dictionary.get("last_invite_accepted_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(last_sent_at, last_accepted_at, @@ -111,21 +132,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'last_sent_at={(self.last_sent_at if hasattr(self, "last_sent_at") else None)!r}, ' - f'last_accepted_at={(self.last_accepted_at if hasattr(self, "last_accepted_at") else None)!r}, ' - f'send_invite_link_text={(self.send_invite_link_text if hasattr(self, "send_invite_link_text") else None)!r}, ' - f'uninvited_count={(self.uninvited_count if hasattr(self, "uninvited_count") else None)!r}, ' - f'last_invite_sent_at={(self.last_invite_sent_at if hasattr(self, "last_invite_sent_at") else None)!r}, ' - f'last_invite_accepted_at={(self.last_invite_accepted_at if hasattr(self, "last_invite_accepted_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _last_sent_at=( + self.last_sent_at + if hasattr(self, "last_sent_at") + else None + ) + _last_accepted_at=( + self.last_accepted_at + if hasattr(self, "last_accepted_at") + else None + ) + _send_invite_link_text=( + self.send_invite_link_text + if hasattr(self, "send_invite_link_text") + else None + ) + _uninvited_count=( + self.uninvited_count + if hasattr(self, "uninvited_count") + else None + ) + _last_invite_sent_at=( + self.last_invite_sent_at + if hasattr(self, "last_invite_sent_at") + else None + ) + _last_invite_accepted_at=( + self.last_invite_accepted_at + if hasattr(self, "last_invite_accepted_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"last_sent_at={_last_sent_at!r}, " + f"last_accepted_at={_last_accepted_at!r}, " + f"send_invite_link_text={_send_invite_link_text!r}, " + f"uninvited_count={_uninvited_count!r}, " + f"last_invite_sent_at={_last_invite_sent_at!r}, " + f"last_invite_accepted_at={_last_invite_accepted_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'last_sent_at={(self.last_sent_at if hasattr(self, "last_sent_at") else None)!s}, ' - f'last_accepted_at={(self.last_accepted_at if hasattr(self, "last_accepted_at") else None)!s}, ' - f'send_invite_link_text={(self.send_invite_link_text if hasattr(self, "send_invite_link_text") else None)!s}, ' - f'uninvited_count={(self.uninvited_count if hasattr(self, "uninvited_count") else None)!s}, ' - f'last_invite_sent_at={(self.last_invite_sent_at if hasattr(self, "last_invite_sent_at") else None)!s}, ' - f'last_invite_accepted_at={(self.last_invite_accepted_at if hasattr(self, "last_invite_accepted_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _last_sent_at=( + self.last_sent_at + if hasattr(self, "last_sent_at") + else None + ) + _last_accepted_at=( + self.last_accepted_at + if hasattr(self, "last_accepted_at") + else None + ) + _send_invite_link_text=( + self.send_invite_link_text + if hasattr(self, "send_invite_link_text") + else None + ) + _uninvited_count=( + self.uninvited_count + if hasattr(self, "uninvited_count") + else None + ) + _last_invite_sent_at=( + self.last_invite_sent_at + if hasattr(self, "last_invite_sent_at") + else None + ) + _last_invite_accepted_at=( + self.last_invite_accepted_at + if hasattr(self, "last_invite_accepted_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"last_sent_at={_last_sent_at!s}, " + f"last_accepted_at={_last_accepted_at!s}, " + f"send_invite_link_text={_send_invite_link_text!s}, " + f"uninvited_count={_uninvited_count!s}, " + f"last_invite_sent_at={_last_invite_sent_at!s}, " + f"last_invite_accepted_at={_last_invite_accepted_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/resource_type.py b/advancedbilling/models/resource_type.py index f0a7e159..624fdd00 100644 --- a/advancedbilling/models/resource_type.py +++ b/advancedbilling/models/resource_type.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ResourceType(object): - """Implementation of the 'Resource Type' enum. Attributes: SUBSCRIPTIONS: The enum member of type str. CUSTOMERS: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - SUBSCRIPTIONS = 'subscriptions' - CUSTOMERS = 'customers' + SUBSCRIPTIONS = "subscriptions" + + CUSTOMERS = "customers" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/restriction_type.py b/advancedbilling/models/restriction_type.py index 78aec690..e5cd0907 100644 --- a/advancedbilling/models/restriction_type.py +++ b/advancedbilling/models/restriction_type.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class RestrictionType(object): - """Implementation of the 'Restriction Type' enum. Attributes: COMPONENT: The enum member of type str. PRODUCT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - COMPONENT = 'Component' - PRODUCT = 'Product' + COMPONENT = "Component" + + PRODUCT = "Product" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/resume_options.py b/advancedbilling/models/resume_options.py index cb93fb9d..206d1275 100644 --- a/advancedbilling/models/resume_options.py +++ b/advancedbilling/models/resume_options.py @@ -1,53 +1,51 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ResumeOptions(object): - """Implementation of the 'Resume Options' model. Attributes: require_resume (bool): Chargify will only attempt to resume the - subscription's billing period. If not resumable, the subscription - will be left in its current state. - forgive_balance (bool): Indicates whether or not Chargify should clear - the subscription's existing balance before attempting to resume - the subscription. If subscription cannot be resumed, the balance - will remain as it was before the attempt to resume was made. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscription's billing period. If not resumable, the subscription will be + left in its current state. + forgive_balance (bool): Indicates whether or not Chargify should clear the + subscription's existing balance before attempting to resume the + subscription. If subscription cannot be resumed, the balance will remain + as it was before the attempt to resume was made. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "require_resume": 'require_resume', - "forgive_balance": 'forgive_balance' + "require_resume": "require_resume", + "forgive_balance": "forgive_balance", } _optionals = [ - 'require_resume', - 'forgive_balance', + "require_resume", + "forgive_balance", ] - def __init__(self, - require_resume=APIHelper.SKIP, - forgive_balance=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ResumeOptions class""" - + def __init__( + self, + require_resume=APIHelper.SKIP, + forgive_balance=APIHelper.SKIP, + additional_properties=None): + """Initialize a ResumeOptions instance.""" # Initialize members of the class if require_resume is not APIHelper.SKIP: - self.require_resume = require_resume + self.require_resume = require_resume if forgive_balance is not APIHelper.SKIP: - self.forgive_balance = forgive_balance + self.forgive_balance = forgive_balance # Add additional model properties to the instance if additional_properties is None: @@ -57,7 +55,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -68,15 +66,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - require_resume = dictionary.get("require_resume") if "require_resume" in dictionary.keys() else APIHelper.SKIP - forgive_balance = dictionary.get("forgive_balance") if "forgive_balance" in dictionary.keys() else APIHelper.SKIP + require_resume =\ + dictionary.get("require_resume")\ + if "require_resume" in dictionary.keys()\ + else APIHelper.SKIP + forgive_balance =\ + dictionary.get("forgive_balance")\ + if "forgive_balance" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(require_resume, forgive_balance, @@ -84,7 +90,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -95,7 +101,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -105,13 +110,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'require_resume={(self.require_resume if hasattr(self, "require_resume") else None)!r}, ' - f'forgive_balance={(self.forgive_balance if hasattr(self, "forgive_balance") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _require_resume=( + self.require_resume + if hasattr(self, "require_resume") + else None + ) + _forgive_balance=( + self.forgive_balance + if hasattr(self, "forgive_balance") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"require_resume={_require_resume!r}, " + f"forgive_balance={_forgive_balance!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'require_resume={(self.require_resume if hasattr(self, "require_resume") else None)!s}, ' - f'forgive_balance={(self.forgive_balance if hasattr(self, "forgive_balance") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _require_resume=( + self.require_resume + if hasattr(self, "require_resume") + else None + ) + _forgive_balance=( + self.forgive_balance + if hasattr(self, "forgive_balance") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"require_resume={_require_resume!s}, " + f"forgive_balance={_forgive_balance!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/resumption_charge.py b/advancedbilling/models/resumption_charge.py index 2d38e496..10a8fb4d 100644 --- a/advancedbilling/models/resumption_charge.py +++ b/advancedbilling/models/resumption_charge.py @@ -1,38 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ResumptionCharge(object): - """Implementation of the 'Resumption Charge' enum. - (For calendar billing subscriptions only) The way that the resumed - subscription's charge should be handled + (For calendar billing subscriptions only) The way that the resumed subscription's + charge should be handled Attributes: PRORATED: The enum member of type str. IMMEDIATE: The enum member of type str. DELAYED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['prorated', 'immediate', 'delayed'] - PRORATED = 'prorated' - IMMEDIATE = 'immediate' + _all_values = ["prorated", "immediate", "delayed"] + PRORATED = "prorated" - DELAYED = 'delayed' + IMMEDIATE = "immediate" + + DELAYED = "delayed" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -42,9 +40,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/revoked_invitation.py b/advancedbilling/models/revoked_invitation.py index 0d3cdb12..568ada3c 100644 --- a/advancedbilling/models/revoked_invitation.py +++ b/advancedbilling/models/revoked_invitation.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class RevokedInvitation(object): - """Implementation of the 'Revoked Invitation' model. Attributes: last_sent_at (str): The model property of type str. last_accepted_at (str): The model property of type str. uninvited_count (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "last_sent_at": 'last_sent_at', - "last_accepted_at": 'last_accepted_at', - "uninvited_count": 'uninvited_count' + "last_sent_at": "last_sent_at", + "last_accepted_at": "last_accepted_at", + "uninvited_count": "uninvited_count", } _optionals = [ - 'last_sent_at', - 'last_accepted_at', - 'uninvited_count', + "last_sent_at", + "last_accepted_at", + "uninvited_count", ] - def __init__(self, - last_sent_at=APIHelper.SKIP, - last_accepted_at=APIHelper.SKIP, - uninvited_count=APIHelper.SKIP, - additional_properties=None): - """Constructor for the RevokedInvitation class""" - + def __init__( + self, + last_sent_at=APIHelper.SKIP, + last_accepted_at=APIHelper.SKIP, + uninvited_count=APIHelper.SKIP, + additional_properties=None): + """Initialize a RevokedInvitation instance.""" # Initialize members of the class if last_sent_at is not APIHelper.SKIP: - self.last_sent_at = last_sent_at + self.last_sent_at = last_sent_at if last_accepted_at is not APIHelper.SKIP: - self.last_accepted_at = last_accepted_at + self.last_accepted_at = last_accepted_at if uninvited_count is not APIHelper.SKIP: - self.uninvited_count = uninvited_count + self.uninvited_count = uninvited_count # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - last_sent_at = dictionary.get("last_sent_at") if dictionary.get("last_sent_at") else APIHelper.SKIP - last_accepted_at = dictionary.get("last_accepted_at") if dictionary.get("last_accepted_at") else APIHelper.SKIP - uninvited_count = dictionary.get("uninvited_count") if dictionary.get("uninvited_count") else APIHelper.SKIP + last_sent_at =\ + dictionary.get("last_sent_at")\ + if dictionary.get("last_sent_at")\ + else APIHelper.SKIP + last_accepted_at =\ + dictionary.get("last_accepted_at")\ + if dictionary.get("last_accepted_at")\ + else APIHelper.SKIP + uninvited_count =\ + dictionary.get("uninvited_count")\ + if dictionary.get("uninvited_count")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(last_sent_at, last_accepted_at, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'last_sent_at={(self.last_sent_at if hasattr(self, "last_sent_at") else None)!r}, ' - f'last_accepted_at={(self.last_accepted_at if hasattr(self, "last_accepted_at") else None)!r}, ' - f'uninvited_count={(self.uninvited_count if hasattr(self, "uninvited_count") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _last_sent_at=( + self.last_sent_at + if hasattr(self, "last_sent_at") + else None + ) + _last_accepted_at=( + self.last_accepted_at + if hasattr(self, "last_accepted_at") + else None + ) + _uninvited_count=( + self.uninvited_count + if hasattr(self, "uninvited_count") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"last_sent_at={_last_sent_at!r}, " + f"last_accepted_at={_last_accepted_at!r}, " + f"uninvited_count={_uninvited_count!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'last_sent_at={(self.last_sent_at if hasattr(self, "last_sent_at") else None)!s}, ' - f'last_accepted_at={(self.last_accepted_at if hasattr(self, "last_accepted_at") else None)!s}, ' - f'uninvited_count={(self.uninvited_count if hasattr(self, "uninvited_count") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _last_sent_at=( + self.last_sent_at + if hasattr(self, "last_sent_at") + else None + ) + _last_accepted_at=( + self.last_accepted_at + if hasattr(self, "last_accepted_at") + else None + ) + _uninvited_count=( + self.uninvited_count + if hasattr(self, "uninvited_count") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"last_sent_at={_last_sent_at!s}, " + f"last_accepted_at={_last_accepted_at!s}, " + f"uninvited_count={_uninvited_count!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/sale_rep.py b/advancedbilling/models/sale_rep.py index b751a675..17508cb6 100644 --- a/advancedbilling/models/sale_rep.py +++ b/advancedbilling/models/sale_rep.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.sale_rep_subscription import SaleRepSubscription +from advancedbilling.models.sale_rep_subscription import ( + SaleRepSubscription, +) class SaleRep(object): - """Implementation of the 'Sale Rep' model. Attributes: @@ -21,48 +21,48 @@ class SaleRep(object): test_mode (bool): The model property of type bool. subscriptions (List[SaleRepSubscription]): The model property of type List[SaleRepSubscription]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "full_name": 'full_name', - "subscriptions_count": 'subscriptions_count', - "test_mode": 'test_mode', - "subscriptions": 'subscriptions' + "id": "id", + "full_name": "full_name", + "subscriptions_count": "subscriptions_count", + "test_mode": "test_mode", + "subscriptions": "subscriptions", } _optionals = [ - 'id', - 'full_name', - 'subscriptions_count', - 'test_mode', - 'subscriptions', + "id", + "full_name", + "subscriptions_count", + "test_mode", + "subscriptions", ] - def __init__(self, - id=APIHelper.SKIP, - full_name=APIHelper.SKIP, - subscriptions_count=APIHelper.SKIP, - test_mode=APIHelper.SKIP, - subscriptions=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SaleRep class""" - + def __init__( + self, + id=APIHelper.SKIP, + full_name=APIHelper.SKIP, + subscriptions_count=APIHelper.SKIP, + test_mode=APIHelper.SKIP, + subscriptions=APIHelper.SKIP, + additional_properties=None): + """Initialize a SaleRep instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if full_name is not APIHelper.SKIP: - self.full_name = full_name + self.full_name = full_name if subscriptions_count is not APIHelper.SKIP: - self.subscriptions_count = subscriptions_count + self.subscriptions_count = subscriptions_count if test_mode is not APIHelper.SKIP: - self.test_mode = test_mode + self.test_mode = test_mode if subscriptions is not APIHelper.SKIP: - self.subscriptions = subscriptions + self.subscriptions = subscriptions # Add additional model properties to the instance if additional_properties is None: @@ -72,7 +72,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -83,22 +83,39 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - full_name = dictionary.get("full_name") if dictionary.get("full_name") else APIHelper.SKIP - subscriptions_count = dictionary.get("subscriptions_count") if dictionary.get("subscriptions_count") else APIHelper.SKIP - test_mode = dictionary.get("test_mode") if "test_mode" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + full_name =\ + dictionary.get("full_name")\ + if dictionary.get("full_name")\ + else APIHelper.SKIP + subscriptions_count =\ + dictionary.get("subscriptions_count")\ + if dictionary.get("subscriptions_count")\ + else APIHelper.SKIP + test_mode =\ + dictionary.get("test_mode")\ + if "test_mode" in dictionary.keys()\ + else APIHelper.SKIP subscriptions = None - if dictionary.get('subscriptions') is not None: - subscriptions = [SaleRepSubscription.from_dictionary(x) for x in dictionary.get('subscriptions')] + if dictionary.get("subscriptions") is not None: + subscriptions = [ + SaleRepSubscription.from_dictionary(x) + for x in dictionary.get("subscriptions") + ] else: subscriptions = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, full_name, @@ -108,19 +125,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'full_name={(self.full_name if hasattr(self, "full_name") else None)!r}, ' - f'subscriptions_count={(self.subscriptions_count if hasattr(self, "subscriptions_count") else None)!r}, ' - f'test_mode={(self.test_mode if hasattr(self, "test_mode") else None)!r}, ' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _full_name=( + self.full_name + if hasattr(self, "full_name") + else None + ) + _subscriptions_count=( + self.subscriptions_count + if hasattr(self, "subscriptions_count") + else None + ) + _test_mode=( + self.test_mode + if hasattr(self, "test_mode") + else None + ) + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"full_name={_full_name!r}, " + f"subscriptions_count={_subscriptions_count!r}, " + f"test_mode={_test_mode!r}, " + f"subscriptions={_subscriptions!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'full_name={(self.full_name if hasattr(self, "full_name") else None)!s}, ' - f'subscriptions_count={(self.subscriptions_count if hasattr(self, "subscriptions_count") else None)!s}, ' - f'test_mode={(self.test_mode if hasattr(self, "test_mode") else None)!s}, ' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _full_name=( + self.full_name + if hasattr(self, "full_name") + else None + ) + _subscriptions_count=( + self.subscriptions_count + if hasattr(self, "subscriptions_count") + else None + ) + _test_mode=( + self.test_mode + if hasattr(self, "test_mode") + else None + ) + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"full_name={_full_name!s}, " + f"subscriptions_count={_subscriptions_count!s}, " + f"test_mode={_test_mode!s}, " + f"subscriptions={_subscriptions!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/sale_rep_item_mrr.py b/advancedbilling/models/sale_rep_item_mrr.py index d37057e2..030de024 100644 --- a/advancedbilling/models/sale_rep_item_mrr.py +++ b/advancedbilling/models/sale_rep_item_mrr.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SaleRepItemMrr(object): - """Implementation of the 'Sale Rep Item Mrr' model. Attributes: mrr (str): The model property of type str. usage (str): The model property of type str. recurring (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "mrr": 'mrr', - "usage": 'usage', - "recurring": 'recurring' + "mrr": "mrr", + "usage": "usage", + "recurring": "recurring", } _optionals = [ - 'mrr', - 'usage', - 'recurring', + "mrr", + "usage", + "recurring", ] - def __init__(self, - mrr=APIHelper.SKIP, - usage=APIHelper.SKIP, - recurring=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SaleRepItemMrr class""" - + def __init__( + self, + mrr=APIHelper.SKIP, + usage=APIHelper.SKIP, + recurring=APIHelper.SKIP, + additional_properties=None): + """Initialize a SaleRepItemMrr instance.""" # Initialize members of the class if mrr is not APIHelper.SKIP: - self.mrr = mrr + self.mrr = mrr if usage is not APIHelper.SKIP: - self.usage = usage + self.usage = usage if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - mrr = dictionary.get("mrr") if dictionary.get("mrr") else APIHelper.SKIP - usage = dictionary.get("usage") if dictionary.get("usage") else APIHelper.SKIP - recurring = dictionary.get("recurring") if dictionary.get("recurring") else APIHelper.SKIP + mrr =\ + dictionary.get("mrr")\ + if dictionary.get("mrr")\ + else APIHelper.SKIP + usage =\ + dictionary.get("usage")\ + if dictionary.get("usage")\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if dictionary.get("recurring")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(mrr, usage, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'mrr={(self.mrr if hasattr(self, "mrr") else None)!r}, ' - f'usage={(self.usage if hasattr(self, "usage") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _mrr=( + self.mrr + if hasattr(self, "mrr") + else None + ) + _usage=( + self.usage + if hasattr(self, "usage") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mrr={_mrr!r}, " + f"usage={_usage!r}, " + f"recurring={_recurring!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'mrr={(self.mrr if hasattr(self, "mrr") else None)!s}, ' - f'usage={(self.usage if hasattr(self, "usage") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _mrr=( + self.mrr + if hasattr(self, "mrr") + else None + ) + _usage=( + self.usage + if hasattr(self, "usage") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"mrr={_mrr!s}, " + f"usage={_usage!s}, " + f"recurring={_recurring!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/sale_rep_settings.py b/advancedbilling/models/sale_rep_settings.py index 3af0a845..c62231dd 100644 --- a/advancedbilling/models/sale_rep_settings.py +++ b/advancedbilling/models/sale_rep_settings.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SaleRepSettings(object): - """Implementation of the 'Sale Rep Settings' model. Attributes: @@ -21,58 +19,58 @@ class SaleRepSettings(object): subscription_mrr (str): The model property of type str. sales_rep_id (int): The model property of type int. sales_rep_name (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "customer_name": 'customer_name', - "subscription_id": 'subscription_id', - "site_link": 'site_link', - "site_name": 'site_name', - "subscription_mrr": 'subscription_mrr', - "sales_rep_id": 'sales_rep_id', - "sales_rep_name": 'sales_rep_name' + "customer_name": "customer_name", + "subscription_id": "subscription_id", + "site_link": "site_link", + "site_name": "site_name", + "subscription_mrr": "subscription_mrr", + "sales_rep_id": "sales_rep_id", + "sales_rep_name": "sales_rep_name", } _optionals = [ - 'customer_name', - 'subscription_id', - 'site_link', - 'site_name', - 'subscription_mrr', - 'sales_rep_id', - 'sales_rep_name', + "customer_name", + "subscription_id", + "site_link", + "site_name", + "subscription_mrr", + "sales_rep_id", + "sales_rep_name", ] - def __init__(self, - customer_name=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - site_link=APIHelper.SKIP, - site_name=APIHelper.SKIP, - subscription_mrr=APIHelper.SKIP, - sales_rep_id=APIHelper.SKIP, - sales_rep_name=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SaleRepSettings class""" - + def __init__( + self, + customer_name=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + site_link=APIHelper.SKIP, + site_name=APIHelper.SKIP, + subscription_mrr=APIHelper.SKIP, + sales_rep_id=APIHelper.SKIP, + sales_rep_name=APIHelper.SKIP, + additional_properties=None): + """Initialize a SaleRepSettings instance.""" # Initialize members of the class if customer_name is not APIHelper.SKIP: - self.customer_name = customer_name + self.customer_name = customer_name if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if site_link is not APIHelper.SKIP: - self.site_link = site_link + self.site_link = site_link if site_name is not APIHelper.SKIP: - self.site_name = site_name + self.site_name = site_name if subscription_mrr is not APIHelper.SKIP: - self.subscription_mrr = subscription_mrr + self.subscription_mrr = subscription_mrr if sales_rep_id is not APIHelper.SKIP: - self.sales_rep_id = sales_rep_id + self.sales_rep_id = sales_rep_id if sales_rep_name is not APIHelper.SKIP: - self.sales_rep_name = sales_rep_name + self.sales_rep_name = sales_rep_name # Add additional model properties to the instance if additional_properties is None: @@ -82,7 +80,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -93,20 +91,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - customer_name = dictionary.get("customer_name") if dictionary.get("customer_name") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - site_link = dictionary.get("site_link") if dictionary.get("site_link") else APIHelper.SKIP - site_name = dictionary.get("site_name") if dictionary.get("site_name") else APIHelper.SKIP - subscription_mrr = dictionary.get("subscription_mrr") if dictionary.get("subscription_mrr") else APIHelper.SKIP - sales_rep_id = dictionary.get("sales_rep_id") if dictionary.get("sales_rep_id") else APIHelper.SKIP - sales_rep_name = dictionary.get("sales_rep_name") if dictionary.get("sales_rep_name") else APIHelper.SKIP + customer_name =\ + dictionary.get("customer_name")\ + if dictionary.get("customer_name")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + site_link =\ + dictionary.get("site_link")\ + if dictionary.get("site_link")\ + else APIHelper.SKIP + site_name =\ + dictionary.get("site_name")\ + if dictionary.get("site_name")\ + else APIHelper.SKIP + subscription_mrr =\ + dictionary.get("subscription_mrr")\ + if dictionary.get("subscription_mrr")\ + else APIHelper.SKIP + sales_rep_id =\ + dictionary.get("sales_rep_id")\ + if dictionary.get("sales_rep_id")\ + else APIHelper.SKIP + sales_rep_name =\ + dictionary.get("sales_rep_name")\ + if dictionary.get("sales_rep_name")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(customer_name, subscription_id, @@ -118,23 +139,103 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'customer_name={(self.customer_name if hasattr(self, "customer_name") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'site_link={(self.site_link if hasattr(self, "site_link") else None)!r}, ' - f'site_name={(self.site_name if hasattr(self, "site_name") else None)!r}, ' - f'subscription_mrr={(self.subscription_mrr if hasattr(self, "subscription_mrr") else None)!r}, ' - f'sales_rep_id={(self.sales_rep_id if hasattr(self, "sales_rep_id") else None)!r}, ' - f'sales_rep_name={(self.sales_rep_name if hasattr(self, "sales_rep_name") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _customer_name=( + self.customer_name + if hasattr(self, "customer_name") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _site_link=( + self.site_link + if hasattr(self, "site_link") + else None + ) + _site_name=( + self.site_name + if hasattr(self, "site_name") + else None + ) + _subscription_mrr=( + self.subscription_mrr + if hasattr(self, "subscription_mrr") + else None + ) + _sales_rep_id=( + self.sales_rep_id + if hasattr(self, "sales_rep_id") + else None + ) + _sales_rep_name=( + self.sales_rep_name + if hasattr(self, "sales_rep_name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer_name={_customer_name!r}, " + f"subscription_id={_subscription_id!r}, " + f"site_link={_site_link!r}, " + f"site_name={_site_name!r}, " + f"subscription_mrr={_subscription_mrr!r}, " + f"sales_rep_id={_sales_rep_id!r}, " + f"sales_rep_name={_sales_rep_name!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'customer_name={(self.customer_name if hasattr(self, "customer_name") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'site_link={(self.site_link if hasattr(self, "site_link") else None)!s}, ' - f'site_name={(self.site_name if hasattr(self, "site_name") else None)!s}, ' - f'subscription_mrr={(self.subscription_mrr if hasattr(self, "subscription_mrr") else None)!s}, ' - f'sales_rep_id={(self.sales_rep_id if hasattr(self, "sales_rep_id") else None)!s}, ' - f'sales_rep_name={(self.sales_rep_name if hasattr(self, "sales_rep_name") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _customer_name=( + self.customer_name + if hasattr(self, "customer_name") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _site_link=( + self.site_link + if hasattr(self, "site_link") + else None + ) + _site_name=( + self.site_name + if hasattr(self, "site_name") + else None + ) + _subscription_mrr=( + self.subscription_mrr + if hasattr(self, "subscription_mrr") + else None + ) + _sales_rep_id=( + self.sales_rep_id + if hasattr(self, "sales_rep_id") + else None + ) + _sales_rep_name=( + self.sales_rep_name + if hasattr(self, "sales_rep_name") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer_name={_customer_name!s}, " + f"subscription_id={_subscription_id!s}, " + f"site_link={_site_link!s}, " + f"site_name={_site_name!s}, " + f"subscription_mrr={_subscription_mrr!s}, " + f"sales_rep_id={_sales_rep_id!s}, " + f"sales_rep_name={_sales_rep_name!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/sale_rep_subscription.py b/advancedbilling/models/sale_rep_subscription.py index e4ef2522..9bb53437 100644 --- a/advancedbilling/models/sale_rep_subscription.py +++ b/advancedbilling/models/sale_rep_subscription.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SaleRepSubscription(object): - """Implementation of the 'Sale Rep Subscription' model. Attributes: @@ -24,77 +22,77 @@ class SaleRepSubscription(object): recurring (str): The model property of type str. last_payment (str): The model property of type str. churn_date (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "site_name": 'site_name', - "subscription_url": 'subscription_url', - "customer_name": 'customer_name', - "created_at": 'created_at', - "mrr": 'mrr', - "usage": 'usage', - "recurring": 'recurring', - "last_payment": 'last_payment', - "churn_date": 'churn_date' + "id": "id", + "site_name": "site_name", + "subscription_url": "subscription_url", + "customer_name": "customer_name", + "created_at": "created_at", + "mrr": "mrr", + "usage": "usage", + "recurring": "recurring", + "last_payment": "last_payment", + "churn_date": "churn_date", } _optionals = [ - 'id', - 'site_name', - 'subscription_url', - 'customer_name', - 'created_at', - 'mrr', - 'usage', - 'recurring', - 'last_payment', - 'churn_date', + "id", + "site_name", + "subscription_url", + "customer_name", + "created_at", + "mrr", + "usage", + "recurring", + "last_payment", + "churn_date", ] _nullables = [ - 'churn_date', + "churn_date", ] - def __init__(self, - id=APIHelper.SKIP, - site_name=APIHelper.SKIP, - subscription_url=APIHelper.SKIP, - customer_name=APIHelper.SKIP, - created_at=APIHelper.SKIP, - mrr=APIHelper.SKIP, - usage=APIHelper.SKIP, - recurring=APIHelper.SKIP, - last_payment=APIHelper.SKIP, - churn_date=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SaleRepSubscription class""" - + def __init__( + self, + id=APIHelper.SKIP, + site_name=APIHelper.SKIP, + subscription_url=APIHelper.SKIP, + customer_name=APIHelper.SKIP, + created_at=APIHelper.SKIP, + mrr=APIHelper.SKIP, + usage=APIHelper.SKIP, + recurring=APIHelper.SKIP, + last_payment=APIHelper.SKIP, + churn_date=APIHelper.SKIP, + additional_properties=None): + """Initialize a SaleRepSubscription instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if site_name is not APIHelper.SKIP: - self.site_name = site_name + self.site_name = site_name if subscription_url is not APIHelper.SKIP: - self.subscription_url = subscription_url + self.subscription_url = subscription_url if customer_name is not APIHelper.SKIP: - self.customer_name = customer_name + self.customer_name = customer_name if created_at is not APIHelper.SKIP: - self.created_at = created_at + self.created_at = created_at if mrr is not APIHelper.SKIP: - self.mrr = mrr + self.mrr = mrr if usage is not APIHelper.SKIP: - self.usage = usage + self.usage = usage if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring if last_payment is not APIHelper.SKIP: - self.last_payment = last_payment + self.last_payment = last_payment if churn_date is not APIHelper.SKIP: - self.churn_date = churn_date + self.churn_date = churn_date # Add additional model properties to the instance if additional_properties is None: @@ -104,7 +102,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -115,23 +113,55 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - site_name = dictionary.get("site_name") if dictionary.get("site_name") else APIHelper.SKIP - subscription_url = dictionary.get("subscription_url") if dictionary.get("subscription_url") else APIHelper.SKIP - customer_name = dictionary.get("customer_name") if dictionary.get("customer_name") else APIHelper.SKIP - created_at = dictionary.get("created_at") if dictionary.get("created_at") else APIHelper.SKIP - mrr = dictionary.get("mrr") if dictionary.get("mrr") else APIHelper.SKIP - usage = dictionary.get("usage") if dictionary.get("usage") else APIHelper.SKIP - recurring = dictionary.get("recurring") if dictionary.get("recurring") else APIHelper.SKIP - last_payment = dictionary.get("last_payment") if dictionary.get("last_payment") else APIHelper.SKIP - churn_date = dictionary.get("churn_date") if "churn_date" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + site_name =\ + dictionary.get("site_name")\ + if dictionary.get("site_name")\ + else APIHelper.SKIP + subscription_url =\ + dictionary.get("subscription_url")\ + if dictionary.get("subscription_url")\ + else APIHelper.SKIP + customer_name =\ + dictionary.get("customer_name")\ + if dictionary.get("customer_name")\ + else APIHelper.SKIP + created_at =\ + dictionary.get("created_at")\ + if dictionary.get("created_at")\ + else APIHelper.SKIP + mrr =\ + dictionary.get("mrr")\ + if dictionary.get("mrr")\ + else APIHelper.SKIP + usage =\ + dictionary.get("usage")\ + if dictionary.get("usage")\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if dictionary.get("recurring")\ + else APIHelper.SKIP + last_payment =\ + dictionary.get("last_payment")\ + if dictionary.get("last_payment")\ + else APIHelper.SKIP + churn_date =\ + dictionary.get("churn_date")\ + if "churn_date" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, site_name, @@ -146,29 +176,139 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'site_name={(self.site_name if hasattr(self, "site_name") else None)!r}, ' - f'subscription_url={(self.subscription_url if hasattr(self, "subscription_url") else None)!r}, ' - f'customer_name={(self.customer_name if hasattr(self, "customer_name") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'mrr={(self.mrr if hasattr(self, "mrr") else None)!r}, ' - f'usage={(self.usage if hasattr(self, "usage") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'last_payment={(self.last_payment if hasattr(self, "last_payment") else None)!r}, ' - f'churn_date={(self.churn_date if hasattr(self, "churn_date") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_name=( + self.site_name + if hasattr(self, "site_name") + else None + ) + _subscription_url=( + self.subscription_url + if hasattr(self, "subscription_url") + else None + ) + _customer_name=( + self.customer_name + if hasattr(self, "customer_name") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _mrr=( + self.mrr + if hasattr(self, "mrr") + else None + ) + _usage=( + self.usage + if hasattr(self, "usage") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _last_payment=( + self.last_payment + if hasattr(self, "last_payment") + else None + ) + _churn_date=( + self.churn_date + if hasattr(self, "churn_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"site_name={_site_name!r}, " + f"subscription_url={_subscription_url!r}, " + f"customer_name={_customer_name!r}, " + f"created_at={_created_at!r}, " + f"mrr={_mrr!r}, " + f"usage={_usage!r}, " + f"recurring={_recurring!r}, " + f"last_payment={_last_payment!r}, " + f"churn_date={_churn_date!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'site_name={(self.site_name if hasattr(self, "site_name") else None)!s}, ' - f'subscription_url={(self.subscription_url if hasattr(self, "subscription_url") else None)!s}, ' - f'customer_name={(self.customer_name if hasattr(self, "customer_name") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'mrr={(self.mrr if hasattr(self, "mrr") else None)!s}, ' - f'usage={(self.usage if hasattr(self, "usage") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'last_payment={(self.last_payment if hasattr(self, "last_payment") else None)!s}, ' - f'churn_date={(self.churn_date if hasattr(self, "churn_date") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_name=( + self.site_name + if hasattr(self, "site_name") + else None + ) + _subscription_url=( + self.subscription_url + if hasattr(self, "subscription_url") + else None + ) + _customer_name=( + self.customer_name + if hasattr(self, "customer_name") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _mrr=( + self.mrr + if hasattr(self, "mrr") + else None + ) + _usage=( + self.usage + if hasattr(self, "usage") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _last_payment=( + self.last_payment + if hasattr(self, "last_payment") + else None + ) + _churn_date=( + self.churn_date + if hasattr(self, "churn_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"site_name={_site_name!s}, " + f"subscription_url={_subscription_url!s}, " + f"customer_name={_customer_name!s}, " + f"created_at={_created_at!s}, " + f"mrr={_mrr!s}, " + f"usage={_usage!s}, " + f"recurring={_recurring!s}, " + f"last_payment={_last_payment!s}, " + f"churn_date={_churn_date!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_component_custom_price.py b/advancedbilling/models/scheduled_renewal_component_custom_price.py new file mode 100644 index 00000000..fa3b758b --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_component_custom_price.py @@ -0,0 +1,177 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import ( + PricingScheme, +) + + +class ScheduledRenewalComponentCustomPrice(object): + """Implementation of the 'Scheduled Renewal Component Custom Price' model. + + Custom pricing for a component within a scheduled renewal. + + Attributes: + tax_included (bool): Whether or not the price point includes tax + pricing_scheme (PricingScheme): Omit for On/Off components + prices (List[Price]): On/off components only need one price bracket starting + at 1. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "pricing_scheme": "pricing_scheme", + "prices": "prices", + "tax_included": "tax_included", + } + + _optionals = [ + "tax_included", + ] + + def __init__( + self, + pricing_scheme=None, + prices=None, + tax_included=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalComponentCustomPrice instance.""" + # Initialize members of the class + if tax_included is not APIHelper.SKIP: + self.tax_included = tax_included + self.pricing_scheme = pricing_scheme + self.prices = prices + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None + prices = None + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(pricing_scheme, + prices, + tax_included, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + if isinstance(dictionary, cls): + return APIHelper.is_valid_type( + value=dictionary.pricing_scheme, + type_callable=lambda value: + PricingScheme.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.prices, + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) + + if not isinstance(dictionary, dict): + return False + + return APIHelper.is_valid_type( + value=dictionary.get("pricing_scheme"), + type_callable=lambda value: + PricingScheme.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("prices"), + type_callable=lambda value: + Price.validate(value), + is_model_dict=True, + is_inner_model_dict=True) + + def __repr__(self): + """Return a unambiguous string representation.""" + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"tax_included={_tax_included!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _pricing_scheme=self.pricing_scheme + _prices=self.prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"tax_included={_tax_included!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configuration.py b/advancedbilling/models/scheduled_renewal_configuration.py new file mode 100644 index 00000000..2451dde6 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configuration.py @@ -0,0 +1,333 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.contract import ( + Contract, +) +from advancedbilling.models.scheduled_renewal_configuration_item import ( + ScheduledRenewalConfigurationItem, +) + + +class ScheduledRenewalConfiguration(object): + """Implementation of the 'Scheduled Renewal Configuration' model. + + Attributes: + id (int): ID of the renewal. + site_id (int): ID of the site to which the renewal belongs. + subscription_id (int): The id of the subscription. + starts_at (datetime): The model property of type datetime. + ends_at (datetime): The model property of type datetime. + lock_in_at (datetime): The model property of type datetime. + created_at (datetime): The model property of type datetime. + status (str): The model property of type str. + scheduled_renewal_configuration_items + (List[ScheduledRenewalConfigurationItem]): The model property of type + List[ScheduledRenewalConfigurationItem]. + contract (Contract): Contract linked to the scheduled renewal configuration. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": "id", + "site_id": "site_id", + "subscription_id": "subscription_id", + "starts_at": "starts_at", + "ends_at": "ends_at", + "lock_in_at": "lock_in_at", + "created_at": "created_at", + "status": "status", + "scheduled_renewal_configuration_items": + "scheduled_renewal_configuration_items", + "contract": "contract", + } + + _optionals = [ + "id", + "site_id", + "subscription_id", + "starts_at", + "ends_at", + "lock_in_at", + "created_at", + "status", + "scheduled_renewal_configuration_items", + "contract", + ] + + def __init__( + self, + id=APIHelper.SKIP, + site_id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + starts_at=APIHelper.SKIP, + ends_at=APIHelper.SKIP, + lock_in_at=APIHelper.SKIP, + created_at=APIHelper.SKIP, + status=APIHelper.SKIP, + scheduled_renewal_configuration_items=APIHelper.SKIP, + contract=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalConfiguration instance.""" + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if site_id is not APIHelper.SKIP: + self.site_id = site_id + if subscription_id is not APIHelper.SKIP: + self.subscription_id = subscription_id + if starts_at is not APIHelper.SKIP: + self.starts_at =\ + APIHelper.apply_datetime_converter( + starts_at, APIHelper.RFC3339DateTime)\ + if starts_at else None + if ends_at is not APIHelper.SKIP: + self.ends_at =\ + APIHelper.apply_datetime_converter( + ends_at, APIHelper.RFC3339DateTime)\ + if ends_at else None + if lock_in_at is not APIHelper.SKIP: + self.lock_in_at =\ + APIHelper.apply_datetime_converter( + lock_in_at, APIHelper.RFC3339DateTime)\ + if lock_in_at else None + if created_at is not APIHelper.SKIP: + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None + if status is not APIHelper.SKIP: + self.status = status + if scheduled_renewal_configuration_items is not APIHelper.SKIP: + self.scheduled_renewal_configuration_items =\ + scheduled_renewal_configuration_items + if contract is not APIHelper.SKIP: + self.contract = contract + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + starts_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("starts_at")).datetime\ + if dictionary.get("starts_at") else APIHelper.SKIP + ends_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("ends_at")).datetime\ + if dictionary.get("ends_at") else APIHelper.SKIP + lock_in_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("lock_in_at")).datetime\ + if dictionary.get("lock_in_at") else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + status =\ + dictionary.get("status")\ + if dictionary.get("status")\ + else APIHelper.SKIP + scheduled_renewal_configuration_items = None + if dictionary.get("scheduled_renewal_configuration_items") is not None: + scheduled_renewal_configuration_items = [ + ScheduledRenewalConfigurationItem.from_dictionary(x) + for x in dictionary.get("scheduled_renewal_configuration_items") + ] + else: + scheduled_renewal_configuration_items = APIHelper.SKIP + contract =\ + Contract.from_dictionary( + dictionary.get("contract"))\ + if "contract" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(id, + site_id, + subscription_id, + starts_at, + ends_at, + lock_in_at, + created_at, + status, + scheduled_renewal_configuration_items, + contract, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _starts_at=( + self.starts_at + if hasattr(self, "starts_at") + else None + ) + _ends_at=( + self.ends_at + if hasattr(self, "ends_at") + else None + ) + _lock_in_at=( + self.lock_in_at + if hasattr(self, "lock_in_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _scheduled_renewal_configuration_items=( + self.scheduled_renewal_configuration_items + if hasattr(self, "scheduled_renewal_configuration_items") + else None + ) + _contract=( + self.contract + if hasattr(self, "contract") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"site_id={_site_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"starts_at={_starts_at!r}, " + f"ends_at={_ends_at!r}, " + f"lock_in_at={_lock_in_at!r}, " + f"created_at={_created_at!r}, " + f"status={_status!r}, " + f"scheduled_renewal_configuration_items={_scheduled_renewal_configuration_items!r}, " + f"contract={_contract!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _starts_at=( + self.starts_at + if hasattr(self, "starts_at") + else None + ) + _ends_at=( + self.ends_at + if hasattr(self, "ends_at") + else None + ) + _lock_in_at=( + self.lock_in_at + if hasattr(self, "lock_in_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _status=( + self.status + if hasattr(self, "status") + else None + ) + _scheduled_renewal_configuration_items=( + self.scheduled_renewal_configuration_items + if hasattr(self, "scheduled_renewal_configuration_items") + else None + ) + _contract=( + self.contract + if hasattr(self, "contract") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"site_id={_site_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"starts_at={_starts_at!s}, " + f"ends_at={_ends_at!s}, " + f"lock_in_at={_lock_in_at!s}, " + f"created_at={_created_at!s}, " + f"status={_status!s}, " + f"scheduled_renewal_configuration_items={_scheduled_renewal_configuration_items!s}, " + f"contract={_contract!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configuration_item.py b/advancedbilling/models/scheduled_renewal_configuration_item.py new file mode 100644 index 00000000..37262635 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configuration_item.py @@ -0,0 +1,337 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class ScheduledRenewalConfigurationItem(object): + """Implementation of the 'Scheduled Renewal Configuration Item' model. + + Attributes: + id (int): The model property of type int. + subscription_id (int): The model property of type int. + subscription_renewal_configuration_id (int): The model property of type int. + item_id (int): The model property of type int. + item_type (str): The model property of type str. + item_subclass (str): The model property of type str. + price_point_id (int): The model property of type int. + price_point_type (str): The model property of type str. + quantity (int): The model property of type int. + decimal_quantity (str): The model property of type str. + created_at (datetime): The model property of type datetime. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "id": "id", + "subscription_id": "subscription_id", + "subscription_renewal_configuration_id": + "subscription_renewal_configuration_id", + "item_id": "item_id", + "item_type": "item_type", + "item_subclass": "item_subclass", + "price_point_id": "price_point_id", + "price_point_type": "price_point_type", + "quantity": "quantity", + "decimal_quantity": "decimal_quantity", + "created_at": "created_at", + } + + _optionals = [ + "id", + "subscription_id", + "subscription_renewal_configuration_id", + "item_id", + "item_type", + "item_subclass", + "price_point_id", + "price_point_type", + "quantity", + "decimal_quantity", + "created_at", + ] + + def __init__( + self, + id=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + subscription_renewal_configuration_id=APIHelper.SKIP, + item_id=APIHelper.SKIP, + item_type=APIHelper.SKIP, + item_subclass=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + price_point_type=APIHelper.SKIP, + quantity=APIHelper.SKIP, + decimal_quantity=APIHelper.SKIP, + created_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalConfigurationItem instance.""" + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if subscription_id is not APIHelper.SKIP: + self.subscription_id = subscription_id + if subscription_renewal_configuration_id is not APIHelper.SKIP: + self.subscription_renewal_configuration_id =\ + subscription_renewal_configuration_id + if item_id is not APIHelper.SKIP: + self.item_id = item_id + if item_type is not APIHelper.SKIP: + self.item_type = item_type + if item_subclass is not APIHelper.SKIP: + self.item_subclass = item_subclass + if price_point_id is not APIHelper.SKIP: + self.price_point_id = price_point_id + if price_point_type is not APIHelper.SKIP: + self.price_point_type = price_point_type + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if decimal_quantity is not APIHelper.SKIP: + self.decimal_quantity = decimal_quantity + if created_at is not APIHelper.SKIP: + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + subscription_renewal_configuration_id =\ + dictionary.get("subscription_renewal_configuration_id")\ + if dictionary.get("subscription_renewal_configuration_id")\ + else APIHelper.SKIP + item_id =\ + dictionary.get("item_id")\ + if dictionary.get("item_id")\ + else APIHelper.SKIP + item_type =\ + dictionary.get("item_type")\ + if dictionary.get("item_type")\ + else APIHelper.SKIP + item_subclass =\ + dictionary.get("item_subclass")\ + if dictionary.get("item_subclass")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + price_point_type =\ + dictionary.get("price_point_type")\ + if dictionary.get("price_point_type")\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + decimal_quantity =\ + dictionary.get("decimal_quantity")\ + if dictionary.get("decimal_quantity")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(id, + subscription_id, + subscription_renewal_configuration_id, + item_id, + item_type, + item_subclass, + price_point_id, + price_point_type, + quantity, + decimal_quantity, + created_at, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _subscription_renewal_configuration_id=( + self.subscription_renewal_configuration_id + if hasattr(self, "subscription_renewal_configuration_id") + else None + ) + _item_id=( + self.item_id + if hasattr(self, "item_id") + else None + ) + _item_type=( + self.item_type + if hasattr(self, "item_type") + else None + ) + _item_subclass=( + self.item_subclass + if hasattr(self, "item_subclass") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _price_point_type=( + self.price_point_type + if hasattr(self, "price_point_type") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _decimal_quantity=( + self.decimal_quantity + if hasattr(self, "decimal_quantity") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"subscription_id={_subscription_id!r}, " + f"subscription_renewal_configuration_id={_subscription_renewal_configuration_id!r}, " + f"item_id={_item_id!r}, " + f"item_type={_item_type!r}, " + f"item_subclass={_item_subclass!r}, " + f"price_point_id={_price_point_id!r}, " + f"price_point_type={_price_point_type!r}, " + f"quantity={_quantity!r}, " + f"decimal_quantity={_decimal_quantity!r}, " + f"created_at={_created_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _subscription_renewal_configuration_id=( + self.subscription_renewal_configuration_id + if hasattr(self, "subscription_renewal_configuration_id") + else None + ) + _item_id=( + self.item_id + if hasattr(self, "item_id") + else None + ) + _item_type=( + self.item_type + if hasattr(self, "item_type") + else None + ) + _item_subclass=( + self.item_subclass + if hasattr(self, "item_subclass") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _price_point_type=( + self.price_point_type + if hasattr(self, "price_point_type") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _decimal_quantity=( + self.decimal_quantity + if hasattr(self, "decimal_quantity") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"subscription_id={_subscription_id!s}, " + f"subscription_renewal_configuration_id={_subscription_renewal_configuration_id!s}, " + f"item_id={_item_id!s}, " + f"item_type={_item_type!s}, " + f"item_subclass={_item_subclass!s}, " + f"price_point_id={_price_point_id!s}, " + f"price_point_type={_price_point_type!s}, " + f"quantity={_quantity!s}, " + f"decimal_quantity={_decimal_quantity!s}, " + f"created_at={_created_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configuration_item_request.py b/advancedbilling/models/scheduled_renewal_configuration_item_request.py new file mode 100644 index 00000000..a830e400 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configuration_item_request.py @@ -0,0 +1,126 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class ScheduledRenewalConfigurationItemRequest(object): + """Implementation of the 'Scheduled Renewal Configuration Item Request' model. + + Attributes: + renewal_configuration_item (ScheduledRenewalItemRequestBodyComponent | + ScheduledRenewalItemRequestBodyProduct): The model property of type + ScheduledRenewalItemRequestBodyComponent | + ScheduledRenewalItemRequestBodyProduct. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "renewal_configuration_item": "renewal_configuration_item", + } + + def __init__( + self, + renewal_configuration_item=None, + additional_properties=None): + """Initialize a ScheduledRenewalConfigurationItemRequest instance.""" + # Initialize members of the class + self.renewal_configuration_item = renewal_configuration_item + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + renewal_configuration_item = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem"), + dictionary.get("renewal_configuration_item"), + False)\ + if dictionary.get("renewal_configuration_item") is not None\ + else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(renewal_configuration_item, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if isinstance(dictionary, cls): + return (UnionTypeLookUp.get("ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem") + .validate(dictionary.renewal_configuration_item).is_valid) + + if not isinstance(dictionary, dict): + return False + + return (UnionTypeLookUp.get("ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem") + .validate(dictionary.get("renewal_configuration_item")).is_valid) + + def __repr__(self): + """Return a unambiguous string representation.""" + _renewal_configuration_item=self.renewal_configuration_item + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_configuration_item={_renewal_configuration_item!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _renewal_configuration_item=self.renewal_configuration_item + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_configuration_item={_renewal_configuration_item!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configuration_item_response.py b/advancedbilling/models/scheduled_renewal_configuration_item_response.py new file mode 100644 index 00000000..8942986f --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configuration_item_response.py @@ -0,0 +1,109 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.scheduled_renewal_configuration_item import ( + ScheduledRenewalConfigurationItem, +) + + +class ScheduledRenewalConfigurationItemResponse(object): + """Implementation of the 'Scheduled Renewal Configuration Item Response' model. + + Attributes: + scheduled_renewal_configuration_item (ScheduledRenewalConfigurationItem): The + model property of type ScheduledRenewalConfigurationItem. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "scheduled_renewal_configuration_item": "scheduled_renewal_configuration_item", + } + + _optionals = [ + "scheduled_renewal_configuration_item", + ] + + def __init__( + self, + scheduled_renewal_configuration_item=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalConfigurationItemResponse instance.""" + # Initialize members of the class + if scheduled_renewal_configuration_item is not APIHelper.SKIP: + self.scheduled_renewal_configuration_item =\ + scheduled_renewal_configuration_item + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + scheduled_renewal_configuration_item =\ + ScheduledRenewalConfigurationItem.from_dictionary( + dictionary.get("scheduled_renewal_configuration_item"))\ + if "scheduled_renewal_configuration_item" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(scheduled_renewal_configuration_item, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _scheduled_renewal_configuration_item=( + self.scheduled_renewal_configuration_item + if hasattr(self, "scheduled_renewal_configuration_item") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"scheduled_renewal_configuration_item={_scheduled_renewal_configuration_item!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _scheduled_renewal_configuration_item=( + self.scheduled_renewal_configuration_item + if hasattr(self, "scheduled_renewal_configuration_item") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"scheduled_renewal_configuration_item={_scheduled_renewal_configuration_item!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configuration_request.py b/advancedbilling/models/scheduled_renewal_configuration_request.py new file mode 100644 index 00000000..36eb9e56 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configuration_request.py @@ -0,0 +1,93 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.models.scheduled_renewal_configuration_request_body import ( + ScheduledRenewalConfigurationRequestBody, +) + + +class ScheduledRenewalConfigurationRequest(object): + """Implementation of the 'Scheduled Renewal Configuration Request' model. + + Attributes: + renewal_configuration (ScheduledRenewalConfigurationRequestBody): The model + property of type ScheduledRenewalConfigurationRequestBody. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "renewal_configuration": "renewal_configuration", + } + + def __init__( + self, + renewal_configuration=None, + additional_properties=None): + """Initialize a ScheduledRenewalConfigurationRequest instance.""" + # Initialize members of the class + self.renewal_configuration = renewal_configuration + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + renewal_configuration =\ + ScheduledRenewalConfigurationRequestBody.from_dictionary( + dictionary.get("renewal_configuration"))\ + if dictionary.get("renewal_configuration") else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(renewal_configuration, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _renewal_configuration=self.renewal_configuration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_configuration={_renewal_configuration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _renewal_configuration=self.renewal_configuration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_configuration={_renewal_configuration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configuration_request_body.py b/advancedbilling/models/scheduled_renewal_configuration_request_body.py new file mode 100644 index 00000000..6a2180eb --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configuration_request_body.py @@ -0,0 +1,203 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class ScheduledRenewalConfigurationRequestBody(object): + """Implementation of the 'Scheduled Renewal Configuration Request Body' model. + + Attributes: + starts_at (datetime): (Optional) Start of the renewal term. + ends_at (datetime): (Optional) End of the renewal term. + lock_in_at (datetime): (Optional) Lock-in date for the renewal. + contract_id (int): (Optional) Existing contract to associate with the + scheduled renewal. Contracts must be enabled for your site. + create_new_contract (bool): (Optional) Set to true to create a new contract + when contracts are enabled. Contracts must be enabled for your site. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "starts_at": "starts_at", + "ends_at": "ends_at", + "lock_in_at": "lock_in_at", + "contract_id": "contract_id", + "create_new_contract": "create_new_contract", + } + + _optionals = [ + "starts_at", + "ends_at", + "lock_in_at", + "contract_id", + "create_new_contract", + ] + + def __init__( + self, + starts_at=APIHelper.SKIP, + ends_at=APIHelper.SKIP, + lock_in_at=APIHelper.SKIP, + contract_id=APIHelper.SKIP, + create_new_contract=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalConfigurationRequestBody instance.""" + # Initialize members of the class + if starts_at is not APIHelper.SKIP: + self.starts_at =\ + APIHelper.apply_datetime_converter( + starts_at, APIHelper.RFC3339DateTime)\ + if starts_at else None + if ends_at is not APIHelper.SKIP: + self.ends_at =\ + APIHelper.apply_datetime_converter( + ends_at, APIHelper.RFC3339DateTime)\ + if ends_at else None + if lock_in_at is not APIHelper.SKIP: + self.lock_in_at =\ + APIHelper.apply_datetime_converter( + lock_in_at, APIHelper.RFC3339DateTime)\ + if lock_in_at else None + if contract_id is not APIHelper.SKIP: + self.contract_id = contract_id + if create_new_contract is not APIHelper.SKIP: + self.create_new_contract = create_new_contract + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + starts_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("starts_at")).datetime\ + if dictionary.get("starts_at") else APIHelper.SKIP + ends_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("ends_at")).datetime\ + if dictionary.get("ends_at") else APIHelper.SKIP + lock_in_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("lock_in_at")).datetime\ + if dictionary.get("lock_in_at") else APIHelper.SKIP + contract_id =\ + dictionary.get("contract_id")\ + if dictionary.get("contract_id")\ + else APIHelper.SKIP + create_new_contract =\ + dictionary.get("create_new_contract")\ + if "create_new_contract" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(starts_at, + ends_at, + lock_in_at, + contract_id, + create_new_contract, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _starts_at=( + self.starts_at + if hasattr(self, "starts_at") + else None + ) + _ends_at=( + self.ends_at + if hasattr(self, "ends_at") + else None + ) + _lock_in_at=( + self.lock_in_at + if hasattr(self, "lock_in_at") + else None + ) + _contract_id=( + self.contract_id + if hasattr(self, "contract_id") + else None + ) + _create_new_contract=( + self.create_new_contract + if hasattr(self, "create_new_contract") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starts_at={_starts_at!r}, " + f"ends_at={_ends_at!r}, " + f"lock_in_at={_lock_in_at!r}, " + f"contract_id={_contract_id!r}, " + f"create_new_contract={_create_new_contract!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _starts_at=( + self.starts_at + if hasattr(self, "starts_at") + else None + ) + _ends_at=( + self.ends_at + if hasattr(self, "ends_at") + else None + ) + _lock_in_at=( + self.lock_in_at + if hasattr(self, "lock_in_at") + else None + ) + _contract_id=( + self.contract_id + if hasattr(self, "contract_id") + else None + ) + _create_new_contract=( + self.create_new_contract + if hasattr(self, "create_new_contract") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"starts_at={_starts_at!s}, " + f"ends_at={_ends_at!s}, " + f"lock_in_at={_lock_in_at!s}, " + f"contract_id={_contract_id!s}, " + f"create_new_contract={_create_new_contract!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configuration_response.py b/advancedbilling/models/scheduled_renewal_configuration_response.py new file mode 100644 index 00000000..9310a092 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configuration_response.py @@ -0,0 +1,108 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.scheduled_renewal_configuration import ( + ScheduledRenewalConfiguration, +) + + +class ScheduledRenewalConfigurationResponse(object): + """Implementation of the 'Scheduled Renewal Configuration Response' model. + + Attributes: + scheduled_renewal_configuration (ScheduledRenewalConfiguration): The model + property of type ScheduledRenewalConfiguration. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "scheduled_renewal_configuration": "scheduled_renewal_configuration", + } + + _optionals = [ + "scheduled_renewal_configuration", + ] + + def __init__( + self, + scheduled_renewal_configuration=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalConfigurationResponse instance.""" + # Initialize members of the class + if scheduled_renewal_configuration is not APIHelper.SKIP: + self.scheduled_renewal_configuration = scheduled_renewal_configuration + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + scheduled_renewal_configuration =\ + ScheduledRenewalConfiguration.from_dictionary( + dictionary.get("scheduled_renewal_configuration"))\ + if "scheduled_renewal_configuration" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(scheduled_renewal_configuration, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _scheduled_renewal_configuration=( + self.scheduled_renewal_configuration + if hasattr(self, "scheduled_renewal_configuration") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"scheduled_renewal_configuration={_scheduled_renewal_configuration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _scheduled_renewal_configuration=( + self.scheduled_renewal_configuration + if hasattr(self, "scheduled_renewal_configuration") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"scheduled_renewal_configuration={_scheduled_renewal_configuration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_configurations_response.py b/advancedbilling/models/scheduled_renewal_configurations_response.py new file mode 100644 index 00000000..15bb841e --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_configurations_response.py @@ -0,0 +1,111 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.scheduled_renewal_configuration import ( + ScheduledRenewalConfiguration, +) + + +class ScheduledRenewalConfigurationsResponse(object): + """Implementation of the 'Scheduled Renewal Configurations Response' model. + + Attributes: + scheduled_renewal_configurations (List[ScheduledRenewalConfiguration]): The + model property of type List[ScheduledRenewalConfiguration]. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "scheduled_renewal_configurations": "scheduled_renewal_configurations", + } + + _optionals = [ + "scheduled_renewal_configurations", + ] + + def __init__( + self, + scheduled_renewal_configurations=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalConfigurationsResponse instance.""" + # Initialize members of the class + if scheduled_renewal_configurations is not APIHelper.SKIP: + self.scheduled_renewal_configurations = scheduled_renewal_configurations + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + scheduled_renewal_configurations = None + if dictionary.get("scheduled_renewal_configurations") is not None: + scheduled_renewal_configurations = [ + ScheduledRenewalConfiguration.from_dictionary(x) + for x in dictionary.get("scheduled_renewal_configurations") + ] + else: + scheduled_renewal_configurations = APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(scheduled_renewal_configurations, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _scheduled_renewal_configurations=( + self.scheduled_renewal_configurations + if hasattr(self, "scheduled_renewal_configurations") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"scheduled_renewal_configurations={_scheduled_renewal_configurations!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _scheduled_renewal_configurations=( + self.scheduled_renewal_configurations + if hasattr(self, "scheduled_renewal_configurations") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"scheduled_renewal_configurations={_scheduled_renewal_configurations!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_item_request_body_component.py b/advancedbilling/models/scheduled_renewal_item_request_body_component.py new file mode 100644 index 00000000..b09c2903 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_item_request_body_component.py @@ -0,0 +1,221 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.scheduled_renewal_component_custom_price import ( + ScheduledRenewalComponentCustomPrice, +) + + +class ScheduledRenewalItemRequestBodyComponent(object): + """Implementation of the 'Scheduled Renewal Item Request Body Component' model. + + Attributes: + item_type (str): Item type to add. Either Product or Component. + item_id (int): Product or component identifier. + price_point_id (int): Price point identifier. + quantity (int): Optional quantity for the item. + custom_price (ScheduledRenewalComponentCustomPrice): Custom pricing for a + component within a scheduled renewal. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "item_type": "item_type", + "item_id": "item_id", + "price_point_id": "price_point_id", + "quantity": "quantity", + "custom_price": "custom_price", + } + + _optionals = [ + "price_point_id", + "quantity", + "custom_price", + ] + + def __init__( + self, + item_id=None, + price_point_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalItemRequestBodyComponent instance.""" + # Initialize members of the class + self.item_type = "Component" + self.item_id = item_id + if price_point_id is not APIHelper.SKIP: + self.price_point_id = price_point_id + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if custom_price is not APIHelper.SKIP: + self.custom_price = custom_price + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + item_id =\ + dictionary.get("item_id")\ + if dictionary.get("item_id")\ + else None + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + custom_price =\ + ScheduledRenewalComponentCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(item_id, + price_point_id, + quantity, + custom_price, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + if isinstance(dictionary, cls): + return APIHelper.is_valid_type( + value=dictionary.item_type, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.item_id, + type_callable=lambda value: + isinstance( + value, + int, + )) + + if not isinstance(dictionary, dict): + return False + + return APIHelper.is_valid_type( + value=dictionary.get("item_type"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("item_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) + + def __repr__(self): + """Return a unambiguous string representation.""" + _item_type=self.item_type + _item_id=self.item_id + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"item_type={_item_type!r}, " + f"item_id={_item_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"quantity={_quantity!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _item_type=self.item_type + _item_id=self.item_id + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"item_type={_item_type!s}, " + f"item_id={_item_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"quantity={_quantity!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_item_request_body_product.py b/advancedbilling/models/scheduled_renewal_item_request_body_product.py new file mode 100644 index 00000000..5ae8e836 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_item_request_body_product.py @@ -0,0 +1,221 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.scheduled_renewal_product_price_point import ( + ScheduledRenewalProductPricePoint, +) + + +class ScheduledRenewalItemRequestBodyProduct(object): + """Implementation of the 'Scheduled Renewal Item Request Body Product' model. + + Attributes: + item_type (str): Item type to add. Either Product or Component. + item_id (int): Product or component identifier. + price_point_id (int): Price point identifier. + quantity (int): Optional quantity for the item. + custom_price (ScheduledRenewalProductPricePoint): Custom pricing for a + product within a scheduled renewal. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "item_type": "item_type", + "item_id": "item_id", + "price_point_id": "price_point_id", + "quantity": "quantity", + "custom_price": "custom_price", + } + + _optionals = [ + "price_point_id", + "quantity", + "custom_price", + ] + + def __init__( + self, + item_id=None, + price_point_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalItemRequestBodyProduct instance.""" + # Initialize members of the class + self.item_type = "Product" + self.item_id = item_id + if price_point_id is not APIHelper.SKIP: + self.price_point_id = price_point_id + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if custom_price is not APIHelper.SKIP: + self.custom_price = custom_price + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + item_id =\ + dictionary.get("item_id")\ + if dictionary.get("item_id")\ + else None + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + quantity =\ + dictionary.get("quantity")\ + if dictionary.get("quantity")\ + else APIHelper.SKIP + custom_price =\ + ScheduledRenewalProductPricePoint.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(item_id, + price_point_id, + quantity, + custom_price, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + if isinstance(dictionary, cls): + return APIHelper.is_valid_type( + value=dictionary.item_type, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.item_id, + type_callable=lambda value: + isinstance( + value, + int, + )) + + if not isinstance(dictionary, dict): + return False + + return APIHelper.is_valid_type( + value=dictionary.get("item_type"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("item_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) + + def __repr__(self): + """Return a unambiguous string representation.""" + _item_type=self.item_type + _item_id=self.item_id + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"item_type={_item_type!r}, " + f"item_id={_item_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"quantity={_quantity!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _item_type=self.item_type + _item_id=self.item_id + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"item_type={_item_type!s}, " + f"item_id={_item_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"quantity={_quantity!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_lock_in_request.py b/advancedbilling/models/scheduled_renewal_lock_in_request.py new file mode 100644 index 00000000..73148671 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_lock_in_request.py @@ -0,0 +1,89 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +import dateutil.parser + + +class ScheduledRenewalLockInRequest(object): + """Implementation of the 'Scheduled Renewal Lock In Request' model. + + Attributes: + lock_in_at (date): Date to lock in the renewal. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "lock_in_at": "lock_in_at", + } + + def __init__( + self, + lock_in_at=None, + additional_properties=None): + """Initialize a ScheduledRenewalLockInRequest instance.""" + # Initialize members of the class + self.lock_in_at = lock_in_at + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + lock_in_at = dateutil.parser.parse( + dictionary.get("lock_in_at")).date()\ + if dictionary.get("lock_in_at") else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(lock_in_at, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _lock_in_at=self.lock_in_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"lock_in_at={_lock_in_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _lock_in_at=self.lock_in_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"lock_in_at={_lock_in_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_product_price_point.py b/advancedbilling/models/scheduled_renewal_product_price_point.py new file mode 100644 index 00000000..4293e28c --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_product_price_point.py @@ -0,0 +1,321 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.interval_unit import ( + IntervalUnit, +) + + +class ScheduledRenewalProductPricePoint(object): + """Implementation of the 'Scheduled Renewal Product Price Point' model. + + Custom pricing for a product within a scheduled renewal. + + Attributes: + name (str): (Optional) + handle (str): (Optional) + price_in_cents (str | int): Required if using `custom_price` attribute. + interval (str | int): Required if using `custom_price` attribute. + interval_unit (IntervalUnit): Required if using `custom_price` attribute. + tax_included (bool): (Optional) + initial_charge_in_cents (int): The product price point initial charge, in + integer cents. + expiration_interval (int): The numerical expiration interval. i.e. an + expiration_interval of ‘30’ coupled with an expiration_interval_unit of + day would mean this product price point would expire after 30 days. + expiration_interval_unit (ExpirationIntervalUnit): A string representing the + expiration interval unit for this product price point, either month, day + or never + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "price_in_cents": "price_in_cents", + "interval": "interval", + "interval_unit": "interval_unit", + "name": "name", + "handle": "handle", + "tax_included": "tax_included", + "initial_charge_in_cents": "initial_charge_in_cents", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + } + + _optionals = [ + "name", + "handle", + "tax_included", + "initial_charge_in_cents", + "expiration_interval", + "expiration_interval_unit", + ] + + _nullables = [ + "interval_unit", + "expiration_interval_unit", + ] + + def __init__( + self, + price_in_cents=None, + interval=None, + interval_unit=None, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + tax_included=APIHelper.SKIP, + initial_charge_in_cents=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a ScheduledRenewalProductPricePoint instance.""" + # Initialize members of the class + if name is not APIHelper.SKIP: + self.name = name + if handle is not APIHelper.SKIP: + self.handle = handle + self.price_in_cents = price_in_cents + self.interval = interval + self.interval_unit = interval_unit + if tax_included is not APIHelper.SKIP: + self.tax_included = tax_included + if initial_charge_in_cents is not APIHelper.SKIP: + self.initial_charge_in_cents = initial_charge_in_cents + if expiration_interval is not APIHelper.SKIP: + self.expiration_interval = expiration_interval + if expiration_interval_unit is not APIHelper.SKIP: + self.expiration_interval_unit = expiration_interval_unit + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + price_in_cents = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("ScheduledRenewalProductPricePointPriceInCents"), + dictionary.get("price_in_cents"), + False)\ + if dictionary.get("price_in_cents") is not None\ + else None + interval = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("ScheduledRenewalProductPricePointInterval"), + dictionary.get("interval"), + False)\ + if dictionary.get("interval") is not None\ + else None + interval_unit =\ + dictionary.get("interval_unit")\ + if dictionary.get("interval_unit")\ + else None + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + initial_charge_in_cents =\ + dictionary.get("initial_charge_in_cents")\ + if dictionary.get("initial_charge_in_cents")\ + else APIHelper.SKIP + expiration_interval =\ + dictionary.get("expiration_interval")\ + if dictionary.get("expiration_interval")\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(price_in_cents, + interval, + interval_unit, + name, + handle, + tax_included, + initial_charge_in_cents, + expiration_interval, + expiration_interval_unit, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if isinstance(dictionary, cls): + return (UnionTypeLookUp.get("ScheduledRenewalProductPricePointPriceInCents") + .validate(dictionary.price_in_cents).is_valid) \ + and (UnionTypeLookUp.get("ScheduledRenewalProductPricePointInterval") + .validate(dictionary.interval).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.interval_unit, + type_callable=lambda value: + IntervalUnit.validate(value), + is_value_nullable=True) + + if not isinstance(dictionary, dict): + return False + + return (UnionTypeLookUp.get("ScheduledRenewalProductPricePointPriceInCents") + .validate(dictionary.get("price_in_cents")).is_valid) \ + and (UnionTypeLookUp.get("ScheduledRenewalProductPricePointInterval") + .validate(dictionary.get("interval")).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.get("interval_unit"), + type_callable=lambda value: + IntervalUnit.validate(value), + is_value_nullable=True) + + def __repr__(self): + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"tax_included={_tax_included!r}, " + f"initial_charge_in_cents={_initial_charge_in_cents!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"tax_included={_tax_included!s}, " + f"initial_charge_in_cents={_initial_charge_in_cents!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/scheduled_renewal_update_request.py b/advancedbilling/models/scheduled_renewal_update_request.py new file mode 100644 index 00000000..63de7482 --- /dev/null +++ b/advancedbilling/models/scheduled_renewal_update_request.py @@ -0,0 +1,126 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class ScheduledRenewalUpdateRequest(object): + """Implementation of the 'Scheduled Renewal Update Request' model. + + Attributes: + renewal_configuration_item (ScheduledRenewalItemRequestBodyComponent | + ScheduledRenewalItemRequestBodyProduct): The model property of type + ScheduledRenewalItemRequestBodyComponent | + ScheduledRenewalItemRequestBodyProduct. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "renewal_configuration_item": "renewal_configuration_item", + } + + def __init__( + self, + renewal_configuration_item=None, + additional_properties=None): + """Initialize a ScheduledRenewalUpdateRequest instance.""" + # Initialize members of the class + self.renewal_configuration_item = renewal_configuration_item + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + renewal_configuration_item = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("ScheduledRenewalUpdateRequestRenewalConfigurationItem"), + dictionary.get("renewal_configuration_item"), + False)\ + if dictionary.get("renewal_configuration_item") is not None\ + else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(renewal_configuration_item, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if isinstance(dictionary, cls): + return (UnionTypeLookUp.get("ScheduledRenewalUpdateRequestRenewalConfigurationItem") + .validate(dictionary.renewal_configuration_item).is_valid) + + if not isinstance(dictionary, dict): + return False + + return (UnionTypeLookUp.get("ScheduledRenewalUpdateRequestRenewalConfigurationItem") + .validate(dictionary.get("renewal_configuration_item")).is_valid) + + def __repr__(self): + """Return a unambiguous string representation.""" + _renewal_configuration_item=self.renewal_configuration_item + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_configuration_item={_renewal_configuration_item!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _renewal_configuration_item=self.renewal_configuration_item + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"renewal_configuration_item={_renewal_configuration_item!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/segment.py b/advancedbilling/models/segment.py index 01d2e753..267e1736 100644 --- a/advancedbilling/models/segment.py +++ b/advancedbilling/models/segment.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.segment_price import SegmentPrice +from advancedbilling.models.segment_price import ( + SegmentPrice, +) class Segment(object): - """Implementation of the 'Segment' model. Attributes: @@ -19,10 +19,10 @@ class Segment(object): component_id (int): The model property of type int. price_point_id (int): The model property of type int. event_based_billing_metric_id (int): The model property of type int. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. segment_property_1_value (str | float | int | bool | None): The model property of type str | float | int | bool | None. segment_property_2_value (str | float | int | bool | None): The model @@ -33,85 +33,90 @@ class Segment(object): property of type str | float | int | bool | None. created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. - prices (List[SegmentPrice]): The model property of type - List[SegmentPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + prices (List[SegmentPrice]): The model property of type List[SegmentPrice]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "component_id": 'component_id', - "price_point_id": 'price_point_id', - "event_based_billing_metric_id": 'event_based_billing_metric_id', - "pricing_scheme": 'pricing_scheme', - "segment_property_1_value": 'segment_property_1_value', - "segment_property_2_value": 'segment_property_2_value', - "segment_property_3_value": 'segment_property_3_value', - "segment_property_4_value": 'segment_property_4_value', - "created_at": 'created_at', - "updated_at": 'updated_at', - "prices": 'prices' + "id": "id", + "component_id": "component_id", + "price_point_id": "price_point_id", + "event_based_billing_metric_id": "event_based_billing_metric_id", + "pricing_scheme": "pricing_scheme", + "segment_property_1_value": "segment_property_1_value", + "segment_property_2_value": "segment_property_2_value", + "segment_property_3_value": "segment_property_3_value", + "segment_property_4_value": "segment_property_4_value", + "created_at": "created_at", + "updated_at": "updated_at", + "prices": "prices", } _optionals = [ - 'id', - 'component_id', - 'price_point_id', - 'event_based_billing_metric_id', - 'pricing_scheme', - 'segment_property_1_value', - 'segment_property_2_value', - 'segment_property_3_value', - 'segment_property_4_value', - 'created_at', - 'updated_at', - 'prices', + "id", + "component_id", + "price_point_id", + "event_based_billing_metric_id", + "pricing_scheme", + "segment_property_1_value", + "segment_property_2_value", + "segment_property_3_value", + "segment_property_4_value", + "created_at", + "updated_at", + "prices", ] - def __init__(self, - id=APIHelper.SKIP, - component_id=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - event_based_billing_metric_id=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - segment_property_1_value=APIHelper.SKIP, - segment_property_2_value=APIHelper.SKIP, - segment_property_3_value=APIHelper.SKIP, - segment_property_4_value=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Segment class""" - + def __init__( + self, + id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + event_based_billing_metric_id=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + segment_property_1_value=APIHelper.SKIP, + segment_property_2_value=APIHelper.SKIP, + segment_property_3_value=APIHelper.SKIP, + segment_property_4_value=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a Segment instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if event_based_billing_metric_id is not APIHelper.SKIP: - self.event_based_billing_metric_id = event_based_billing_metric_id + self.event_based_billing_metric_id = event_based_billing_metric_id if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if segment_property_1_value is not APIHelper.SKIP: - self.segment_property_1_value = segment_property_1_value + self.segment_property_1_value = segment_property_1_value if segment_property_2_value is not APIHelper.SKIP: - self.segment_property_2_value = segment_property_2_value + self.segment_property_2_value = segment_property_2_value if segment_property_3_value is not APIHelper.SKIP: - self.segment_property_3_value = segment_property_3_value + self.segment_property_3_value = segment_property_3_value if segment_property_4_value is not APIHelper.SKIP: - self.segment_property_4_value = segment_property_4_value + self.segment_property_4_value = segment_property_4_value if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices # Add additional model properties to the instance if additional_properties is None: @@ -121,7 +126,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -132,30 +137,77 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - event_based_billing_metric_id = dictionary.get("event_based_billing_metric_id") if dictionary.get("event_based_billing_metric_id") else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else APIHelper.SKIP - segment_property_1_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SegmentSegmentProperty1Value'), dictionary.get('segment_property_1_value'), False) if dictionary.get('segment_property_1_value') is not None else APIHelper.SKIP - segment_property_2_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SegmentSegmentProperty2Value'), dictionary.get('segment_property_2_value'), False) if dictionary.get('segment_property_2_value') is not None else APIHelper.SKIP - segment_property_3_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SegmentSegmentProperty3Value'), dictionary.get('segment_property_3_value'), False) if dictionary.get('segment_property_3_value') is not None else APIHelper.SKIP - segment_property_4_value = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SegmentSegmentProperty4Value'), dictionary.get('segment_property_4_value'), False) if dictionary.get('segment_property_4_value') is not None else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + event_based_billing_metric_id =\ + dictionary.get("event_based_billing_metric_id")\ + if dictionary.get("event_based_billing_metric_id")\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP + segment_property_1_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SegmentSegmentProperty1Value"), + dictionary.get("segment_property_1_value"), + False)\ + if dictionary.get("segment_property_1_value") is not None\ + else APIHelper.SKIP + segment_property_2_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SegmentSegmentProperty2Value"), + dictionary.get("segment_property_2_value"), + False)\ + if dictionary.get("segment_property_2_value") is not None\ + else APIHelper.SKIP + segment_property_3_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SegmentSegmentProperty3Value"), + dictionary.get("segment_property_3_value"), + False)\ + if dictionary.get("segment_property_3_value") is not None\ + else APIHelper.SKIP + segment_property_4_value = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SegmentSegmentProperty4Value"), + dictionary.get("segment_property_4_value"), + False)\ + if dictionary.get("segment_property_4_value") is not None\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [SegmentPrice.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + SegmentPrice.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, component_id, @@ -172,33 +224,163 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'event_based_billing_metric_id={(self.event_based_billing_metric_id if hasattr(self, "event_based_billing_metric_id") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'segment_property_1_value={(self.segment_property_1_value if hasattr(self, "segment_property_1_value") else None)!r}, ' - f'segment_property_2_value={(self.segment_property_2_value if hasattr(self, "segment_property_2_value") else None)!r}, ' - f'segment_property_3_value={(self.segment_property_3_value if hasattr(self, "segment_property_3_value") else None)!r}, ' - f'segment_property_4_value={(self.segment_property_4_value if hasattr(self, "segment_property_4_value") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _event_based_billing_metric_id=( + self.event_based_billing_metric_id + if hasattr(self, "event_based_billing_metric_id") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _segment_property_1_value=( + self.segment_property_1_value + if hasattr(self, "segment_property_1_value") + else None + ) + _segment_property_2_value=( + self.segment_property_2_value + if hasattr(self, "segment_property_2_value") + else None + ) + _segment_property_3_value=( + self.segment_property_3_value + if hasattr(self, "segment_property_3_value") + else None + ) + _segment_property_4_value=( + self.segment_property_4_value + if hasattr(self, "segment_property_4_value") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"event_based_billing_metric_id={_event_based_billing_metric_id!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"segment_property_1_value={_segment_property_1_value!r}, " + f"segment_property_2_value={_segment_property_2_value!r}, " + f"segment_property_3_value={_segment_property_3_value!r}, " + f"segment_property_4_value={_segment_property_4_value!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'event_based_billing_metric_id={(self.event_based_billing_metric_id if hasattr(self, "event_based_billing_metric_id") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'segment_property_1_value={(self.segment_property_1_value if hasattr(self, "segment_property_1_value") else None)!s}, ' - f'segment_property_2_value={(self.segment_property_2_value if hasattr(self, "segment_property_2_value") else None)!s}, ' - f'segment_property_3_value={(self.segment_property_3_value if hasattr(self, "segment_property_3_value") else None)!s}, ' - f'segment_property_4_value={(self.segment_property_4_value if hasattr(self, "segment_property_4_value") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _event_based_billing_metric_id=( + self.event_based_billing_metric_id + if hasattr(self, "event_based_billing_metric_id") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _segment_property_1_value=( + self.segment_property_1_value + if hasattr(self, "segment_property_1_value") + else None + ) + _segment_property_2_value=( + self.segment_property_2_value + if hasattr(self, "segment_property_2_value") + else None + ) + _segment_property_3_value=( + self.segment_property_3_value + if hasattr(self, "segment_property_3_value") + else None + ) + _segment_property_4_value=( + self.segment_property_4_value + if hasattr(self, "segment_property_4_value") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"event_based_billing_metric_id={_event_based_billing_metric_id!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"segment_property_1_value={_segment_property_1_value!s}, " + f"segment_property_2_value={_segment_property_2_value!s}, " + f"segment_property_3_value={_segment_property_3_value!s}, " + f"segment_property_4_value={_segment_property_4_value!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/segment_price.py b/advancedbilling/models/segment_price.py index dcc6920a..b880d5a3 100644 --- a/advancedbilling/models/segment_price.py +++ b/advancedbilling/models/segment_price.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SegmentPrice(object): - """Implementation of the 'Segment Price' model. Attributes: @@ -22,67 +20,67 @@ class SegmentPrice(object): price_point_id (int): The model property of type int. formatted_unit_price (str): The model property of type str. segment_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "component_id": 'component_id', - "starting_quantity": 'starting_quantity', - "ending_quantity": 'ending_quantity', - "unit_price": 'unit_price', - "price_point_id": 'price_point_id', - "formatted_unit_price": 'formatted_unit_price', - "segment_id": 'segment_id' + "id": "id", + "component_id": "component_id", + "starting_quantity": "starting_quantity", + "ending_quantity": "ending_quantity", + "unit_price": "unit_price", + "price_point_id": "price_point_id", + "formatted_unit_price": "formatted_unit_price", + "segment_id": "segment_id", } _optionals = [ - 'id', - 'component_id', - 'starting_quantity', - 'ending_quantity', - 'unit_price', - 'price_point_id', - 'formatted_unit_price', - 'segment_id', + "id", + "component_id", + "starting_quantity", + "ending_quantity", + "unit_price", + "price_point_id", + "formatted_unit_price", + "segment_id", ] _nullables = [ - 'ending_quantity', + "ending_quantity", ] - def __init__(self, - id=APIHelper.SKIP, - component_id=APIHelper.SKIP, - starting_quantity=APIHelper.SKIP, - ending_quantity=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - formatted_unit_price=APIHelper.SKIP, - segment_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SegmentPrice class""" - + def __init__( + self, + id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + starting_quantity=APIHelper.SKIP, + ending_quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + formatted_unit_price=APIHelper.SKIP, + segment_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a SegmentPrice instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if starting_quantity is not APIHelper.SKIP: - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity if ending_quantity is not APIHelper.SKIP: - self.ending_quantity = ending_quantity + self.ending_quantity = ending_quantity if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if formatted_unit_price is not APIHelper.SKIP: - self.formatted_unit_price = formatted_unit_price + self.formatted_unit_price = formatted_unit_price if segment_id is not APIHelper.SKIP: - self.segment_id = segment_id + self.segment_id = segment_id # Add additional model properties to the instance if additional_properties is None: @@ -92,7 +90,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -103,21 +101,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - starting_quantity = dictionary.get("starting_quantity") if dictionary.get("starting_quantity") else APIHelper.SKIP - ending_quantity = dictionary.get("ending_quantity") if "ending_quantity" in dictionary.keys() else APIHelper.SKIP - unit_price = dictionary.get("unit_price") if dictionary.get("unit_price") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - formatted_unit_price = dictionary.get("formatted_unit_price") if dictionary.get("formatted_unit_price") else APIHelper.SKIP - segment_id = dictionary.get("segment_id") if dictionary.get("segment_id") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + starting_quantity =\ + dictionary.get("starting_quantity")\ + if dictionary.get("starting_quantity")\ + else APIHelper.SKIP + ending_quantity =\ + dictionary.get("ending_quantity")\ + if "ending_quantity" in dictionary.keys()\ + else APIHelper.SKIP + unit_price =\ + dictionary.get("unit_price")\ + if dictionary.get("unit_price")\ + else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + formatted_unit_price =\ + dictionary.get("formatted_unit_price")\ + if dictionary.get("formatted_unit_price")\ + else APIHelper.SKIP + segment_id =\ + dictionary.get("segment_id")\ + if dictionary.get("segment_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, component_id, @@ -131,7 +155,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -142,7 +166,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -152,25 +175,115 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!r}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'formatted_unit_price={(self.formatted_unit_price if hasattr(self, "formatted_unit_price") else None)!r}, ' - f'segment_id={(self.segment_id if hasattr(self, "segment_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _formatted_unit_price=( + self.formatted_unit_price + if hasattr(self, "formatted_unit_price") + else None + ) + _segment_id=( + self.segment_id + if hasattr(self, "segment_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"component_id={_component_id!r}, " + f"starting_quantity={_starting_quantity!r}, " + f"ending_quantity={_ending_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"price_point_id={_price_point_id!r}, " + f"formatted_unit_price={_formatted_unit_price!r}, " + f"segment_id={_segment_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!s}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'formatted_unit_price={(self.formatted_unit_price if hasattr(self, "formatted_unit_price") else None)!s}, ' - f'segment_id={(self.segment_id if hasattr(self, "segment_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _formatted_unit_price=( + self.formatted_unit_price + if hasattr(self, "formatted_unit_price") + else None + ) + _segment_id=( + self.segment_id + if hasattr(self, "segment_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"component_id={_component_id!s}, " + f"starting_quantity={_starting_quantity!s}, " + f"ending_quantity={_ending_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"price_point_id={_price_point_id!s}, " + f"formatted_unit_price={_formatted_unit_price!s}, " + f"segment_id={_segment_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/segment_response.py b/advancedbilling/models/segment_response.py index 542b0dda..bd897fdb 100644 --- a/advancedbilling/models/segment_response.py +++ b/advancedbilling/models/segment_response.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.segment import Segment class SegmentResponse(object): - """Implementation of the 'Segment Response' model. Attributes: segment (Segment): The model property of type Segment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segment": 'segment' + "segment": "segment", } _optionals = [ - 'segment', + "segment", ] - def __init__(self, - segment=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SegmentResponse class""" - + def __init__( + self, + segment=APIHelper.SKIP, + additional_properties=None): + """Initialize a SegmentResponse instance.""" # Initialize members of the class if segment is not APIHelper.SKIP: - self.segment = segment + self.segment = segment # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +56,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - segment = Segment.from_dictionary(dictionary.get('segment')) if 'segment' in dictionary.keys() else APIHelper.SKIP + segment =\ + Segment.from_dictionary( + dictionary.get("segment"))\ + if "segment" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segment={(self.segment if hasattr(self, "segment") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segment=( + self.segment + if hasattr(self, "segment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment={_segment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segment={(self.segment if hasattr(self, "segment") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segment=( + self.segment + if hasattr(self, "segment") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment={_segment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/send_email.py b/advancedbilling/models/send_email.py new file mode 100644 index 00000000..a7316bab --- /dev/null +++ b/advancedbilling/models/send_email.py @@ -0,0 +1,100 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +class SendEmail(object): + """Implementation of the 'SendEmail' model. + + Attributes: + can_execute (bool): The model property of type bool. + url (str): The model property of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "can_execute": "can_execute", + "url": "url", + } + + def __init__( + self, + can_execute=None, + url=None, + additional_properties=None): + """Initialize a SendEmail instance.""" + # Initialize members of the class + self.can_execute = can_execute + self.url = url + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + can_execute =\ + dictionary.get("can_execute")\ + if "can_execute" in dictionary.keys()\ + else None + url =\ + dictionary.get("url")\ + if dictionary.get("url")\ + else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(can_execute, + url, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _can_execute=self.can_execute + _url=self.url + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"can_execute={_can_execute!r}, " + f"url={_url!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _can_execute=self.can_execute + _url=self.url + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"can_execute={_can_execute!s}, " + f"url={_url!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/send_invoice_request.py b/advancedbilling/models/send_invoice_request.py index b2142b22..3f2e988e 100644 --- a/advancedbilling/models/send_invoice_request.py +++ b/advancedbilling/models/send_invoice_request.py @@ -1,54 +1,59 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SendInvoiceRequest(object): - """Implementation of the 'Send Invoice Request' model. Attributes: recipient_emails (List[str]): The model property of type List[str]. cc_recipient_emails (List[str]): The model property of type List[str]. bcc_recipient_emails (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + attachment_urls (List[str]): Array of URLs to files to attach to the invoice + email. Max 10 files, 10MB each. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "recipient_emails": 'recipient_emails', - "cc_recipient_emails": 'cc_recipient_emails', - "bcc_recipient_emails": 'bcc_recipient_emails' + "recipient_emails": "recipient_emails", + "cc_recipient_emails": "cc_recipient_emails", + "bcc_recipient_emails": "bcc_recipient_emails", + "attachment_urls": "attachment_urls", } _optionals = [ - 'recipient_emails', - 'cc_recipient_emails', - 'bcc_recipient_emails', + "recipient_emails", + "cc_recipient_emails", + "bcc_recipient_emails", + "attachment_urls", ] - def __init__(self, - recipient_emails=APIHelper.SKIP, - cc_recipient_emails=APIHelper.SKIP, - bcc_recipient_emails=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SendInvoiceRequest class""" - + def __init__( + self, + recipient_emails=APIHelper.SKIP, + cc_recipient_emails=APIHelper.SKIP, + bcc_recipient_emails=APIHelper.SKIP, + attachment_urls=APIHelper.SKIP, + additional_properties=None): + """Initialize a SendInvoiceRequest instance.""" # Initialize members of the class if recipient_emails is not APIHelper.SKIP: - self.recipient_emails = recipient_emails + self.recipient_emails = recipient_emails if cc_recipient_emails is not APIHelper.SKIP: - self.cc_recipient_emails = cc_recipient_emails + self.cc_recipient_emails = cc_recipient_emails if bcc_recipient_emails is not APIHelper.SKIP: - self.bcc_recipient_emails = bcc_recipient_emails + self.bcc_recipient_emails = bcc_recipient_emails + if attachment_urls is not APIHelper.SKIP: + self.attachment_urls = attachment_urls # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +63,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,32 +74,100 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - recipient_emails = dictionary.get("recipient_emails") if dictionary.get("recipient_emails") else APIHelper.SKIP - cc_recipient_emails = dictionary.get("cc_recipient_emails") if dictionary.get("cc_recipient_emails") else APIHelper.SKIP - bcc_recipient_emails = dictionary.get("bcc_recipient_emails") if dictionary.get("bcc_recipient_emails") else APIHelper.SKIP + recipient_emails =\ + dictionary.get("recipient_emails")\ + if dictionary.get("recipient_emails")\ + else APIHelper.SKIP + cc_recipient_emails =\ + dictionary.get("cc_recipient_emails")\ + if dictionary.get("cc_recipient_emails")\ + else APIHelper.SKIP + bcc_recipient_emails =\ + dictionary.get("bcc_recipient_emails")\ + if dictionary.get("bcc_recipient_emails")\ + else APIHelper.SKIP + attachment_urls =\ + dictionary.get("attachment_urls")\ + if dictionary.get("attachment_urls")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(recipient_emails, cc_recipient_emails, bcc_recipient_emails, + attachment_urls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'recipient_emails={(self.recipient_emails if hasattr(self, "recipient_emails") else None)!r}, ' - f'cc_recipient_emails={(self.cc_recipient_emails if hasattr(self, "cc_recipient_emails") else None)!r}, ' - f'bcc_recipient_emails={(self.bcc_recipient_emails if hasattr(self, "bcc_recipient_emails") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _recipient_emails=( + self.recipient_emails + if hasattr(self, "recipient_emails") + else None + ) + _cc_recipient_emails=( + self.cc_recipient_emails + if hasattr(self, "cc_recipient_emails") + else None + ) + _bcc_recipient_emails=( + self.bcc_recipient_emails + if hasattr(self, "bcc_recipient_emails") + else None + ) + _attachment_urls=( + self.attachment_urls + if hasattr(self, "attachment_urls") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"recipient_emails={_recipient_emails!r}, " + f"cc_recipient_emails={_cc_recipient_emails!r}, " + f"bcc_recipient_emails={_bcc_recipient_emails!r}, " + f"attachment_urls={_attachment_urls!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'recipient_emails={(self.recipient_emails if hasattr(self, "recipient_emails") else None)!s}, ' - f'cc_recipient_emails={(self.cc_recipient_emails if hasattr(self, "cc_recipient_emails") else None)!s}, ' - f'bcc_recipient_emails={(self.bcc_recipient_emails if hasattr(self, "bcc_recipient_emails") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _recipient_emails=( + self.recipient_emails + if hasattr(self, "recipient_emails") + else None + ) + _cc_recipient_emails=( + self.cc_recipient_emails + if hasattr(self, "cc_recipient_emails") + else None + ) + _bcc_recipient_emails=( + self.bcc_recipient_emails + if hasattr(self, "bcc_recipient_emails") + else None + ) + _attachment_urls=( + self.attachment_urls + if hasattr(self, "attachment_urls") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"recipient_emails={_recipient_emails!s}, " + f"cc_recipient_emails={_cc_recipient_emails!s}, " + f"bcc_recipient_emails={_bcc_recipient_emails!s}, " + f"attachment_urls={_attachment_urls!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/service_credit.py b/advancedbilling/models/service_credit.py index 40fae2d4..fdc897eb 100644 --- a/advancedbilling/models/service_credit.py +++ b/advancedbilling/models/service_credit.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ServiceCredit(object): - """Implementation of the 'Service Credit' model. Attributes: @@ -19,48 +17,48 @@ class ServiceCredit(object): ending_balance_in_cents (int): The new balance for the credit account entry_type (ServiceCreditType): The type of entry memo (str): The memo attached to the entry - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "amount_in_cents": 'amount_in_cents', - "ending_balance_in_cents": 'ending_balance_in_cents', - "entry_type": 'entry_type', - "memo": 'memo' + "id": "id", + "amount_in_cents": "amount_in_cents", + "ending_balance_in_cents": "ending_balance_in_cents", + "entry_type": "entry_type", + "memo": "memo", } _optionals = [ - 'id', - 'amount_in_cents', - 'ending_balance_in_cents', - 'entry_type', - 'memo', + "id", + "amount_in_cents", + "ending_balance_in_cents", + "entry_type", + "memo", ] - def __init__(self, - id=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - ending_balance_in_cents=APIHelper.SKIP, - entry_type=APIHelper.SKIP, - memo=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ServiceCredit class""" - + def __init__( + self, + id=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + ending_balance_in_cents=APIHelper.SKIP, + entry_type=APIHelper.SKIP, + memo=APIHelper.SKIP, + additional_properties=None): + """Initialize a ServiceCredit instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if ending_balance_in_cents is not APIHelper.SKIP: - self.ending_balance_in_cents = ending_balance_in_cents + self.ending_balance_in_cents = ending_balance_in_cents if entry_type is not APIHelper.SKIP: - self.entry_type = entry_type + self.entry_type = entry_type if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo # Add additional model properties to the instance if additional_properties is None: @@ -70,7 +68,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -81,18 +79,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - ending_balance_in_cents = dictionary.get("ending_balance_in_cents") if dictionary.get("ending_balance_in_cents") else APIHelper.SKIP - entry_type = dictionary.get("entry_type") if dictionary.get("entry_type") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + ending_balance_in_cents =\ + dictionary.get("ending_balance_in_cents")\ + if dictionary.get("ending_balance_in_cents")\ + else APIHelper.SKIP + entry_type =\ + dictionary.get("entry_type")\ + if dictionary.get("entry_type")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, amount_in_cents, @@ -102,19 +117,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!r}, ' - f'entry_type={(self.entry_type if hasattr(self, "entry_type") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _entry_type=( + self.entry_type + if hasattr(self, "entry_type") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"ending_balance_in_cents={_ending_balance_in_cents!r}, " + f"entry_type={_entry_type!r}, " + f"memo={_memo!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!s}, ' - f'entry_type={(self.entry_type if hasattr(self, "entry_type") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _entry_type=( + self.entry_type + if hasattr(self, "entry_type") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"ending_balance_in_cents={_ending_balance_in_cents!s}, " + f"entry_type={_entry_type!s}, " + f"memo={_memo!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/service_credit_1.py b/advancedbilling/models/service_credit_1.py index bcdce1db..541f5564 100644 --- a/advancedbilling/models/service_credit_1.py +++ b/advancedbilling/models/service_credit_1.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class ServiceCredit1(object): - """Implementation of the 'Service Credit1' model. Attributes: @@ -19,71 +17,74 @@ class ServiceCredit1(object): ending_balance_in_cents (int): The new balance for the credit account entry_type (ServiceCreditType): The type of entry memo (str): The memo attached to the entry - invoice_uid (str): The invoice uid associated with the entry. Only - present for debit entries + invoice_uid (str): The invoice uid associated with the entry. Only present + for debit entries remaining_balance_in_cents (int): The remaining balance for the entry created_at (datetime): The date and time the entry was created - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "amount_in_cents": 'amount_in_cents', - "ending_balance_in_cents": 'ending_balance_in_cents', - "entry_type": 'entry_type', - "memo": 'memo', - "invoice_uid": 'invoice_uid', - "remaining_balance_in_cents": 'remaining_balance_in_cents', - "created_at": 'created_at' + "id": "id", + "amount_in_cents": "amount_in_cents", + "ending_balance_in_cents": "ending_balance_in_cents", + "entry_type": "entry_type", + "memo": "memo", + "invoice_uid": "invoice_uid", + "remaining_balance_in_cents": "remaining_balance_in_cents", + "created_at": "created_at", } _optionals = [ - 'id', - 'amount_in_cents', - 'ending_balance_in_cents', - 'entry_type', - 'memo', - 'invoice_uid', - 'remaining_balance_in_cents', - 'created_at', + "id", + "amount_in_cents", + "ending_balance_in_cents", + "entry_type", + "memo", + "invoice_uid", + "remaining_balance_in_cents", + "created_at", ] _nullables = [ - 'invoice_uid', + "invoice_uid", ] - def __init__(self, - id=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - ending_balance_in_cents=APIHelper.SKIP, - entry_type=APIHelper.SKIP, - memo=APIHelper.SKIP, - invoice_uid=APIHelper.SKIP, - remaining_balance_in_cents=APIHelper.SKIP, - created_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the ServiceCredit1 class""" - + def __init__( + self, + id=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + ending_balance_in_cents=APIHelper.SKIP, + entry_type=APIHelper.SKIP, + memo=APIHelper.SKIP, + invoice_uid=APIHelper.SKIP, + remaining_balance_in_cents=APIHelper.SKIP, + created_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a ServiceCredit1 instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if ending_balance_in_cents is not APIHelper.SKIP: - self.ending_balance_in_cents = ending_balance_in_cents + self.ending_balance_in_cents = ending_balance_in_cents if entry_type is not APIHelper.SKIP: - self.entry_type = entry_type + self.entry_type = entry_type if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if invoice_uid is not APIHelper.SKIP: - self.invoice_uid = invoice_uid + self.invoice_uid = invoice_uid if remaining_balance_in_cents is not APIHelper.SKIP: - self.remaining_balance_in_cents = remaining_balance_in_cents + self.remaining_balance_in_cents = remaining_balance_in_cents if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None # Add additional model properties to the instance if additional_properties is None: @@ -93,7 +94,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -104,21 +105,46 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - ending_balance_in_cents = dictionary.get("ending_balance_in_cents") if dictionary.get("ending_balance_in_cents") else APIHelper.SKIP - entry_type = dictionary.get("entry_type") if dictionary.get("entry_type") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - invoice_uid = dictionary.get("invoice_uid") if "invoice_uid" in dictionary.keys() else APIHelper.SKIP - remaining_balance_in_cents = dictionary.get("remaining_balance_in_cents") if dictionary.get("remaining_balance_in_cents") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + ending_balance_in_cents =\ + dictionary.get("ending_balance_in_cents")\ + if dictionary.get("ending_balance_in_cents")\ + else APIHelper.SKIP + entry_type =\ + dictionary.get("entry_type")\ + if dictionary.get("entry_type")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + invoice_uid =\ + dictionary.get("invoice_uid")\ + if "invoice_uid" in dictionary.keys()\ + else APIHelper.SKIP + remaining_balance_in_cents =\ + dictionary.get("remaining_balance_in_cents")\ + if dictionary.get("remaining_balance_in_cents")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, amount_in_cents, @@ -131,25 +157,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!r}, ' - f'entry_type={(self.entry_type if hasattr(self, "entry_type") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'invoice_uid={(self.invoice_uid if hasattr(self, "invoice_uid") else None)!r}, ' - f'remaining_balance_in_cents={(self.remaining_balance_in_cents if hasattr(self, "remaining_balance_in_cents") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _entry_type=( + self.entry_type + if hasattr(self, "entry_type") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _invoice_uid=( + self.invoice_uid + if hasattr(self, "invoice_uid") + else None + ) + _remaining_balance_in_cents=( + self.remaining_balance_in_cents + if hasattr(self, "remaining_balance_in_cents") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"ending_balance_in_cents={_ending_balance_in_cents!r}, " + f"entry_type={_entry_type!r}, " + f"memo={_memo!r}, " + f"invoice_uid={_invoice_uid!r}, " + f"remaining_balance_in_cents={_remaining_balance_in_cents!r}, " + f"created_at={_created_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!s}, ' - f'entry_type={(self.entry_type if hasattr(self, "entry_type") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'invoice_uid={(self.invoice_uid if hasattr(self, "invoice_uid") else None)!s}, ' - f'remaining_balance_in_cents={(self.remaining_balance_in_cents if hasattr(self, "remaining_balance_in_cents") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _entry_type=( + self.entry_type + if hasattr(self, "entry_type") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _invoice_uid=( + self.invoice_uid + if hasattr(self, "invoice_uid") + else None + ) + _remaining_balance_in_cents=( + self.remaining_balance_in_cents + if hasattr(self, "remaining_balance_in_cents") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"ending_balance_in_cents={_ending_balance_in_cents!s}, " + f"entry_type={_entry_type!s}, " + f"memo={_memo!s}, " + f"invoice_uid={_invoice_uid!s}, " + f"remaining_balance_in_cents={_remaining_balance_in_cents!s}, " + f"created_at={_created_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/service_credit_response.py b/advancedbilling/models/service_credit_response.py index 48d5ad99..6d2ecf30 100644 --- a/advancedbilling/models/service_credit_response.py +++ b/advancedbilling/models/service_credit_response.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.service_credit import ServiceCredit +# ruff: noqa: E501 +from advancedbilling.models.service_credit import ( + ServiceCredit, +) -class ServiceCreditResponse(object): +class ServiceCreditResponse(object): """Implementation of the 'Service Credit Response' model. Attributes: - service_credit (ServiceCredit): The model property of type - ServiceCredit. - additional_properties (Dict[str, object]): The additional properties - for the model. + service_credit (ServiceCredit): The model property of type ServiceCredit. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "service_credit": 'service_credit' + "service_credit": "service_credit", } - def __init__(self, - service_credit=None, - additional_properties=None): - """Constructor for the ServiceCreditResponse class""" - + def __init__( + self, + service_credit=None, + additional_properties=None): + """Initialize a ServiceCreditResponse instance.""" # Initialize members of the class - self.service_credit = service_credit + self.service_credit = service_credit # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - service_credit = ServiceCredit.from_dictionary(dictionary.get('service_credit')) if dictionary.get('service_credit') else None + service_credit =\ + ServiceCredit.from_dictionary( + dictionary.get("service_credit"))\ + if dictionary.get("service_credit") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(service_credit, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'service_credit={self.service_credit!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _service_credit=self.service_credit + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"service_credit={_service_credit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'service_credit={self.service_credit!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _service_credit=self.service_credit + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"service_credit={_service_credit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/service_credit_type.py b/advancedbilling/models/service_credit_type.py index 4b6fba08..b4e550e0 100644 --- a/advancedbilling/models/service_credit_type.py +++ b/advancedbilling/models/service_credit_type.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class ServiceCreditType(object): - """Implementation of the 'Service Credit Type' enum. The type of entry @@ -17,16 +14,18 @@ class ServiceCreditType(object): Attributes: CREDIT: The enum member of type str. DEBIT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CREDIT = 'Credit' - DEBIT = 'Debit' + CREDIT = "Credit" + + DEBIT = "Debit" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/signup_proforma_preview.py b/advancedbilling/models/signup_proforma_preview.py index f364a4c7..e953ef24 100644 --- a/advancedbilling/models/signup_proforma_preview.py +++ b/advancedbilling/models/signup_proforma_preview.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.proforma_invoice import ProformaInvoice +from advancedbilling.models.proforma_invoice import ( + ProformaInvoice, +) class SignupProformaPreview(object): - """Implementation of the 'Signup Proforma Preview' model. Attributes: @@ -19,33 +19,33 @@ class SignupProformaPreview(object): ProformaInvoice. next_proforma_invoice (ProformaInvoice): The model property of type ProformaInvoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "current_proforma_invoice": 'current_proforma_invoice', - "next_proforma_invoice": 'next_proforma_invoice' + "current_proforma_invoice": "current_proforma_invoice", + "next_proforma_invoice": "next_proforma_invoice", } _optionals = [ - 'current_proforma_invoice', - 'next_proforma_invoice', + "current_proforma_invoice", + "next_proforma_invoice", ] - def __init__(self, - current_proforma_invoice=APIHelper.SKIP, - next_proforma_invoice=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SignupProformaPreview class""" - + def __init__( + self, + current_proforma_invoice=APIHelper.SKIP, + next_proforma_invoice=APIHelper.SKIP, + additional_properties=None): + """Initialize a SignupProformaPreview instance.""" # Initialize members of the class if current_proforma_invoice is not APIHelper.SKIP: - self.current_proforma_invoice = current_proforma_invoice + self.current_proforma_invoice = current_proforma_invoice if next_proforma_invoice is not APIHelper.SKIP: - self.next_proforma_invoice = next_proforma_invoice + self.next_proforma_invoice = next_proforma_invoice # Add additional model properties to the instance if additional_properties is None: @@ -55,7 +55,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -66,28 +66,68 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - current_proforma_invoice = ProformaInvoice.from_dictionary(dictionary.get('current_proforma_invoice')) if 'current_proforma_invoice' in dictionary.keys() else APIHelper.SKIP - next_proforma_invoice = ProformaInvoice.from_dictionary(dictionary.get('next_proforma_invoice')) if 'next_proforma_invoice' in dictionary.keys() else APIHelper.SKIP + current_proforma_invoice =\ + ProformaInvoice.from_dictionary( + dictionary.get("current_proforma_invoice"))\ + if "current_proforma_invoice" in dictionary.keys()\ + else APIHelper.SKIP + next_proforma_invoice =\ + ProformaInvoice.from_dictionary( + dictionary.get("next_proforma_invoice"))\ + if "next_proforma_invoice" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(current_proforma_invoice, next_proforma_invoice, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'current_proforma_invoice={(self.current_proforma_invoice if hasattr(self, "current_proforma_invoice") else None)!r}, ' - f'next_proforma_invoice={(self.next_proforma_invoice if hasattr(self, "next_proforma_invoice") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _current_proforma_invoice=( + self.current_proforma_invoice + if hasattr(self, "current_proforma_invoice") + else None + ) + _next_proforma_invoice=( + self.next_proforma_invoice + if hasattr(self, "next_proforma_invoice") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_proforma_invoice={_current_proforma_invoice!r}, " + f"next_proforma_invoice={_next_proforma_invoice!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'current_proforma_invoice={(self.current_proforma_invoice if hasattr(self, "current_proforma_invoice") else None)!s}, ' - f'next_proforma_invoice={(self.next_proforma_invoice if hasattr(self, "next_proforma_invoice") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _current_proforma_invoice=( + self.current_proforma_invoice + if hasattr(self, "current_proforma_invoice") + else None + ) + _next_proforma_invoice=( + self.next_proforma_invoice + if hasattr(self, "next_proforma_invoice") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_proforma_invoice={_current_proforma_invoice!s}, " + f"next_proforma_invoice={_next_proforma_invoice!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/signup_proforma_preview_response.py b/advancedbilling/models/signup_proforma_preview_response.py index eb6f72b0..cf767134 100644 --- a/advancedbilling/models/signup_proforma_preview_response.py +++ b/advancedbilling/models/signup_proforma_preview_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.signup_proforma_preview import SignupProformaPreview +# ruff: noqa: E501 +from advancedbilling.models.signup_proforma_preview import ( + SignupProformaPreview, +) -class SignupProformaPreviewResponse(object): +class SignupProformaPreviewResponse(object): """Implementation of the 'Signup Proforma Preview Response' model. Attributes: - proforma_invoice_preview (SignupProformaPreview): The model property - of type SignupProformaPreview. - additional_properties (Dict[str, object]): The additional properties - for the model. + proforma_invoice_preview (SignupProformaPreview): The model property of type + SignupProformaPreview. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "proforma_invoice_preview": 'proforma_invoice_preview' + "proforma_invoice_preview": "proforma_invoice_preview", } - def __init__(self, - proforma_invoice_preview=None, - additional_properties=None): - """Constructor for the SignupProformaPreviewResponse class""" - + def __init__( + self, + proforma_invoice_preview=None, + additional_properties=None): + """Initialize a SignupProformaPreviewResponse instance.""" # Initialize members of the class - self.proforma_invoice_preview = proforma_invoice_preview + self.proforma_invoice_preview = proforma_invoice_preview # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - proforma_invoice_preview = SignupProformaPreview.from_dictionary(dictionary.get('proforma_invoice_preview')) if dictionary.get('proforma_invoice_preview') else None + proforma_invoice_preview =\ + SignupProformaPreview.from_dictionary( + dictionary.get("proforma_invoice_preview"))\ + if dictionary.get("proforma_invoice_preview") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(proforma_invoice_preview, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'proforma_invoice_preview={self.proforma_invoice_preview!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _proforma_invoice_preview=self.proforma_invoice_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"proforma_invoice_preview={_proforma_invoice_preview!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'proforma_invoice_preview={self.proforma_invoice_preview!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _proforma_invoice_preview=self.proforma_invoice_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"proforma_invoice_preview={_proforma_invoice_preview!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/site.py b/advancedbilling/models/site.py index 6a3c97e4..8fdf473f 100644 --- a/advancedbilling/models/site.py +++ b/advancedbilling/models/site.py @@ -1,20 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.allocation_settings import AllocationSettings -from advancedbilling.models.net_terms import NetTerms -from advancedbilling.models.organization_address import OrganizationAddress -from advancedbilling.models.tax_configuration import TaxConfiguration +from advancedbilling.models.allocation_settings import ( + AllocationSettings, +) +from advancedbilling.models.net_terms import ( + NetTerms, +) +from advancedbilling.models.organization_address import ( + OrganizationAddress, +) +from advancedbilling.models.tax_configuration import ( + TaxConfiguration, +) class Site(object): - """Implementation of the 'Site' model. Attributes: @@ -23,126 +29,127 @@ class Site(object): subdomain (str): The model property of type str. currency (str): The model property of type str. seller_id (int): The model property of type int. - non_primary_currencies (List[str]): The model property of type - List[str]. + non_primary_currencies (List[str]): The model property of type List[str]. relationship_invoicing_enabled (bool): The model property of type bool. - schedule_subscription_cancellation_enabled (bool): The model property - of type bool. + schedule_subscription_cancellation_enabled (bool): The model property of type + bool. customer_hierarchy_enabled (bool): The model property of type bool. whopays_enabled (bool): The model property of type bool. whopays_default_payer (str): The model property of type str. allocation_settings (AllocationSettings): The model property of type AllocationSettings. - default_payment_collection_method (str): The model property of type - str. + default_payment_collection_method (str): The model property of type str. organization_address (OrganizationAddress): The model property of type OrganizationAddress. tax_configuration (TaxConfiguration): The model property of type TaxConfiguration. net_terms (NetTerms): The model property of type NetTerms. test (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "subdomain": 'subdomain', - "currency": 'currency', - "seller_id": 'seller_id', - "non_primary_currencies": 'non_primary_currencies', - "relationship_invoicing_enabled": 'relationship_invoicing_enabled', - "schedule_subscription_cancellation_enabled": 'schedule_subscription_cancellation_enabled', - "customer_hierarchy_enabled": 'customer_hierarchy_enabled', - "whopays_enabled": 'whopays_enabled', - "whopays_default_payer": 'whopays_default_payer', - "allocation_settings": 'allocation_settings', - "default_payment_collection_method": 'default_payment_collection_method', - "organization_address": 'organization_address', - "tax_configuration": 'tax_configuration', - "net_terms": 'net_terms', - "test": 'test' + "id": "id", + "name": "name", + "subdomain": "subdomain", + "currency": "currency", + "seller_id": "seller_id", + "non_primary_currencies": "non_primary_currencies", + "relationship_invoicing_enabled": "relationship_invoicing_enabled", + "schedule_subscription_cancellation_enabled": + "schedule_subscription_cancellation_enabled", + "customer_hierarchy_enabled": "customer_hierarchy_enabled", + "whopays_enabled": "whopays_enabled", + "whopays_default_payer": "whopays_default_payer", + "allocation_settings": "allocation_settings", + "default_payment_collection_method": "default_payment_collection_method", + "organization_address": "organization_address", + "tax_configuration": "tax_configuration", + "net_terms": "net_terms", + "test": "test", } _optionals = [ - 'id', - 'name', - 'subdomain', - 'currency', - 'seller_id', - 'non_primary_currencies', - 'relationship_invoicing_enabled', - 'schedule_subscription_cancellation_enabled', - 'customer_hierarchy_enabled', - 'whopays_enabled', - 'whopays_default_payer', - 'allocation_settings', - 'default_payment_collection_method', - 'organization_address', - 'tax_configuration', - 'net_terms', - 'test', + "id", + "name", + "subdomain", + "currency", + "seller_id", + "non_primary_currencies", + "relationship_invoicing_enabled", + "schedule_subscription_cancellation_enabled", + "customer_hierarchy_enabled", + "whopays_enabled", + "whopays_default_payer", + "allocation_settings", + "default_payment_collection_method", + "organization_address", + "tax_configuration", + "net_terms", + "test", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - subdomain=APIHelper.SKIP, - currency=APIHelper.SKIP, - seller_id=APIHelper.SKIP, - non_primary_currencies=APIHelper.SKIP, - relationship_invoicing_enabled=APIHelper.SKIP, - schedule_subscription_cancellation_enabled=APIHelper.SKIP, - customer_hierarchy_enabled=APIHelper.SKIP, - whopays_enabled=APIHelper.SKIP, - whopays_default_payer=APIHelper.SKIP, - allocation_settings=APIHelper.SKIP, - default_payment_collection_method=APIHelper.SKIP, - organization_address=APIHelper.SKIP, - tax_configuration=APIHelper.SKIP, - net_terms=APIHelper.SKIP, - test=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Site class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + subdomain=APIHelper.SKIP, + currency=APIHelper.SKIP, + seller_id=APIHelper.SKIP, + non_primary_currencies=APIHelper.SKIP, + relationship_invoicing_enabled=APIHelper.SKIP, + schedule_subscription_cancellation_enabled=APIHelper.SKIP, + customer_hierarchy_enabled=APIHelper.SKIP, + whopays_enabled=APIHelper.SKIP, + whopays_default_payer=APIHelper.SKIP, + allocation_settings=APIHelper.SKIP, + default_payment_collection_method=APIHelper.SKIP, + organization_address=APIHelper.SKIP, + tax_configuration=APIHelper.SKIP, + net_terms=APIHelper.SKIP, + test=APIHelper.SKIP, + additional_properties=None): + """Initialize a Site instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if subdomain is not APIHelper.SKIP: - self.subdomain = subdomain + self.subdomain = subdomain if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if seller_id is not APIHelper.SKIP: - self.seller_id = seller_id + self.seller_id = seller_id if non_primary_currencies is not APIHelper.SKIP: - self.non_primary_currencies = non_primary_currencies + self.non_primary_currencies = non_primary_currencies if relationship_invoicing_enabled is not APIHelper.SKIP: - self.relationship_invoicing_enabled = relationship_invoicing_enabled + self.relationship_invoicing_enabled = relationship_invoicing_enabled if schedule_subscription_cancellation_enabled is not APIHelper.SKIP: - self.schedule_subscription_cancellation_enabled = schedule_subscription_cancellation_enabled + self.schedule_subscription_cancellation_enabled =\ + schedule_subscription_cancellation_enabled if customer_hierarchy_enabled is not APIHelper.SKIP: - self.customer_hierarchy_enabled = customer_hierarchy_enabled + self.customer_hierarchy_enabled = customer_hierarchy_enabled if whopays_enabled is not APIHelper.SKIP: - self.whopays_enabled = whopays_enabled + self.whopays_enabled = whopays_enabled if whopays_default_payer is not APIHelper.SKIP: - self.whopays_default_payer = whopays_default_payer + self.whopays_default_payer = whopays_default_payer if allocation_settings is not APIHelper.SKIP: - self.allocation_settings = allocation_settings + self.allocation_settings = allocation_settings if default_payment_collection_method is not APIHelper.SKIP: - self.default_payment_collection_method = default_payment_collection_method + self.default_payment_collection_method =\ + default_payment_collection_method if organization_address is not APIHelper.SKIP: - self.organization_address = organization_address + self.organization_address = organization_address if tax_configuration is not APIHelper.SKIP: - self.tax_configuration = tax_configuration + self.tax_configuration = tax_configuration if net_terms is not APIHelper.SKIP: - self.net_terms = net_terms + self.net_terms = net_terms if test is not APIHelper.SKIP: - self.test = test + self.test = test # Add additional model properties to the instance if additional_properties is None: @@ -152,7 +159,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -163,30 +170,87 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - subdomain = dictionary.get("subdomain") if dictionary.get("subdomain") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - seller_id = dictionary.get("seller_id") if dictionary.get("seller_id") else APIHelper.SKIP - non_primary_currencies = dictionary.get("non_primary_currencies") if dictionary.get("non_primary_currencies") else APIHelper.SKIP - relationship_invoicing_enabled = dictionary.get("relationship_invoicing_enabled") if "relationship_invoicing_enabled" in dictionary.keys() else APIHelper.SKIP - schedule_subscription_cancellation_enabled = dictionary.get("schedule_subscription_cancellation_enabled") if "schedule_subscription_cancellation_enabled" in dictionary.keys() else APIHelper.SKIP - customer_hierarchy_enabled = dictionary.get("customer_hierarchy_enabled") if "customer_hierarchy_enabled" in dictionary.keys() else APIHelper.SKIP - whopays_enabled = dictionary.get("whopays_enabled") if "whopays_enabled" in dictionary.keys() else APIHelper.SKIP - whopays_default_payer = dictionary.get("whopays_default_payer") if dictionary.get("whopays_default_payer") else APIHelper.SKIP - allocation_settings = AllocationSettings.from_dictionary(dictionary.get('allocation_settings')) if 'allocation_settings' in dictionary.keys() else APIHelper.SKIP - default_payment_collection_method = dictionary.get("default_payment_collection_method") if dictionary.get("default_payment_collection_method") else APIHelper.SKIP - organization_address = OrganizationAddress.from_dictionary(dictionary.get('organization_address')) if 'organization_address' in dictionary.keys() else APIHelper.SKIP - tax_configuration = TaxConfiguration.from_dictionary(dictionary.get('tax_configuration')) if 'tax_configuration' in dictionary.keys() else APIHelper.SKIP - net_terms = NetTerms.from_dictionary(dictionary.get('net_terms')) if 'net_terms' in dictionary.keys() else APIHelper.SKIP - test = dictionary.get("test") if "test" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + subdomain =\ + dictionary.get("subdomain")\ + if dictionary.get("subdomain")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + seller_id =\ + dictionary.get("seller_id")\ + if dictionary.get("seller_id")\ + else APIHelper.SKIP + non_primary_currencies =\ + dictionary.get("non_primary_currencies")\ + if dictionary.get("non_primary_currencies")\ + else APIHelper.SKIP + relationship_invoicing_enabled =\ + dictionary.get("relationship_invoicing_enabled")\ + if "relationship_invoicing_enabled" in dictionary.keys()\ + else APIHelper.SKIP + schedule_subscription_cancellation_enabled =\ + dictionary.get("schedule_subscription_cancellation_enabled")\ + if "schedule_subscription_cancellation_enabled" in dictionary.keys()\ + else APIHelper.SKIP + customer_hierarchy_enabled =\ + dictionary.get("customer_hierarchy_enabled")\ + if "customer_hierarchy_enabled" in dictionary.keys()\ + else APIHelper.SKIP + whopays_enabled =\ + dictionary.get("whopays_enabled")\ + if "whopays_enabled" in dictionary.keys()\ + else APIHelper.SKIP + whopays_default_payer =\ + dictionary.get("whopays_default_payer")\ + if dictionary.get("whopays_default_payer")\ + else APIHelper.SKIP + allocation_settings =\ + AllocationSettings.from_dictionary( + dictionary.get("allocation_settings"))\ + if "allocation_settings" in dictionary.keys()\ + else APIHelper.SKIP + default_payment_collection_method =\ + dictionary.get("default_payment_collection_method")\ + if dictionary.get("default_payment_collection_method")\ + else APIHelper.SKIP + organization_address =\ + OrganizationAddress.from_dictionary( + dictionary.get("organization_address"))\ + if "organization_address" in dictionary.keys()\ + else APIHelper.SKIP + tax_configuration =\ + TaxConfiguration.from_dictionary( + dictionary.get("tax_configuration"))\ + if "tax_configuration" in dictionary.keys()\ + else APIHelper.SKIP + net_terms =\ + NetTerms.from_dictionary( + dictionary.get("net_terms"))\ + if "net_terms" in dictionary.keys()\ + else APIHelper.SKIP + test =\ + dictionary.get("test")\ + if "test" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -208,43 +272,223 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'subdomain={(self.subdomain if hasattr(self, "subdomain") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'seller_id={(self.seller_id if hasattr(self, "seller_id") else None)!r}, ' - f'non_primary_currencies={(self.non_primary_currencies if hasattr(self, "non_primary_currencies") else None)!r}, ' - f'relationship_invoicing_enabled={(self.relationship_invoicing_enabled if hasattr(self, "relationship_invoicing_enabled") else None)!r}, ' - f'schedule_subscription_cancellation_enabled={(self.schedule_subscription_cancellation_enabled if hasattr(self, "schedule_subscription_cancellation_enabled") else None)!r}, ' - f'customer_hierarchy_enabled={(self.customer_hierarchy_enabled if hasattr(self, "customer_hierarchy_enabled") else None)!r}, ' - f'whopays_enabled={(self.whopays_enabled if hasattr(self, "whopays_enabled") else None)!r}, ' - f'whopays_default_payer={(self.whopays_default_payer if hasattr(self, "whopays_default_payer") else None)!r}, ' - f'allocation_settings={(self.allocation_settings if hasattr(self, "allocation_settings") else None)!r}, ' - f'default_payment_collection_method={(self.default_payment_collection_method if hasattr(self, "default_payment_collection_method") else None)!r}, ' - f'organization_address={(self.organization_address if hasattr(self, "organization_address") else None)!r}, ' - f'tax_configuration={(self.tax_configuration if hasattr(self, "tax_configuration") else None)!r}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!r}, ' - f'test={(self.test if hasattr(self, "test") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _subdomain=( + self.subdomain + if hasattr(self, "subdomain") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _seller_id=( + self.seller_id + if hasattr(self, "seller_id") + else None + ) + _non_primary_currencies=( + self.non_primary_currencies + if hasattr(self, "non_primary_currencies") + else None + ) + _relationship_invoicing_enabled=( + self.relationship_invoicing_enabled + if hasattr(self, "relationship_invoicing_enabled") + else None + ) + _schedule_subscription_cancellation_enabled=( + self.schedule_subscription_cancellation_enabled + if hasattr(self, "schedule_subscription_cancellation_enabled") + else None + ) + _customer_hierarchy_enabled=( + self.customer_hierarchy_enabled + if hasattr(self, "customer_hierarchy_enabled") + else None + ) + _whopays_enabled=( + self.whopays_enabled + if hasattr(self, "whopays_enabled") + else None + ) + _whopays_default_payer=( + self.whopays_default_payer + if hasattr(self, "whopays_default_payer") + else None + ) + _allocation_settings=( + self.allocation_settings + if hasattr(self, "allocation_settings") + else None + ) + _default_payment_collection_method=( + self.default_payment_collection_method + if hasattr(self, "default_payment_collection_method") + else None + ) + _organization_address=( + self.organization_address + if hasattr(self, "organization_address") + else None + ) + _tax_configuration=( + self.tax_configuration + if hasattr(self, "tax_configuration") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _test=( + self.test + if hasattr(self, "test") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"subdomain={_subdomain!r}, " + f"currency={_currency!r}, " + f"seller_id={_seller_id!r}, " + f"non_primary_currencies={_non_primary_currencies!r}, " + f"relationship_invoicing_enabled={_relationship_invoicing_enabled!r}, " + f"schedule_subscription_cancellation_enabled={_schedule_subscription_cancellation_enabled!r}, " + f"customer_hierarchy_enabled={_customer_hierarchy_enabled!r}, " + f"whopays_enabled={_whopays_enabled!r}, " + f"whopays_default_payer={_whopays_default_payer!r}, " + f"allocation_settings={_allocation_settings!r}, " + f"default_payment_collection_method={_default_payment_collection_method!r}, " + f"organization_address={_organization_address!r}, " + f"tax_configuration={_tax_configuration!r}, " + f"net_terms={_net_terms!r}, " + f"test={_test!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'subdomain={(self.subdomain if hasattr(self, "subdomain") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'seller_id={(self.seller_id if hasattr(self, "seller_id") else None)!s}, ' - f'non_primary_currencies={(self.non_primary_currencies if hasattr(self, "non_primary_currencies") else None)!s}, ' - f'relationship_invoicing_enabled={(self.relationship_invoicing_enabled if hasattr(self, "relationship_invoicing_enabled") else None)!s}, ' - f'schedule_subscription_cancellation_enabled={(self.schedule_subscription_cancellation_enabled if hasattr(self, "schedule_subscription_cancellation_enabled") else None)!s}, ' - f'customer_hierarchy_enabled={(self.customer_hierarchy_enabled if hasattr(self, "customer_hierarchy_enabled") else None)!s}, ' - f'whopays_enabled={(self.whopays_enabled if hasattr(self, "whopays_enabled") else None)!s}, ' - f'whopays_default_payer={(self.whopays_default_payer if hasattr(self, "whopays_default_payer") else None)!s}, ' - f'allocation_settings={(self.allocation_settings if hasattr(self, "allocation_settings") else None)!s}, ' - f'default_payment_collection_method={(self.default_payment_collection_method if hasattr(self, "default_payment_collection_method") else None)!s}, ' - f'organization_address={(self.organization_address if hasattr(self, "organization_address") else None)!s}, ' - f'tax_configuration={(self.tax_configuration if hasattr(self, "tax_configuration") else None)!s}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!s}, ' - f'test={(self.test if hasattr(self, "test") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _subdomain=( + self.subdomain + if hasattr(self, "subdomain") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _seller_id=( + self.seller_id + if hasattr(self, "seller_id") + else None + ) + _non_primary_currencies=( + self.non_primary_currencies + if hasattr(self, "non_primary_currencies") + else None + ) + _relationship_invoicing_enabled=( + self.relationship_invoicing_enabled + if hasattr(self, "relationship_invoicing_enabled") + else None + ) + _schedule_subscription_cancellation_enabled=( + self.schedule_subscription_cancellation_enabled + if hasattr(self, "schedule_subscription_cancellation_enabled") + else None + ) + _customer_hierarchy_enabled=( + self.customer_hierarchy_enabled + if hasattr(self, "customer_hierarchy_enabled") + else None + ) + _whopays_enabled=( + self.whopays_enabled + if hasattr(self, "whopays_enabled") + else None + ) + _whopays_default_payer=( + self.whopays_default_payer + if hasattr(self, "whopays_default_payer") + else None + ) + _allocation_settings=( + self.allocation_settings + if hasattr(self, "allocation_settings") + else None + ) + _default_payment_collection_method=( + self.default_payment_collection_method + if hasattr(self, "default_payment_collection_method") + else None + ) + _organization_address=( + self.organization_address + if hasattr(self, "organization_address") + else None + ) + _tax_configuration=( + self.tax_configuration + if hasattr(self, "tax_configuration") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _test=( + self.test + if hasattr(self, "test") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"subdomain={_subdomain!s}, " + f"currency={_currency!s}, " + f"seller_id={_seller_id!s}, " + f"non_primary_currencies={_non_primary_currencies!s}, " + f"relationship_invoicing_enabled={_relationship_invoicing_enabled!s}, " + f"schedule_subscription_cancellation_enabled={_schedule_subscription_cancellation_enabled!s}, " + f"customer_hierarchy_enabled={_customer_hierarchy_enabled!s}, " + f"whopays_enabled={_whopays_enabled!s}, " + f"whopays_default_payer={_whopays_default_payer!s}, " + f"allocation_settings={_allocation_settings!s}, " + f"default_payment_collection_method={_default_payment_collection_method!s}, " + f"organization_address={_organization_address!s}, " + f"tax_configuration={_tax_configuration!s}, " + f"net_terms={_net_terms!s}, " + f"test={_test!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/site_response.py b/advancedbilling/models/site_response.py index 8a65f0db..ed4fdadc 100644 --- a/advancedbilling/models/site_response.py +++ b/advancedbilling/models/site_response.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.models.site import Site class SiteResponse(object): - """Implementation of the 'Site Response' model. Attributes: site (Site): The model property of type Site. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "site": 'site' + "site": "site", } - def __init__(self, - site=None, - additional_properties=None): - """Constructor for the SiteResponse class""" - + def __init__( + self, + site=None, + additional_properties=None): + """Initialize a SiteResponse instance.""" # Initialize members of the class - self.site = site + self.site = site # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +50,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - site = Site.from_dictionary(dictionary.get('site')) if dictionary.get('site') else None + site =\ + Site.from_dictionary( + dictionary.get("site"))\ + if dictionary.get("site") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(site, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'site={self.site!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _site=self.site + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"site={_site!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'site={self.site!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _site=self.site + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"site={_site!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/site_statistics.py b/advancedbilling/models/site_statistics.py index 75e003ed..deac5599 100644 --- a/advancedbilling/models/site_statistics.py +++ b/advancedbilling/models/site_statistics.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SiteStatistics(object): - """Implementation of the 'Site Statistics' model. Attributes: @@ -25,78 +23,78 @@ class SiteStatistics(object): total_past_due_subscriptions (int): The model property of type int. total_unpaid_subscriptions (int): The model property of type int. total_dunning_subscriptions (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "total_subscriptions": 'total_subscriptions', - "subscriptions_today": 'subscriptions_today', - "total_revenue": 'total_revenue', - "revenue_today": 'revenue_today', - "revenue_this_month": 'revenue_this_month', - "revenue_this_year": 'revenue_this_year', - "total_canceled_subscriptions": 'total_canceled_subscriptions', - "total_active_subscriptions": 'total_active_subscriptions', - "total_past_due_subscriptions": 'total_past_due_subscriptions', - "total_unpaid_subscriptions": 'total_unpaid_subscriptions', - "total_dunning_subscriptions": 'total_dunning_subscriptions' + "total_subscriptions": "total_subscriptions", + "subscriptions_today": "subscriptions_today", + "total_revenue": "total_revenue", + "revenue_today": "revenue_today", + "revenue_this_month": "revenue_this_month", + "revenue_this_year": "revenue_this_year", + "total_canceled_subscriptions": "total_canceled_subscriptions", + "total_active_subscriptions": "total_active_subscriptions", + "total_past_due_subscriptions": "total_past_due_subscriptions", + "total_unpaid_subscriptions": "total_unpaid_subscriptions", + "total_dunning_subscriptions": "total_dunning_subscriptions", } _optionals = [ - 'total_subscriptions', - 'subscriptions_today', - 'total_revenue', - 'revenue_today', - 'revenue_this_month', - 'revenue_this_year', - 'total_canceled_subscriptions', - 'total_active_subscriptions', - 'total_past_due_subscriptions', - 'total_unpaid_subscriptions', - 'total_dunning_subscriptions', + "total_subscriptions", + "subscriptions_today", + "total_revenue", + "revenue_today", + "revenue_this_month", + "revenue_this_year", + "total_canceled_subscriptions", + "total_active_subscriptions", + "total_past_due_subscriptions", + "total_unpaid_subscriptions", + "total_dunning_subscriptions", ] - def __init__(self, - total_subscriptions=APIHelper.SKIP, - subscriptions_today=APIHelper.SKIP, - total_revenue=APIHelper.SKIP, - revenue_today=APIHelper.SKIP, - revenue_this_month=APIHelper.SKIP, - revenue_this_year=APIHelper.SKIP, - total_canceled_subscriptions=APIHelper.SKIP, - total_active_subscriptions=APIHelper.SKIP, - total_past_due_subscriptions=APIHelper.SKIP, - total_unpaid_subscriptions=APIHelper.SKIP, - total_dunning_subscriptions=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SiteStatistics class""" - + def __init__( + self, + total_subscriptions=APIHelper.SKIP, + subscriptions_today=APIHelper.SKIP, + total_revenue=APIHelper.SKIP, + revenue_today=APIHelper.SKIP, + revenue_this_month=APIHelper.SKIP, + revenue_this_year=APIHelper.SKIP, + total_canceled_subscriptions=APIHelper.SKIP, + total_active_subscriptions=APIHelper.SKIP, + total_past_due_subscriptions=APIHelper.SKIP, + total_unpaid_subscriptions=APIHelper.SKIP, + total_dunning_subscriptions=APIHelper.SKIP, + additional_properties=None): + """Initialize a SiteStatistics instance.""" # Initialize members of the class if total_subscriptions is not APIHelper.SKIP: - self.total_subscriptions = total_subscriptions + self.total_subscriptions = total_subscriptions if subscriptions_today is not APIHelper.SKIP: - self.subscriptions_today = subscriptions_today + self.subscriptions_today = subscriptions_today if total_revenue is not APIHelper.SKIP: - self.total_revenue = total_revenue + self.total_revenue = total_revenue if revenue_today is not APIHelper.SKIP: - self.revenue_today = revenue_today + self.revenue_today = revenue_today if revenue_this_month is not APIHelper.SKIP: - self.revenue_this_month = revenue_this_month + self.revenue_this_month = revenue_this_month if revenue_this_year is not APIHelper.SKIP: - self.revenue_this_year = revenue_this_year + self.revenue_this_year = revenue_this_year if total_canceled_subscriptions is not APIHelper.SKIP: - self.total_canceled_subscriptions = total_canceled_subscriptions + self.total_canceled_subscriptions = total_canceled_subscriptions if total_active_subscriptions is not APIHelper.SKIP: - self.total_active_subscriptions = total_active_subscriptions + self.total_active_subscriptions = total_active_subscriptions if total_past_due_subscriptions is not APIHelper.SKIP: - self.total_past_due_subscriptions = total_past_due_subscriptions + self.total_past_due_subscriptions = total_past_due_subscriptions if total_unpaid_subscriptions is not APIHelper.SKIP: - self.total_unpaid_subscriptions = total_unpaid_subscriptions + self.total_unpaid_subscriptions = total_unpaid_subscriptions if total_dunning_subscriptions is not APIHelper.SKIP: - self.total_dunning_subscriptions = total_dunning_subscriptions + self.total_dunning_subscriptions = total_dunning_subscriptions # Add additional model properties to the instance if additional_properties is None: @@ -106,7 +104,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -117,24 +115,59 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - total_subscriptions = dictionary.get("total_subscriptions") if dictionary.get("total_subscriptions") else APIHelper.SKIP - subscriptions_today = dictionary.get("subscriptions_today") if dictionary.get("subscriptions_today") else APIHelper.SKIP - total_revenue = dictionary.get("total_revenue") if dictionary.get("total_revenue") else APIHelper.SKIP - revenue_today = dictionary.get("revenue_today") if dictionary.get("revenue_today") else APIHelper.SKIP - revenue_this_month = dictionary.get("revenue_this_month") if dictionary.get("revenue_this_month") else APIHelper.SKIP - revenue_this_year = dictionary.get("revenue_this_year") if dictionary.get("revenue_this_year") else APIHelper.SKIP - total_canceled_subscriptions = dictionary.get("total_canceled_subscriptions") if dictionary.get("total_canceled_subscriptions") else APIHelper.SKIP - total_active_subscriptions = dictionary.get("total_active_subscriptions") if dictionary.get("total_active_subscriptions") else APIHelper.SKIP - total_past_due_subscriptions = dictionary.get("total_past_due_subscriptions") if dictionary.get("total_past_due_subscriptions") else APIHelper.SKIP - total_unpaid_subscriptions = dictionary.get("total_unpaid_subscriptions") if dictionary.get("total_unpaid_subscriptions") else APIHelper.SKIP - total_dunning_subscriptions = dictionary.get("total_dunning_subscriptions") if dictionary.get("total_dunning_subscriptions") else APIHelper.SKIP + total_subscriptions =\ + dictionary.get("total_subscriptions")\ + if dictionary.get("total_subscriptions")\ + else APIHelper.SKIP + subscriptions_today =\ + dictionary.get("subscriptions_today")\ + if dictionary.get("subscriptions_today")\ + else APIHelper.SKIP + total_revenue =\ + dictionary.get("total_revenue")\ + if dictionary.get("total_revenue")\ + else APIHelper.SKIP + revenue_today =\ + dictionary.get("revenue_today")\ + if dictionary.get("revenue_today")\ + else APIHelper.SKIP + revenue_this_month =\ + dictionary.get("revenue_this_month")\ + if dictionary.get("revenue_this_month")\ + else APIHelper.SKIP + revenue_this_year =\ + dictionary.get("revenue_this_year")\ + if dictionary.get("revenue_this_year")\ + else APIHelper.SKIP + total_canceled_subscriptions =\ + dictionary.get("total_canceled_subscriptions")\ + if dictionary.get("total_canceled_subscriptions")\ + else APIHelper.SKIP + total_active_subscriptions =\ + dictionary.get("total_active_subscriptions")\ + if dictionary.get("total_active_subscriptions")\ + else APIHelper.SKIP + total_past_due_subscriptions =\ + dictionary.get("total_past_due_subscriptions")\ + if dictionary.get("total_past_due_subscriptions")\ + else APIHelper.SKIP + total_unpaid_subscriptions =\ + dictionary.get("total_unpaid_subscriptions")\ + if dictionary.get("total_unpaid_subscriptions")\ + else APIHelper.SKIP + total_dunning_subscriptions =\ + dictionary.get("total_dunning_subscriptions")\ + if dictionary.get("total_dunning_subscriptions")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(total_subscriptions, subscriptions_today, @@ -150,31 +183,151 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'total_subscriptions={(self.total_subscriptions if hasattr(self, "total_subscriptions") else None)!r}, ' - f'subscriptions_today={(self.subscriptions_today if hasattr(self, "subscriptions_today") else None)!r}, ' - f'total_revenue={(self.total_revenue if hasattr(self, "total_revenue") else None)!r}, ' - f'revenue_today={(self.revenue_today if hasattr(self, "revenue_today") else None)!r}, ' - f'revenue_this_month={(self.revenue_this_month if hasattr(self, "revenue_this_month") else None)!r}, ' - f'revenue_this_year={(self.revenue_this_year if hasattr(self, "revenue_this_year") else None)!r}, ' - f'total_canceled_subscriptions={(self.total_canceled_subscriptions if hasattr(self, "total_canceled_subscriptions") else None)!r}, ' - f'total_active_subscriptions={(self.total_active_subscriptions if hasattr(self, "total_active_subscriptions") else None)!r}, ' - f'total_past_due_subscriptions={(self.total_past_due_subscriptions if hasattr(self, "total_past_due_subscriptions") else None)!r}, ' - f'total_unpaid_subscriptions={(self.total_unpaid_subscriptions if hasattr(self, "total_unpaid_subscriptions") else None)!r}, ' - f'total_dunning_subscriptions={(self.total_dunning_subscriptions if hasattr(self, "total_dunning_subscriptions") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _total_subscriptions=( + self.total_subscriptions + if hasattr(self, "total_subscriptions") + else None + ) + _subscriptions_today=( + self.subscriptions_today + if hasattr(self, "subscriptions_today") + else None + ) + _total_revenue=( + self.total_revenue + if hasattr(self, "total_revenue") + else None + ) + _revenue_today=( + self.revenue_today + if hasattr(self, "revenue_today") + else None + ) + _revenue_this_month=( + self.revenue_this_month + if hasattr(self, "revenue_this_month") + else None + ) + _revenue_this_year=( + self.revenue_this_year + if hasattr(self, "revenue_this_year") + else None + ) + _total_canceled_subscriptions=( + self.total_canceled_subscriptions + if hasattr(self, "total_canceled_subscriptions") + else None + ) + _total_active_subscriptions=( + self.total_active_subscriptions + if hasattr(self, "total_active_subscriptions") + else None + ) + _total_past_due_subscriptions=( + self.total_past_due_subscriptions + if hasattr(self, "total_past_due_subscriptions") + else None + ) + _total_unpaid_subscriptions=( + self.total_unpaid_subscriptions + if hasattr(self, "total_unpaid_subscriptions") + else None + ) + _total_dunning_subscriptions=( + self.total_dunning_subscriptions + if hasattr(self, "total_dunning_subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_subscriptions={_total_subscriptions!r}, " + f"subscriptions_today={_subscriptions_today!r}, " + f"total_revenue={_total_revenue!r}, " + f"revenue_today={_revenue_today!r}, " + f"revenue_this_month={_revenue_this_month!r}, " + f"revenue_this_year={_revenue_this_year!r}, " + f"total_canceled_subscriptions={_total_canceled_subscriptions!r}, " + f"total_active_subscriptions={_total_active_subscriptions!r}, " + f"total_past_due_subscriptions={_total_past_due_subscriptions!r}, " + f"total_unpaid_subscriptions={_total_unpaid_subscriptions!r}, " + f"total_dunning_subscriptions={_total_dunning_subscriptions!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'total_subscriptions={(self.total_subscriptions if hasattr(self, "total_subscriptions") else None)!s}, ' - f'subscriptions_today={(self.subscriptions_today if hasattr(self, "subscriptions_today") else None)!s}, ' - f'total_revenue={(self.total_revenue if hasattr(self, "total_revenue") else None)!s}, ' - f'revenue_today={(self.revenue_today if hasattr(self, "revenue_today") else None)!s}, ' - f'revenue_this_month={(self.revenue_this_month if hasattr(self, "revenue_this_month") else None)!s}, ' - f'revenue_this_year={(self.revenue_this_year if hasattr(self, "revenue_this_year") else None)!s}, ' - f'total_canceled_subscriptions={(self.total_canceled_subscriptions if hasattr(self, "total_canceled_subscriptions") else None)!s}, ' - f'total_active_subscriptions={(self.total_active_subscriptions if hasattr(self, "total_active_subscriptions") else None)!s}, ' - f'total_past_due_subscriptions={(self.total_past_due_subscriptions if hasattr(self, "total_past_due_subscriptions") else None)!s}, ' - f'total_unpaid_subscriptions={(self.total_unpaid_subscriptions if hasattr(self, "total_unpaid_subscriptions") else None)!s}, ' - f'total_dunning_subscriptions={(self.total_dunning_subscriptions if hasattr(self, "total_dunning_subscriptions") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _total_subscriptions=( + self.total_subscriptions + if hasattr(self, "total_subscriptions") + else None + ) + _subscriptions_today=( + self.subscriptions_today + if hasattr(self, "subscriptions_today") + else None + ) + _total_revenue=( + self.total_revenue + if hasattr(self, "total_revenue") + else None + ) + _revenue_today=( + self.revenue_today + if hasattr(self, "revenue_today") + else None + ) + _revenue_this_month=( + self.revenue_this_month + if hasattr(self, "revenue_this_month") + else None + ) + _revenue_this_year=( + self.revenue_this_year + if hasattr(self, "revenue_this_year") + else None + ) + _total_canceled_subscriptions=( + self.total_canceled_subscriptions + if hasattr(self, "total_canceled_subscriptions") + else None + ) + _total_active_subscriptions=( + self.total_active_subscriptions + if hasattr(self, "total_active_subscriptions") + else None + ) + _total_past_due_subscriptions=( + self.total_past_due_subscriptions + if hasattr(self, "total_past_due_subscriptions") + else None + ) + _total_unpaid_subscriptions=( + self.total_unpaid_subscriptions + if hasattr(self, "total_unpaid_subscriptions") + else None + ) + _total_dunning_subscriptions=( + self.total_dunning_subscriptions + if hasattr(self, "total_dunning_subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"total_subscriptions={_total_subscriptions!s}, " + f"subscriptions_today={_subscriptions_today!s}, " + f"total_revenue={_total_revenue!s}, " + f"revenue_today={_revenue_today!s}, " + f"revenue_this_month={_revenue_this_month!s}, " + f"revenue_this_year={_revenue_this_year!s}, " + f"total_canceled_subscriptions={_total_canceled_subscriptions!s}, " + f"total_active_subscriptions={_total_active_subscriptions!s}, " + f"total_past_due_subscriptions={_total_past_due_subscriptions!s}, " + f"total_unpaid_subscriptions={_total_unpaid_subscriptions!s}, " + f"total_dunning_subscriptions={_total_dunning_subscriptions!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/site_summary.py b/advancedbilling/models/site_summary.py index e72e7e51..737b2673 100644 --- a/advancedbilling/models/site_summary.py +++ b/advancedbilling/models/site_summary.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.site_statistics import SiteStatistics +from advancedbilling.models.site_statistics import ( + SiteStatistics, +) class SiteSummary(object): - """Implementation of the 'Site Summary' model. Attributes: @@ -20,48 +20,48 @@ class SiteSummary(object): site_id (int): The model property of type int. site_currency (str): The model property of type str. stats (SiteStatistics): The model property of type SiteStatistics. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "seller_name": 'seller_name', - "site_name": 'site_name', - "site_id": 'site_id', - "site_currency": 'site_currency', - "stats": 'stats' + "seller_name": "seller_name", + "site_name": "site_name", + "site_id": "site_id", + "site_currency": "site_currency", + "stats": "stats", } _optionals = [ - 'seller_name', - 'site_name', - 'site_id', - 'site_currency', - 'stats', + "seller_name", + "site_name", + "site_id", + "site_currency", + "stats", ] - def __init__(self, - seller_name=APIHelper.SKIP, - site_name=APIHelper.SKIP, - site_id=APIHelper.SKIP, - site_currency=APIHelper.SKIP, - stats=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SiteSummary class""" - + def __init__( + self, + seller_name=APIHelper.SKIP, + site_name=APIHelper.SKIP, + site_id=APIHelper.SKIP, + site_currency=APIHelper.SKIP, + stats=APIHelper.SKIP, + additional_properties=None): + """Initialize a SiteSummary instance.""" # Initialize members of the class if seller_name is not APIHelper.SKIP: - self.seller_name = seller_name + self.seller_name = seller_name if site_name is not APIHelper.SKIP: - self.site_name = site_name + self.site_name = site_name if site_id is not APIHelper.SKIP: - self.site_id = site_id + self.site_id = site_id if site_currency is not APIHelper.SKIP: - self.site_currency = site_currency + self.site_currency = site_currency if stats is not APIHelper.SKIP: - self.stats = stats + self.stats = stats # Add additional model properties to the instance if additional_properties is None: @@ -71,7 +71,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -82,18 +82,36 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - seller_name = dictionary.get("seller_name") if dictionary.get("seller_name") else APIHelper.SKIP - site_name = dictionary.get("site_name") if dictionary.get("site_name") else APIHelper.SKIP - site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP - site_currency = dictionary.get("site_currency") if dictionary.get("site_currency") else APIHelper.SKIP - stats = SiteStatistics.from_dictionary(dictionary.get('stats')) if 'stats' in dictionary.keys() else APIHelper.SKIP + seller_name =\ + dictionary.get("seller_name")\ + if dictionary.get("seller_name")\ + else APIHelper.SKIP + site_name =\ + dictionary.get("site_name")\ + if dictionary.get("site_name")\ + else APIHelper.SKIP + site_id =\ + dictionary.get("site_id")\ + if dictionary.get("site_id")\ + else APIHelper.SKIP + site_currency =\ + dictionary.get("site_currency")\ + if dictionary.get("site_currency")\ + else APIHelper.SKIP + stats =\ + SiteStatistics.from_dictionary( + dictionary.get("stats"))\ + if "stats" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(seller_name, site_name, @@ -103,19 +121,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'seller_name={(self.seller_name if hasattr(self, "seller_name") else None)!r}, ' - f'site_name={(self.site_name if hasattr(self, "site_name") else None)!r}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!r}, ' - f'site_currency={(self.site_currency if hasattr(self, "site_currency") else None)!r}, ' - f'stats={(self.stats if hasattr(self, "stats") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _seller_name=( + self.seller_name + if hasattr(self, "seller_name") + else None + ) + _site_name=( + self.site_name + if hasattr(self, "site_name") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _site_currency=( + self.site_currency + if hasattr(self, "site_currency") + else None + ) + _stats=( + self.stats + if hasattr(self, "stats") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"seller_name={_seller_name!r}, " + f"site_name={_site_name!r}, " + f"site_id={_site_id!r}, " + f"site_currency={_site_currency!r}, " + f"stats={_stats!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'seller_name={(self.seller_name if hasattr(self, "seller_name") else None)!s}, ' - f'site_name={(self.site_name if hasattr(self, "site_name") else None)!s}, ' - f'site_id={(self.site_id if hasattr(self, "site_id") else None)!s}, ' - f'site_currency={(self.site_currency if hasattr(self, "site_currency") else None)!s}, ' - f'stats={(self.stats if hasattr(self, "stats") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _seller_name=( + self.seller_name + if hasattr(self, "seller_name") + else None + ) + _site_name=( + self.site_name + if hasattr(self, "site_name") + else None + ) + _site_id=( + self.site_id + if hasattr(self, "site_id") + else None + ) + _site_currency=( + self.site_currency + if hasattr(self, "site_currency") + else None + ) + _stats=( + self.stats + if hasattr(self, "stats") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"seller_name={_seller_name!s}, " + f"site_name={_site_name!s}, " + f"site_id={_site_id!s}, " + f"site_currency={_site_currency!s}, " + f"stats={_stats!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/snap_day.py b/advancedbilling/models/snap_day.py index 16f3f01b..0e0bae54 100644 --- a/advancedbilling/models/snap_day.py +++ b/advancedbilling/models/snap_day.py @@ -1,29 +1,27 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SnapDay(object): - """Implementation of the 'SnapDay' enum. Attributes: END: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['end'] - END = 'end' + + _all_values = ["end"] + END = "end" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -33,9 +31,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/sorting_direction.py b/advancedbilling/models/sorting_direction.py index 2f223fad..d5b1fab1 100644 --- a/advancedbilling/models/sorting_direction.py +++ b/advancedbilling/models/sorting_direction.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SortingDirection(object): - """Implementation of the 'Sorting direction' enum. Used for sorting results. @@ -17,16 +14,18 @@ class SortingDirection(object): Attributes: ASC: The enum member of type str. DESC: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - ASC = 'asc' - DESC = 'desc' + ASC = "asc" + + DESC = "desc" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/status.py b/advancedbilling/models/status.py new file mode 100644 index 00000000..53cf2ea1 --- /dev/null +++ b/advancedbilling/models/status.py @@ -0,0 +1,58 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class Status(object): + """Implementation of the 'status' enum. + + Attributes: + DRAFT: The enum member of type str. + SCHEDULED: The enum member of type str. + PENDING: The enum member of type str. + CANCELED: The enum member of type str. + ACTIVE: The enum member of type str. + FULFILLED: The enum member of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + DRAFT = "draft" + + SCHEDULED = "scheduled" + + PENDING = "pending" + + CANCELED = "canceled" + + ACTIVE = "active" + + FULFILLED = "fulfilled" + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/advancedbilling/models/subscription.py b/advancedbilling/models/subscription.py index d1dd9e45..b825a03c 100644 --- a/advancedbilling/models/subscription.py +++ b/advancedbilling/models/subscription.py @@ -1,158 +1,156 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.bank_account_payment_profile import BankAccountPaymentProfile -from advancedbilling.models.credit_card_payment_profile import CreditCardPaymentProfile -from advancedbilling.models.customer import Customer -from advancedbilling.models.nested_subscription_group import NestedSubscriptionGroup -from advancedbilling.models.prepaid_configuration import PrepaidConfiguration +from advancedbilling.models.bank_account_payment_profile import ( + BankAccountPaymentProfile, +) +from advancedbilling.models.credit_card_payment_profile import ( + CreditCardPaymentProfile, +) +from advancedbilling.models.customer import ( + Customer, +) +from advancedbilling.models.nested_subscription_group import ( + NestedSubscriptionGroup, +) +from advancedbilling.models.prepaid_configuration import ( + PrepaidConfiguration, +) from advancedbilling.models.product import Product -from advancedbilling.models.subscription_included_coupon import SubscriptionIncludedCoupon +from advancedbilling.models.subscription_included_coupon import ( + SubscriptionIncludedCoupon, +) class Subscription(object): - """Implementation of the 'Subscription' model. Attributes: id (int): The subscription unique id within Chargify. - state (SubscriptionState): The state of a subscription. * **Live - States** * `active` - A normal, active subscription. It is not - in a trial and is paid and up to date. * `assessing` - An - internal (transient) state that indicates a subscription is in the - middle of periodic assessment. Do not base any access decisions in - your app on this state, as it may not always be exposed. * - `pending` - An internal (transient) state that indicates a - subscription is in the creation process. Do not base any access - decisions in your app on this state, as it may not always be - exposed. * `trialing` - A subscription in trialing state has a - valid trial subscription. This type of subscription may transition - to active once payment is received when the trial has ended. - Otherwise, it may go to a Problem or End of Life state. * - `paused` - An internal state that indicates that your account with - Advanced Billing is in arrears. * **Problem States** * - `past_due` - Indicates that the most recent payment has failed, - and payment is past due for this subscription. If you have enabled - our automated dunning, this subscription will be in the dunning - process (additional status and callbacks from the dunning process - will be available in the future). If you are handling dunning and - payment updates yourself, you will want to use this state to - initiate a payment update from your customers. * - `soft_failure` - Indicates that normal assessment/processing of - the subscription has failed for a reason that cannot be fixed by - the Customer. For example, a Soft Fail may result from a timeout - at the gateway or incorrect credentials on your part. The - subscriptions should be retried automatically. An interface is - being built for you to review problems resulting from these events - to take manual action when needed. * `unpaid` - Indicates an - unpaid subscription. A subscription is marked unpaid if the retry - period expires and you have configured your - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) settings to have a Final Action of `mark the - subscription unpaid`. * **End of Life States** * `canceled` - - Indicates a canceled subscription. This may happen at your request - (via the API or the web interface) or due to the expiration of the - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) process without payment. See the - [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109 - 503629-Reactivating-and-Resuming) documentation for info on how to - restart a canceled subscription. While a subscription is - canceled, its period will not advance, it will not accrue any new - charges, and Advanced Billing will not attempt to collect the - overdue balance. * `expired` - Indicates a subscription that - has expired due to running its normal life cycle. Some products - may be configured to have an expiration period. An expired - subscription then is one that stayed active until it fulfilled its - full period. * `failed_to_create` - Indicates that signup has - failed. (You may see this state in a signup_failure webhook.) - * `on_hold` - Indicates that a subscription’s billing has been - temporarily stopped. While it is expected that the subscription - will resume and return to active status, this is still treated as - an “End of Life” state because the customer is not paying for - services during this time. * `suspended` - Indicates that a - prepaid subscription has used up all their prepayment balance. If - a prepayment is applied, it will return to an active state. * - `trial_ended` - A subscription in a trial_ended state is a - subscription that completed a no-obligation trial and did not have - a card on file at the expiration of the trial period. See [Product - Pricing – No Obligation - Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869- - Product-Editing) for more details. See [Subscription - States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853- - Subscription-States) for more info about subscription states and - state transitions. - balance_in_cents (int): Gives the current outstanding subscription - balance in the number of cents. - total_revenue_in_cents (int): Gives the total revenue from the - subscription in the number of cents. - product_price_in_cents (int): (Added Nov 5 2013) The recurring amount - of the product (and version),currently subscribed. NOTE: this may - differ from the current price of,the product, if you’ve changed - the price of the product but haven’t,moved this subscription to a - newer version. + state (SubscriptionState): The state of a subscription. * **Live States** + * `active` - A normal, active subscription. It is not in a trial and is + paid and up to date. * `assessing` - An internal (transient) state + that indicates a subscription is in the middle of periodic assessment. Do + not base any access decisions in your app on this state, as it may not + always be exposed. * `pending` - An internal (transient) state that + indicates a subscription is in the creation process. Do not base any + access decisions in your app on this state, as it may not always be + exposed. * `trialing` - A subscription in trialing state has a valid + trial subscription. This type of subscription may transition to active + once payment is received when the trial has ended. Otherwise, it may go + to a Problem or End of Life state. * `paused` - An internal state + that indicates that your account with Advanced Billing is in arrears. * + **Problem States** * `past_due` - Indicates that the most recent + payment has failed, and payment is past due for this subscription. If you + have enabled our automated dunning, this subscription will be in the + dunning process (additional status and callbacks from the dunning process + will be available in the future). If you are handling dunning and payment + updates yourself, you will want to use this state to initiate a payment + update from your customers. * `soft_failure` - Indicates that normal + assessment/processing of the subscription has failed for a reason that + cannot be fixed by the Customer. For example, a Soft Fail may result from + a timeout at the gateway or incorrect credentials on your part. The + subscriptions should be retried automatically. An interface is being + built for you to review problems resulting from these events to take + manual action when needed. * `unpaid` - Indicates an unpaid + subscription. A subscription is marked unpaid if the retry period expires + and you have configured your + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) settings to have a Final Action of `mark the subscription + unpaid`. * **End of Life States** * `canceled` - Indicates a canceled + subscription. This may happen at your request (via the API or the web + interface) or due to the expiration of the + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) process without payment. See the + [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629- + Reactivating-and-Resuming) documentation for info on how to restart a + canceled subscription. While a subscription is canceled, its period + will not advance, it will not accrue any new charges, and Advanced + Billing will not attempt to collect the overdue balance. * `expired` + - Indicates a subscription that has expired due to running its normal + life cycle. Some products may be configured to have an expiration period. + An expired subscription then is one that stayed active until it fulfilled + its full period. * `failed_to_create` - Indicates that signup has + failed. (You may see this state in a signup_failure webhook.) * + `on_hold` - Indicates that a subscription’s billing has been temporarily + stopped. While it is expected that the subscription will resume and + return to active status, this is still treated as an “End of Life” state + because the customer is not paying for services during this time. * + `suspended` - Indicates that a prepaid subscription has used up all their + prepayment balance. If a prepayment is applied, it will return to an + active state. * `trial_ended` - A subscription in a trial_ended state + is a subscription that completed a no-obligation trial and did not have a + card on file at the expiration of the trial period. See [Product Pricing + – No Obligation + Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product + -Editing) for more details. See [Subscription + States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri + ption-States) for more info about subscription states and state + transitions. + balance_in_cents (int): Gives the current outstanding subscription balance in + the number of cents. + total_revenue_in_cents (int): Gives the total revenue from the subscription + in the number of cents. + product_price_in_cents (int): (Added Nov 5 2013) The recurring amount of the + product (and version),currently subscribed. NOTE: this may differ from + the current price of,the product, if you’ve changed the price of the + product but haven’t,moved this subscription to a newer version. product_version_number (int): The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. - current_period_ends_at (datetime): Timestamp relating to the end of - the current (recurring) period (i.e.,when the next regularly - scheduled attempted charge will occur) - next_assessment_at (datetime): Timestamp that indicates when capture - of payment will be tried or,retried. This value will usually track - the current_period_ends_at, but,will diverge if a renewal payment - fails and must be retried. In that,case, the - current_period_ends_at will advance to the end of the next,period - (time doesn’t stop because a payment was missed) but - the,next_assessment_at will be scheduled for the auto-retry time - (i.e. 24,hours in the future, in some cases) - trial_started_at (datetime): Timestamp for when the trial period (if - any) began - trial_ended_at (datetime): Timestamp for when the trial period (if - any) ended - activated_at (datetime): Timestamp for when the subscription began - (i.e. when it came out of trial, or when it began in the case of - no trial) + current_period_ends_at (datetime): Timestamp relating to the end of the + current (recurring) period (i.e.,when the next regularly scheduled + attempted charge will occur) + next_assessment_at (datetime): Timestamp that indicates when capture of + payment will be tried or,retried. This value will usually track the + current_period_ends_at, but,will diverge if a renewal payment fails and + must be retried. In that,case, the current_period_ends_at will advance to + the end of the next,period (time doesn’t stop because a payment was + missed) but the,next_assessment_at will be scheduled for the auto-retry + time (i.e. 24,hours in the future, in some cases) + trial_started_at (datetime): Timestamp for when the trial period (if any) + began + trial_ended_at (datetime): Timestamp for when the trial period (if any) ended + activated_at (datetime): Timestamp for when the subscription began (i.e. when + it came out of trial, or when it began in the case of no trial) expires_at (datetime): Timestamp giving the expiration date of this subscription (if any) created_at (datetime): The creation date for this subscription updated_at (datetime): The date of last update for this subscription - cancellation_message (str): Seller-provided reason for, or note about, - the cancellation. - cancellation_method (CancellationMethod): The process used to cancel - the subscription, if the subscription has been canceled. It is nil - if the subscription's state is not canceled. - cancel_at_end_of_period (bool): Whether or not the subscription will - (or has) canceled at the end of the period. + cancellation_message (str): Seller-provided reason for, or note about, the + cancellation. + cancellation_method (CancellationMethod): The process used to cancel the + subscription, if the subscription has been canceled. It is nil if the + subscription's state is not canceled. + cancel_at_end_of_period (bool): Whether or not the subscription will (or has) + canceled at the end of the period. canceled_at (datetime): The timestamp of the most recent cancellation - current_period_started_at (datetime): Timestamp relating to the start - of the current (recurring) period - previous_state (SubscriptionState): Only valid for webhook payloads - The previous state for webhooks that have indicated a change in - state. For normal API calls, this will always be the same as the - state (current state) - signup_payment_id (int): The ID of the transaction that generated the - revenue - signup_revenue (str): The revenue, formatted as a string of decimal - separated dollars and,cents, from the subscription signup ($50.00 - would be formatted as,50.00) + current_period_started_at (datetime): Timestamp relating to the start of the + current (recurring) period + previous_state (SubscriptionState): Only valid for webhook payloads The + previous state for webhooks that have indicated a change in state. For + normal API calls, this will always be the same as the state (current + state) + signup_payment_id (int): The ID of the transaction that generated the revenue + signup_revenue (str): The revenue, formatted as a string of decimal separated + dollars and,cents, from the subscription signup ($50.00 would be + formatted as,50.00) delayed_cancel_at (datetime): Timestamp for when the subscription is currently set to cancel. coupon_code (str): (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. - snap_day (int | SnapDay | None): The day of the month that the - subscription will charge according to calendar billing rules, if - used. - payment_collection_method (CollectionMethod): The type of payment - collection to be used in the subscription. For legacy Statements - Architecture valid options are - `invoice`, `automatic`. For - current Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. + snap_day (int | SnapDay | None): The day of the month that the subscription + will charge according to calendar billing rules, if used. + payment_collection_method (CollectionMethod): The type of payment collection + to be used in the subscription. For legacy Statements Architecture valid + options are - `invoice`, `automatic`. For current Relationship Invoicing + Architecture valid options are - `remittance`, `automatic`, `prepaid`. customer (Customer): The model property of type Customer. product (Product): The model property of type Product. credit_card (CreditCardPaymentProfile): The model property of type @@ -161,444 +159,482 @@ class Subscription(object): NestedSubscriptionGroup. bank_account (BankAccountPaymentProfile): The model property of type BankAccountPaymentProfile. - payment_type (str): The payment profile type for the active profile on - file. - referral_code (str): The subscription's unique code that can be given - to referrals. - next_product_id (int): If a delayed product change is scheduled, the - ID of the product that the subscription will be changed to at the + payment_type (str): The payment profile type for the active profile on file. + referral_code (str): The subscription's unique code that can be given to + referrals. + next_product_id (int): If a delayed product change is scheduled, the ID of + the product that the subscription will be changed to at the next renewal. + next_product_handle (str): If a delayed product change is scheduled, the + handle of the product that the subscription will be changed to at the next renewal. - next_product_handle (str): If a delayed product change is scheduled, - the handle of the product that the subscription will be changed to - at the next renewal. - coupon_use_count (int): (deprecated) How many times the subscription's - single coupon has been used. This field has no replacement for - multiple coupons. - coupon_uses_allowed (int): (deprecated) How many times the - subscription's single coupon may be used. This field has no - replacement for multiple coupons. - reason_code (str): If the subscription is canceled, this is their - churn code. - automatically_resume_at (datetime): The date the subscription is - scheduled to automatically resume from the on_hold state. + coupon_use_count (int): (deprecated) How many times the subscription's single + coupon has been used. This field has no replacement for multiple coupons. + coupon_uses_allowed (int): (deprecated) How many times the subscription's + single coupon may be used. This field has no replacement for multiple + coupons. + reason_code (str): The churn reason code associated to a cancelled + subscription. + automatically_resume_at (datetime): The date the subscription is scheduled to + automatically resume from the on_hold state. coupon_codes (List[str]): An array for all the coupons attached to the subscription. offer_id (int): The ID of the offer associated with the subscription. - payer_id (int): On Relationship Invoicing, the ID of the individual - paying for the subscription. Defaults to the Customer ID unless - the 'Customer Hierarchies & WhoPays' feature is enabled. + payer_id (int): On Relationship Invoicing, the ID of the individual paying + for the subscription. Defaults to the Customer ID unless the 'Customer + Hierarchies & WhoPays' feature is enabled. current_billing_amount_in_cents (int): The balance in cents plus the - estimated renewal amount in cents. Returned ONLY for the - readSubscription operation as it's a compute intensive operation. - product_price_point_id (int): The product price point currently - subscribed to. - product_price_point_type (PricePointType): Price point type. We expose - the following types: 1. **default**: a price point that is marked - as a default price for a certain product. 2. **custom**: a custom - price point. 3. **catalog**: a price point that is **not** marked - as a default price for a certain product and is **not** a custom - one. - next_product_price_point_id (int): If a delayed product change is - scheduled, the ID of the product price point that the subscription - will be changed to at the next renewal. - net_terms (int): On Relationship Invoicing, the number of days before - a renewal invoice is due. - stored_credential_transaction_id (int): For European sites subject to - PSD2 and using 3D Secure, this can be used to reference a previous - transaction for the customer. This will ensure the card will be - charged successfully at renewal. + estimated renewal amount in cents. Returned ONLY for the readSubscription + operation as it's a compute intensive operation. + product_price_point_id (int): The product price point currently subscribed to. + product_price_point_type (PricePointType): Price point type. We expose the + following types: 1. **default**: a price point that is marked as a + default price for a certain product. 2. **custom**: a custom price point. + 3. **catalog**: a price point that is **not** marked as a default price + for a certain product and is **not** a custom one. + next_product_price_point_id (int): If a delayed product change is scheduled, + the ID of the product price point that the subscription will be changed + to at the next renewal. + net_terms (int): On Relationship Invoicing, the number of days before a + renewal invoice is due. + stored_credential_transaction_id (int): For European sites subject to PSD2 + and using 3D Secure, this can be used to reference a previous transaction + for the customer. This will ensure the card will be charged successfully + at renewal. reference (str): The reference value (provided by your app) for the - subscription itelf. + subscription istelf. on_hold_at (datetime): The timestamp of the most recent on hold action. - prepaid_dunning (bool): Boolean representing whether the subscription - is prepaid and currently in dunning. Only returned for - Relationship Invoicing sites with the feature enabled - coupons (List[SubscriptionIncludedCoupon]): Additional coupon data. To - use this data you also have to include the following param in the + prepaid_dunning (bool): Boolean representing whether the subscription is + prepaid and currently in dunning. Only returned for Relationship + Invoicing sites with the feature enabled + coupons (List[SubscriptionIncludedCoupon]): Additional coupon data. To use + this data you also have to include the following param in the request`include[]=coupons`. Only in Read Subscription Endpoint. dunning_communication_delay_enabled (bool): Enable Communication Delay - feature, making sure no communication (email or SMS) is sent to - the Customer between 9PM and 8AM in time zone set by the + feature, making sure no communication (email or SMS) is sent to the + Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. dunning_communication_delay_time_zone (str): Time zone for the Dunning Communication Delay feature. receives_invoice_emails (bool): The model property of type bool. locale (str): The model property of type str. currency (str): The model property of type str. - scheduled_cancellation_at (datetime): The model property of type - datetime. + scheduled_cancellation_at (datetime): The model property of type datetime. credit_balance_in_cents (int): The model property of type int. prepayment_balance_in_cents (int): The model property of type int. - prepaid_configuration (PrepaidConfiguration): The model property of - type PrepaidConfiguration. - self_service_page_token (str): Returned only for list/read - Subscription operation when `include[]=self_service_page_token` - parameter is provided. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepaid_configuration (PrepaidConfiguration): The model property of type + PrepaidConfiguration. + self_service_page_token (str): Returned only for list/read Subscription + operation when `include[]=self_service_page_token` parameter is provided. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "state": 'state', - "balance_in_cents": 'balance_in_cents', - "total_revenue_in_cents": 'total_revenue_in_cents', - "product_price_in_cents": 'product_price_in_cents', - "product_version_number": 'product_version_number', - "current_period_ends_at": 'current_period_ends_at', - "next_assessment_at": 'next_assessment_at', - "trial_started_at": 'trial_started_at', - "trial_ended_at": 'trial_ended_at', - "activated_at": 'activated_at', - "expires_at": 'expires_at', - "created_at": 'created_at', - "updated_at": 'updated_at', - "cancellation_message": 'cancellation_message', - "cancellation_method": 'cancellation_method', - "cancel_at_end_of_period": 'cancel_at_end_of_period', - "canceled_at": 'canceled_at', - "current_period_started_at": 'current_period_started_at', - "previous_state": 'previous_state', - "signup_payment_id": 'signup_payment_id', - "signup_revenue": 'signup_revenue', - "delayed_cancel_at": 'delayed_cancel_at', - "coupon_code": 'coupon_code', - "snap_day": 'snap_day', - "payment_collection_method": 'payment_collection_method', - "customer": 'customer', - "product": 'product', - "credit_card": 'credit_card', - "group": 'group', - "bank_account": 'bank_account', - "payment_type": 'payment_type', - "referral_code": 'referral_code', - "next_product_id": 'next_product_id', - "next_product_handle": 'next_product_handle', - "coupon_use_count": 'coupon_use_count', - "coupon_uses_allowed": 'coupon_uses_allowed', - "reason_code": 'reason_code', - "automatically_resume_at": 'automatically_resume_at', - "coupon_codes": 'coupon_codes', - "offer_id": 'offer_id', - "payer_id": 'payer_id', - "current_billing_amount_in_cents": 'current_billing_amount_in_cents', - "product_price_point_id": 'product_price_point_id', - "product_price_point_type": 'product_price_point_type', - "next_product_price_point_id": 'next_product_price_point_id', - "net_terms": 'net_terms', - "stored_credential_transaction_id": 'stored_credential_transaction_id', - "reference": 'reference', - "on_hold_at": 'on_hold_at', - "prepaid_dunning": 'prepaid_dunning', - "coupons": 'coupons', - "dunning_communication_delay_enabled": 'dunning_communication_delay_enabled', - "dunning_communication_delay_time_zone": 'dunning_communication_delay_time_zone', - "receives_invoice_emails": 'receives_invoice_emails', - "locale": 'locale', - "currency": 'currency', - "scheduled_cancellation_at": 'scheduled_cancellation_at', - "credit_balance_in_cents": 'credit_balance_in_cents', - "prepayment_balance_in_cents": 'prepayment_balance_in_cents', - "prepaid_configuration": 'prepaid_configuration', - "self_service_page_token": 'self_service_page_token' + "id": "id", + "state": "state", + "balance_in_cents": "balance_in_cents", + "total_revenue_in_cents": "total_revenue_in_cents", + "product_price_in_cents": "product_price_in_cents", + "product_version_number": "product_version_number", + "current_period_ends_at": "current_period_ends_at", + "next_assessment_at": "next_assessment_at", + "trial_started_at": "trial_started_at", + "trial_ended_at": "trial_ended_at", + "activated_at": "activated_at", + "expires_at": "expires_at", + "created_at": "created_at", + "updated_at": "updated_at", + "cancellation_message": "cancellation_message", + "cancellation_method": "cancellation_method", + "cancel_at_end_of_period": "cancel_at_end_of_period", + "canceled_at": "canceled_at", + "current_period_started_at": "current_period_started_at", + "previous_state": "previous_state", + "signup_payment_id": "signup_payment_id", + "signup_revenue": "signup_revenue", + "delayed_cancel_at": "delayed_cancel_at", + "coupon_code": "coupon_code", + "snap_day": "snap_day", + "payment_collection_method": "payment_collection_method", + "customer": "customer", + "product": "product", + "credit_card": "credit_card", + "group": "group", + "bank_account": "bank_account", + "payment_type": "payment_type", + "referral_code": "referral_code", + "next_product_id": "next_product_id", + "next_product_handle": "next_product_handle", + "coupon_use_count": "coupon_use_count", + "coupon_uses_allowed": "coupon_uses_allowed", + "reason_code": "reason_code", + "automatically_resume_at": "automatically_resume_at", + "coupon_codes": "coupon_codes", + "offer_id": "offer_id", + "payer_id": "payer_id", + "current_billing_amount_in_cents": "current_billing_amount_in_cents", + "product_price_point_id": "product_price_point_id", + "product_price_point_type": "product_price_point_type", + "next_product_price_point_id": "next_product_price_point_id", + "net_terms": "net_terms", + "stored_credential_transaction_id": "stored_credential_transaction_id", + "reference": "reference", + "on_hold_at": "on_hold_at", + "prepaid_dunning": "prepaid_dunning", + "coupons": "coupons", + "dunning_communication_delay_enabled": "dunning_communication_delay_enabled", + "dunning_communication_delay_time_zone": + "dunning_communication_delay_time_zone", + "receives_invoice_emails": "receives_invoice_emails", + "locale": "locale", + "currency": "currency", + "scheduled_cancellation_at": "scheduled_cancellation_at", + "credit_balance_in_cents": "credit_balance_in_cents", + "prepayment_balance_in_cents": "prepayment_balance_in_cents", + "prepaid_configuration": "prepaid_configuration", + "self_service_page_token": "self_service_page_token", } _optionals = [ - 'id', - 'state', - 'balance_in_cents', - 'total_revenue_in_cents', - 'product_price_in_cents', - 'product_version_number', - 'current_period_ends_at', - 'next_assessment_at', - 'trial_started_at', - 'trial_ended_at', - 'activated_at', - 'expires_at', - 'created_at', - 'updated_at', - 'cancellation_message', - 'cancellation_method', - 'cancel_at_end_of_period', - 'canceled_at', - 'current_period_started_at', - 'previous_state', - 'signup_payment_id', - 'signup_revenue', - 'delayed_cancel_at', - 'coupon_code', - 'snap_day', - 'payment_collection_method', - 'customer', - 'product', - 'credit_card', - 'group', - 'bank_account', - 'payment_type', - 'referral_code', - 'next_product_id', - 'next_product_handle', - 'coupon_use_count', - 'coupon_uses_allowed', - 'reason_code', - 'automatically_resume_at', - 'coupon_codes', - 'offer_id', - 'payer_id', - 'current_billing_amount_in_cents', - 'product_price_point_id', - 'product_price_point_type', - 'next_product_price_point_id', - 'net_terms', - 'stored_credential_transaction_id', - 'reference', - 'on_hold_at', - 'prepaid_dunning', - 'coupons', - 'dunning_communication_delay_enabled', - 'dunning_communication_delay_time_zone', - 'receives_invoice_emails', - 'locale', - 'currency', - 'scheduled_cancellation_at', - 'credit_balance_in_cents', - 'prepayment_balance_in_cents', - 'prepaid_configuration', - 'self_service_page_token', + "id", + "state", + "balance_in_cents", + "total_revenue_in_cents", + "product_price_in_cents", + "product_version_number", + "current_period_ends_at", + "next_assessment_at", + "trial_started_at", + "trial_ended_at", + "activated_at", + "expires_at", + "created_at", + "updated_at", + "cancellation_message", + "cancellation_method", + "cancel_at_end_of_period", + "canceled_at", + "current_period_started_at", + "previous_state", + "signup_payment_id", + "signup_revenue", + "delayed_cancel_at", + "coupon_code", + "snap_day", + "payment_collection_method", + "customer", + "product", + "credit_card", + "group", + "bank_account", + "payment_type", + "referral_code", + "next_product_id", + "next_product_handle", + "coupon_use_count", + "coupon_uses_allowed", + "reason_code", + "automatically_resume_at", + "coupon_codes", + "offer_id", + "payer_id", + "current_billing_amount_in_cents", + "product_price_point_id", + "product_price_point_type", + "next_product_price_point_id", + "net_terms", + "stored_credential_transaction_id", + "reference", + "on_hold_at", + "prepaid_dunning", + "coupons", + "dunning_communication_delay_enabled", + "dunning_communication_delay_time_zone", + "receives_invoice_emails", + "locale", + "currency", + "scheduled_cancellation_at", + "credit_balance_in_cents", + "prepayment_balance_in_cents", + "prepaid_configuration", + "self_service_page_token", ] _nullables = [ - 'current_period_ends_at', - 'next_assessment_at', - 'trial_started_at', - 'trial_ended_at', - 'activated_at', - 'expires_at', - 'cancellation_message', - 'cancellation_method', - 'cancel_at_end_of_period', - 'canceled_at', - 'current_period_started_at', - 'delayed_cancel_at', - 'coupon_code', - 'snap_day', - 'group', - 'payment_type', - 'referral_code', - 'next_product_id', - 'next_product_handle', - 'coupon_use_count', - 'coupon_uses_allowed', - 'reason_code', - 'automatically_resume_at', - 'offer_id', - 'payer_id', - 'next_product_price_point_id', - 'net_terms', - 'stored_credential_transaction_id', - 'reference', - 'on_hold_at', - 'dunning_communication_delay_time_zone', - 'receives_invoice_emails', - 'locale', - 'scheduled_cancellation_at', - 'prepaid_configuration', + "current_period_ends_at", + "next_assessment_at", + "trial_started_at", + "trial_ended_at", + "activated_at", + "expires_at", + "cancellation_message", + "cancellation_method", + "cancel_at_end_of_period", + "canceled_at", + "current_period_started_at", + "delayed_cancel_at", + "coupon_code", + "snap_day", + "group", + "payment_type", + "referral_code", + "next_product_id", + "next_product_handle", + "coupon_use_count", + "coupon_uses_allowed", + "reason_code", + "automatically_resume_at", + "offer_id", + "payer_id", + "next_product_price_point_id", + "net_terms", + "stored_credential_transaction_id", + "reference", + "on_hold_at", + "dunning_communication_delay_time_zone", + "receives_invoice_emails", + "locale", + "scheduled_cancellation_at", + "prepaid_configuration", ] - def __init__(self, - id=APIHelper.SKIP, - state=APIHelper.SKIP, - balance_in_cents=APIHelper.SKIP, - total_revenue_in_cents=APIHelper.SKIP, - product_price_in_cents=APIHelper.SKIP, - product_version_number=APIHelper.SKIP, - current_period_ends_at=APIHelper.SKIP, - next_assessment_at=APIHelper.SKIP, - trial_started_at=APIHelper.SKIP, - trial_ended_at=APIHelper.SKIP, - activated_at=APIHelper.SKIP, - expires_at=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - cancellation_message=APIHelper.SKIP, - cancellation_method=APIHelper.SKIP, - cancel_at_end_of_period=APIHelper.SKIP, - canceled_at=APIHelper.SKIP, - current_period_started_at=APIHelper.SKIP, - previous_state=APIHelper.SKIP, - signup_payment_id=APIHelper.SKIP, - signup_revenue=APIHelper.SKIP, - delayed_cancel_at=APIHelper.SKIP, - coupon_code=APIHelper.SKIP, - snap_day=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - customer=APIHelper.SKIP, - product=APIHelper.SKIP, - credit_card=APIHelper.SKIP, - group=APIHelper.SKIP, - bank_account=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - referral_code=APIHelper.SKIP, - next_product_id=APIHelper.SKIP, - next_product_handle=APIHelper.SKIP, - coupon_use_count=APIHelper.SKIP, - coupon_uses_allowed=APIHelper.SKIP, - reason_code=APIHelper.SKIP, - automatically_resume_at=APIHelper.SKIP, - coupon_codes=APIHelper.SKIP, - offer_id=APIHelper.SKIP, - payer_id=APIHelper.SKIP, - current_billing_amount_in_cents=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - product_price_point_type=APIHelper.SKIP, - next_product_price_point_id=APIHelper.SKIP, - net_terms=APIHelper.SKIP, - stored_credential_transaction_id=APIHelper.SKIP, - reference=APIHelper.SKIP, - on_hold_at=APIHelper.SKIP, - prepaid_dunning=APIHelper.SKIP, - coupons=APIHelper.SKIP, - dunning_communication_delay_enabled=APIHelper.SKIP, - dunning_communication_delay_time_zone=APIHelper.SKIP, - receives_invoice_emails=APIHelper.SKIP, - locale=APIHelper.SKIP, - currency=APIHelper.SKIP, - scheduled_cancellation_at=APIHelper.SKIP, - credit_balance_in_cents=APIHelper.SKIP, - prepayment_balance_in_cents=APIHelper.SKIP, - prepaid_configuration=APIHelper.SKIP, - self_service_page_token=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Subscription class""" - + def __init__( + self, + id=APIHelper.SKIP, + state=APIHelper.SKIP, + balance_in_cents=APIHelper.SKIP, + total_revenue_in_cents=APIHelper.SKIP, + product_price_in_cents=APIHelper.SKIP, + product_version_number=APIHelper.SKIP, + current_period_ends_at=APIHelper.SKIP, + next_assessment_at=APIHelper.SKIP, + trial_started_at=APIHelper.SKIP, + trial_ended_at=APIHelper.SKIP, + activated_at=APIHelper.SKIP, + expires_at=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + cancellation_message=APIHelper.SKIP, + cancellation_method=APIHelper.SKIP, + cancel_at_end_of_period=APIHelper.SKIP, + canceled_at=APIHelper.SKIP, + current_period_started_at=APIHelper.SKIP, + previous_state=APIHelper.SKIP, + signup_payment_id=APIHelper.SKIP, + signup_revenue=APIHelper.SKIP, + delayed_cancel_at=APIHelper.SKIP, + coupon_code=APIHelper.SKIP, + snap_day=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + customer=APIHelper.SKIP, + product=APIHelper.SKIP, + credit_card=APIHelper.SKIP, + group=APIHelper.SKIP, + bank_account=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + referral_code=APIHelper.SKIP, + next_product_id=APIHelper.SKIP, + next_product_handle=APIHelper.SKIP, + coupon_use_count=APIHelper.SKIP, + coupon_uses_allowed=APIHelper.SKIP, + reason_code=APIHelper.SKIP, + automatically_resume_at=APIHelper.SKIP, + coupon_codes=APIHelper.SKIP, + offer_id=APIHelper.SKIP, + payer_id=APIHelper.SKIP, + current_billing_amount_in_cents=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + product_price_point_type=APIHelper.SKIP, + next_product_price_point_id=APIHelper.SKIP, + net_terms=APIHelper.SKIP, + stored_credential_transaction_id=APIHelper.SKIP, + reference=APIHelper.SKIP, + on_hold_at=APIHelper.SKIP, + prepaid_dunning=APIHelper.SKIP, + coupons=APIHelper.SKIP, + dunning_communication_delay_enabled=APIHelper.SKIP, + dunning_communication_delay_time_zone=APIHelper.SKIP, + receives_invoice_emails=APIHelper.SKIP, + locale=APIHelper.SKIP, + currency=APIHelper.SKIP, + scheduled_cancellation_at=APIHelper.SKIP, + credit_balance_in_cents=APIHelper.SKIP, + prepayment_balance_in_cents=APIHelper.SKIP, + prepaid_configuration=APIHelper.SKIP, + self_service_page_token=APIHelper.SKIP, + additional_properties=None): + """Initialize a Subscription instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if state is not APIHelper.SKIP: - self.state = state + self.state = state if balance_in_cents is not APIHelper.SKIP: - self.balance_in_cents = balance_in_cents + self.balance_in_cents = balance_in_cents if total_revenue_in_cents is not APIHelper.SKIP: - self.total_revenue_in_cents = total_revenue_in_cents + self.total_revenue_in_cents = total_revenue_in_cents if product_price_in_cents is not APIHelper.SKIP: - self.product_price_in_cents = product_price_in_cents + self.product_price_in_cents = product_price_in_cents if product_version_number is not APIHelper.SKIP: - self.product_version_number = product_version_number + self.product_version_number = product_version_number if current_period_ends_at is not APIHelper.SKIP: - self.current_period_ends_at = APIHelper.apply_datetime_converter(current_period_ends_at, APIHelper.RFC3339DateTime) if current_period_ends_at else None + self.current_period_ends_at =\ + APIHelper.apply_datetime_converter( + current_period_ends_at, APIHelper.RFC3339DateTime)\ + if current_period_ends_at else None if next_assessment_at is not APIHelper.SKIP: - self.next_assessment_at = APIHelper.apply_datetime_converter(next_assessment_at, APIHelper.RFC3339DateTime) if next_assessment_at else None + self.next_assessment_at =\ + APIHelper.apply_datetime_converter( + next_assessment_at, APIHelper.RFC3339DateTime)\ + if next_assessment_at else None if trial_started_at is not APIHelper.SKIP: - self.trial_started_at = APIHelper.apply_datetime_converter(trial_started_at, APIHelper.RFC3339DateTime) if trial_started_at else None + self.trial_started_at =\ + APIHelper.apply_datetime_converter( + trial_started_at, APIHelper.RFC3339DateTime)\ + if trial_started_at else None if trial_ended_at is not APIHelper.SKIP: - self.trial_ended_at = APIHelper.apply_datetime_converter(trial_ended_at, APIHelper.RFC3339DateTime) if trial_ended_at else None + self.trial_ended_at =\ + APIHelper.apply_datetime_converter( + trial_ended_at, APIHelper.RFC3339DateTime)\ + if trial_ended_at else None if activated_at is not APIHelper.SKIP: - self.activated_at = APIHelper.apply_datetime_converter(activated_at, APIHelper.RFC3339DateTime) if activated_at else None + self.activated_at =\ + APIHelper.apply_datetime_converter( + activated_at, APIHelper.RFC3339DateTime)\ + if activated_at else None if expires_at is not APIHelper.SKIP: - self.expires_at = APIHelper.apply_datetime_converter(expires_at, APIHelper.RFC3339DateTime) if expires_at else None + self.expires_at =\ + APIHelper.apply_datetime_converter( + expires_at, APIHelper.RFC3339DateTime)\ + if expires_at else None if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if cancellation_message is not APIHelper.SKIP: - self.cancellation_message = cancellation_message + self.cancellation_message = cancellation_message if cancellation_method is not APIHelper.SKIP: - self.cancellation_method = cancellation_method + self.cancellation_method = cancellation_method if cancel_at_end_of_period is not APIHelper.SKIP: - self.cancel_at_end_of_period = cancel_at_end_of_period + self.cancel_at_end_of_period = cancel_at_end_of_period if canceled_at is not APIHelper.SKIP: - self.canceled_at = APIHelper.apply_datetime_converter(canceled_at, APIHelper.RFC3339DateTime) if canceled_at else None + self.canceled_at =\ + APIHelper.apply_datetime_converter( + canceled_at, APIHelper.RFC3339DateTime)\ + if canceled_at else None if current_period_started_at is not APIHelper.SKIP: - self.current_period_started_at = APIHelper.apply_datetime_converter(current_period_started_at, APIHelper.RFC3339DateTime) if current_period_started_at else None + self.current_period_started_at =\ + APIHelper.apply_datetime_converter( + current_period_started_at, APIHelper.RFC3339DateTime)\ + if current_period_started_at else None if previous_state is not APIHelper.SKIP: - self.previous_state = previous_state + self.previous_state = previous_state if signup_payment_id is not APIHelper.SKIP: - self.signup_payment_id = signup_payment_id + self.signup_payment_id = signup_payment_id if signup_revenue is not APIHelper.SKIP: - self.signup_revenue = signup_revenue + self.signup_revenue = signup_revenue if delayed_cancel_at is not APIHelper.SKIP: - self.delayed_cancel_at = APIHelper.apply_datetime_converter(delayed_cancel_at, APIHelper.RFC3339DateTime) if delayed_cancel_at else None + self.delayed_cancel_at =\ + APIHelper.apply_datetime_converter( + delayed_cancel_at, APIHelper.RFC3339DateTime)\ + if delayed_cancel_at else None if coupon_code is not APIHelper.SKIP: - self.coupon_code = coupon_code + self.coupon_code = coupon_code if snap_day is not APIHelper.SKIP: - self.snap_day = snap_day + self.snap_day = snap_day if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method if customer is not APIHelper.SKIP: - self.customer = customer + self.customer = customer if product is not APIHelper.SKIP: - self.product = product + self.product = product if credit_card is not APIHelper.SKIP: - self.credit_card = credit_card + self.credit_card = credit_card if group is not APIHelper.SKIP: - self.group = group + self.group = group if bank_account is not APIHelper.SKIP: - self.bank_account = bank_account + self.bank_account = bank_account if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type + self.payment_type = payment_type if referral_code is not APIHelper.SKIP: - self.referral_code = referral_code + self.referral_code = referral_code if next_product_id is not APIHelper.SKIP: - self.next_product_id = next_product_id + self.next_product_id = next_product_id if next_product_handle is not APIHelper.SKIP: - self.next_product_handle = next_product_handle + self.next_product_handle = next_product_handle if coupon_use_count is not APIHelper.SKIP: - self.coupon_use_count = coupon_use_count + self.coupon_use_count = coupon_use_count if coupon_uses_allowed is not APIHelper.SKIP: - self.coupon_uses_allowed = coupon_uses_allowed + self.coupon_uses_allowed = coupon_uses_allowed if reason_code is not APIHelper.SKIP: - self.reason_code = reason_code + self.reason_code = reason_code if automatically_resume_at is not APIHelper.SKIP: - self.automatically_resume_at = APIHelper.apply_datetime_converter(automatically_resume_at, APIHelper.RFC3339DateTime) if automatically_resume_at else None + self.automatically_resume_at =\ + APIHelper.apply_datetime_converter( + automatically_resume_at, APIHelper.RFC3339DateTime)\ + if automatically_resume_at else None if coupon_codes is not APIHelper.SKIP: - self.coupon_codes = coupon_codes + self.coupon_codes = coupon_codes if offer_id is not APIHelper.SKIP: - self.offer_id = offer_id + self.offer_id = offer_id if payer_id is not APIHelper.SKIP: - self.payer_id = payer_id + self.payer_id = payer_id if current_billing_amount_in_cents is not APIHelper.SKIP: - self.current_billing_amount_in_cents = current_billing_amount_in_cents + self.current_billing_amount_in_cents = current_billing_amount_in_cents if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if product_price_point_type is not APIHelper.SKIP: - self.product_price_point_type = product_price_point_type + self.product_price_point_type = product_price_point_type if next_product_price_point_id is not APIHelper.SKIP: - self.next_product_price_point_id = next_product_price_point_id + self.next_product_price_point_id = next_product_price_point_id if net_terms is not APIHelper.SKIP: - self.net_terms = net_terms + self.net_terms = net_terms if stored_credential_transaction_id is not APIHelper.SKIP: - self.stored_credential_transaction_id = stored_credential_transaction_id + self.stored_credential_transaction_id = stored_credential_transaction_id if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if on_hold_at is not APIHelper.SKIP: - self.on_hold_at = APIHelper.apply_datetime_converter(on_hold_at, APIHelper.RFC3339DateTime) if on_hold_at else None + self.on_hold_at =\ + APIHelper.apply_datetime_converter( + on_hold_at, APIHelper.RFC3339DateTime)\ + if on_hold_at else None if prepaid_dunning is not APIHelper.SKIP: - self.prepaid_dunning = prepaid_dunning + self.prepaid_dunning = prepaid_dunning if coupons is not APIHelper.SKIP: - self.coupons = coupons + self.coupons = coupons if dunning_communication_delay_enabled is not APIHelper.SKIP: - self.dunning_communication_delay_enabled = dunning_communication_delay_enabled + self.dunning_communication_delay_enabled =\ + dunning_communication_delay_enabled if dunning_communication_delay_time_zone is not APIHelper.SKIP: - self.dunning_communication_delay_time_zone = dunning_communication_delay_time_zone + self.dunning_communication_delay_time_zone =\ + dunning_communication_delay_time_zone if receives_invoice_emails is not APIHelper.SKIP: - self.receives_invoice_emails = receives_invoice_emails + self.receives_invoice_emails = receives_invoice_emails if locale is not APIHelper.SKIP: - self.locale = locale + self.locale = locale if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if scheduled_cancellation_at is not APIHelper.SKIP: - self.scheduled_cancellation_at = APIHelper.apply_datetime_converter(scheduled_cancellation_at, APIHelper.RFC3339DateTime) if scheduled_cancellation_at else None + self.scheduled_cancellation_at =\ + APIHelper.apply_datetime_converter( + scheduled_cancellation_at, APIHelper.RFC3339DateTime)\ + if scheduled_cancellation_at else None if credit_balance_in_cents is not APIHelper.SKIP: - self.credit_balance_in_cents = credit_balance_in_cents + self.credit_balance_in_cents = credit_balance_in_cents if prepayment_balance_in_cents is not APIHelper.SKIP: - self.prepayment_balance_in_cents = prepayment_balance_in_cents + self.prepayment_balance_in_cents = prepayment_balance_in_cents if prepaid_configuration is not APIHelper.SKIP: - self.prepaid_configuration = prepaid_configuration + self.prepaid_configuration = prepaid_configuration if self_service_page_token is not APIHelper.SKIP: - self.self_service_page_token = self_service_page_token + self.self_service_page_token = self_service_page_token # Add additional model properties to the instance if additional_properties is None: @@ -608,7 +644,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -619,125 +655,320 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - balance_in_cents = dictionary.get("balance_in_cents") if dictionary.get("balance_in_cents") else APIHelper.SKIP - total_revenue_in_cents = dictionary.get("total_revenue_in_cents") if dictionary.get("total_revenue_in_cents") else APIHelper.SKIP - product_price_in_cents = dictionary.get("product_price_in_cents") if dictionary.get("product_price_in_cents") else APIHelper.SKIP - product_version_number = dictionary.get("product_version_number") if dictionary.get("product_version_number") else APIHelper.SKIP - if 'current_period_ends_at' in dictionary.keys(): - current_period_ends_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("current_period_ends_at")).datetime if dictionary.get("current_period_ends_at") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + balance_in_cents =\ + dictionary.get("balance_in_cents")\ + if dictionary.get("balance_in_cents")\ + else APIHelper.SKIP + total_revenue_in_cents =\ + dictionary.get("total_revenue_in_cents")\ + if dictionary.get("total_revenue_in_cents")\ + else APIHelper.SKIP + product_price_in_cents =\ + dictionary.get("product_price_in_cents")\ + if dictionary.get("product_price_in_cents")\ + else APIHelper.SKIP + product_version_number =\ + dictionary.get("product_version_number")\ + if dictionary.get("product_version_number")\ + else APIHelper.SKIP + if "current_period_ends_at" in dictionary.keys(): + current_period_ends_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("current_period_ends_at")).datetime\ + if dictionary.get("current_period_ends_at") else None + else: current_period_ends_at = APIHelper.SKIP - if 'next_assessment_at' in dictionary.keys(): - next_assessment_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_assessment_at")).datetime if dictionary.get("next_assessment_at") else None + if "next_assessment_at" in dictionary.keys(): + next_assessment_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_assessment_at")).datetime\ + if dictionary.get("next_assessment_at") else None + else: next_assessment_at = APIHelper.SKIP - if 'trial_started_at' in dictionary.keys(): - trial_started_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("trial_started_at")).datetime if dictionary.get("trial_started_at") else None + if "trial_started_at" in dictionary.keys(): + trial_started_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("trial_started_at")).datetime\ + if dictionary.get("trial_started_at") else None + else: trial_started_at = APIHelper.SKIP - if 'trial_ended_at' in dictionary.keys(): - trial_ended_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("trial_ended_at")).datetime if dictionary.get("trial_ended_at") else None + if "trial_ended_at" in dictionary.keys(): + trial_ended_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("trial_ended_at")).datetime\ + if dictionary.get("trial_ended_at") else None + else: trial_ended_at = APIHelper.SKIP - if 'activated_at' in dictionary.keys(): - activated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("activated_at")).datetime if dictionary.get("activated_at") else None + if "activated_at" in dictionary.keys(): + activated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("activated_at")).datetime\ + if dictionary.get("activated_at") else None + else: activated_at = APIHelper.SKIP - if 'expires_at' in dictionary.keys(): - expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else None + if "expires_at" in dictionary.keys(): + expires_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("expires_at")).datetime\ + if dictionary.get("expires_at") else None + else: expires_at = APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - cancellation_message = dictionary.get("cancellation_message") if "cancellation_message" in dictionary.keys() else APIHelper.SKIP - cancellation_method = dictionary.get("cancellation_method") if "cancellation_method" in dictionary.keys() else APIHelper.SKIP - cancel_at_end_of_period = dictionary.get("cancel_at_end_of_period") if "cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP - if 'canceled_at' in dictionary.keys(): - canceled_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("canceled_at")).datetime if dictionary.get("canceled_at") else None + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + cancellation_message =\ + dictionary.get("cancellation_message")\ + if "cancellation_message" in dictionary.keys()\ + else APIHelper.SKIP + cancellation_method =\ + dictionary.get("cancellation_method")\ + if "cancellation_method" in dictionary.keys()\ + else APIHelper.SKIP + cancel_at_end_of_period =\ + dictionary.get("cancel_at_end_of_period")\ + if "cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP + if "canceled_at" in dictionary.keys(): + canceled_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("canceled_at")).datetime\ + if dictionary.get("canceled_at") else None + else: canceled_at = APIHelper.SKIP - if 'current_period_started_at' in dictionary.keys(): - current_period_started_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("current_period_started_at")).datetime if dictionary.get("current_period_started_at") else None + if "current_period_started_at" in dictionary.keys(): + current_period_started_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("current_period_started_at")).datetime\ + if dictionary.get("current_period_started_at") else None + else: current_period_started_at = APIHelper.SKIP - previous_state = dictionary.get("previous_state") if dictionary.get("previous_state") else APIHelper.SKIP - signup_payment_id = dictionary.get("signup_payment_id") if dictionary.get("signup_payment_id") else APIHelper.SKIP - signup_revenue = dictionary.get("signup_revenue") if dictionary.get("signup_revenue") else APIHelper.SKIP - if 'delayed_cancel_at' in dictionary.keys(): - delayed_cancel_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("delayed_cancel_at")).datetime if dictionary.get("delayed_cancel_at") else None + previous_state =\ + dictionary.get("previous_state")\ + if dictionary.get("previous_state")\ + else APIHelper.SKIP + signup_payment_id =\ + dictionary.get("signup_payment_id")\ + if dictionary.get("signup_payment_id")\ + else APIHelper.SKIP + signup_revenue =\ + dictionary.get("signup_revenue")\ + if dictionary.get("signup_revenue")\ + else APIHelper.SKIP + if "delayed_cancel_at" in dictionary.keys(): + delayed_cancel_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("delayed_cancel_at")).datetime\ + if dictionary.get("delayed_cancel_at") else None + else: delayed_cancel_at = APIHelper.SKIP - coupon_code = dictionary.get("coupon_code") if "coupon_code" in dictionary.keys() else APIHelper.SKIP - if 'snap_day' in dictionary.keys(): - snap_day = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionSnapDay'), dictionary.get('snap_day'), False) if dictionary.get('snap_day') is not None else None + coupon_code =\ + dictionary.get("coupon_code")\ + if "coupon_code" in dictionary.keys()\ + else APIHelper.SKIP + if "snap_day" in dictionary.keys(): + snap_day = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionSnapDay"), + dictionary.get("snap_day"), + False)\ + if dictionary.get("snap_day") is not None\ + else None else: snap_day = APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP - customer = Customer.from_dictionary(dictionary.get('customer')) if 'customer' in dictionary.keys() else APIHelper.SKIP - product = Product.from_dictionary(dictionary.get('product')) if 'product' in dictionary.keys() else APIHelper.SKIP - credit_card = CreditCardPaymentProfile.from_dictionary(dictionary.get('credit_card')) if 'credit_card' in dictionary.keys() else APIHelper.SKIP - if 'group' in dictionary.keys(): - group = NestedSubscriptionGroup.from_dictionary(dictionary.get('group')) if dictionary.get('group') else None + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + customer =\ + Customer.from_dictionary( + dictionary.get("customer"))\ + if "customer" in dictionary.keys()\ + else APIHelper.SKIP + product =\ + Product.from_dictionary( + dictionary.get("product"))\ + if "product" in dictionary.keys()\ + else APIHelper.SKIP + credit_card =\ + CreditCardPaymentProfile.from_dictionary( + dictionary.get("credit_card"))\ + if "credit_card" in dictionary.keys()\ + else APIHelper.SKIP + if "group" in dictionary.keys(): + group =\ + NestedSubscriptionGroup.from_dictionary( + dictionary.get("group"))\ + if dictionary.get("group") else None else: group = APIHelper.SKIP - bank_account = BankAccountPaymentProfile.from_dictionary(dictionary.get('bank_account')) if 'bank_account' in dictionary.keys() else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if "payment_type" in dictionary.keys() else APIHelper.SKIP - referral_code = dictionary.get("referral_code") if "referral_code" in dictionary.keys() else APIHelper.SKIP - next_product_id = dictionary.get("next_product_id") if "next_product_id" in dictionary.keys() else APIHelper.SKIP - next_product_handle = dictionary.get("next_product_handle") if "next_product_handle" in dictionary.keys() else APIHelper.SKIP - coupon_use_count = dictionary.get("coupon_use_count") if "coupon_use_count" in dictionary.keys() else APIHelper.SKIP - coupon_uses_allowed = dictionary.get("coupon_uses_allowed") if "coupon_uses_allowed" in dictionary.keys() else APIHelper.SKIP - reason_code = dictionary.get("reason_code") if "reason_code" in dictionary.keys() else APIHelper.SKIP - if 'automatically_resume_at' in dictionary.keys(): - automatically_resume_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("automatically_resume_at")).datetime if dictionary.get("automatically_resume_at") else None + bank_account =\ + BankAccountPaymentProfile.from_dictionary( + dictionary.get("bank_account"))\ + if "bank_account" in dictionary.keys()\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if "payment_type" in dictionary.keys()\ + else APIHelper.SKIP + referral_code =\ + dictionary.get("referral_code")\ + if "referral_code" in dictionary.keys()\ + else APIHelper.SKIP + next_product_id =\ + dictionary.get("next_product_id")\ + if "next_product_id" in dictionary.keys()\ + else APIHelper.SKIP + next_product_handle =\ + dictionary.get("next_product_handle")\ + if "next_product_handle" in dictionary.keys()\ + else APIHelper.SKIP + coupon_use_count =\ + dictionary.get("coupon_use_count")\ + if "coupon_use_count" in dictionary.keys()\ + else APIHelper.SKIP + coupon_uses_allowed =\ + dictionary.get("coupon_uses_allowed")\ + if "coupon_uses_allowed" in dictionary.keys()\ + else APIHelper.SKIP + reason_code =\ + dictionary.get("reason_code")\ + if "reason_code" in dictionary.keys()\ + else APIHelper.SKIP + if "automatically_resume_at" in dictionary.keys(): + automatically_resume_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("automatically_resume_at")).datetime\ + if dictionary.get("automatically_resume_at") else None + else: automatically_resume_at = APIHelper.SKIP - coupon_codes = dictionary.get("coupon_codes") if dictionary.get("coupon_codes") else APIHelper.SKIP - offer_id = dictionary.get("offer_id") if "offer_id" in dictionary.keys() else APIHelper.SKIP - payer_id = dictionary.get("payer_id") if "payer_id" in dictionary.keys() else APIHelper.SKIP - current_billing_amount_in_cents = dictionary.get("current_billing_amount_in_cents") if dictionary.get("current_billing_amount_in_cents") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - product_price_point_type = dictionary.get("product_price_point_type") if dictionary.get("product_price_point_type") else APIHelper.SKIP - next_product_price_point_id = dictionary.get("next_product_price_point_id") if "next_product_price_point_id" in dictionary.keys() else APIHelper.SKIP - net_terms = dictionary.get("net_terms") if "net_terms" in dictionary.keys() else APIHelper.SKIP - stored_credential_transaction_id = dictionary.get("stored_credential_transaction_id") if "stored_credential_transaction_id" in dictionary.keys() else APIHelper.SKIP - reference = dictionary.get("reference") if "reference" in dictionary.keys() else APIHelper.SKIP - if 'on_hold_at' in dictionary.keys(): - on_hold_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("on_hold_at")).datetime if dictionary.get("on_hold_at") else None + coupon_codes =\ + dictionary.get("coupon_codes")\ + if dictionary.get("coupon_codes")\ + else APIHelper.SKIP + offer_id =\ + dictionary.get("offer_id")\ + if "offer_id" in dictionary.keys()\ + else APIHelper.SKIP + payer_id =\ + dictionary.get("payer_id")\ + if "payer_id" in dictionary.keys()\ + else APIHelper.SKIP + current_billing_amount_in_cents =\ + dictionary.get("current_billing_amount_in_cents")\ + if dictionary.get("current_billing_amount_in_cents")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + product_price_point_type =\ + dictionary.get("product_price_point_type")\ + if dictionary.get("product_price_point_type")\ + else APIHelper.SKIP + next_product_price_point_id =\ + dictionary.get("next_product_price_point_id")\ + if "next_product_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + net_terms =\ + dictionary.get("net_terms")\ + if "net_terms" in dictionary.keys()\ + else APIHelper.SKIP + stored_credential_transaction_id =\ + dictionary.get("stored_credential_transaction_id")\ + if "stored_credential_transaction_id" in dictionary.keys()\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if "reference" in dictionary.keys()\ + else APIHelper.SKIP + if "on_hold_at" in dictionary.keys(): + on_hold_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("on_hold_at")).datetime\ + if dictionary.get("on_hold_at") else None + else: on_hold_at = APIHelper.SKIP - prepaid_dunning = dictionary.get("prepaid_dunning") if "prepaid_dunning" in dictionary.keys() else APIHelper.SKIP + prepaid_dunning =\ + dictionary.get("prepaid_dunning")\ + if "prepaid_dunning" in dictionary.keys()\ + else APIHelper.SKIP coupons = None - if dictionary.get('coupons') is not None: - coupons = [SubscriptionIncludedCoupon.from_dictionary(x) for x in dictionary.get('coupons')] + if dictionary.get("coupons") is not None: + coupons = [ + SubscriptionIncludedCoupon.from_dictionary(x) + for x in dictionary.get("coupons") + ] else: coupons = APIHelper.SKIP - dunning_communication_delay_enabled = dictionary.get("dunning_communication_delay_enabled") if "dunning_communication_delay_enabled" in dictionary.keys() else APIHelper.SKIP - dunning_communication_delay_time_zone = dictionary.get("dunning_communication_delay_time_zone") if "dunning_communication_delay_time_zone" in dictionary.keys() else APIHelper.SKIP - receives_invoice_emails = dictionary.get("receives_invoice_emails") if "receives_invoice_emails" in dictionary.keys() else APIHelper.SKIP - locale = dictionary.get("locale") if "locale" in dictionary.keys() else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - if 'scheduled_cancellation_at' in dictionary.keys(): - scheduled_cancellation_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("scheduled_cancellation_at")).datetime if dictionary.get("scheduled_cancellation_at") else None + dunning_communication_delay_enabled =\ + dictionary.get("dunning_communication_delay_enabled")\ + if "dunning_communication_delay_enabled" in dictionary.keys()\ + else APIHelper.SKIP + dunning_communication_delay_time_zone =\ + dictionary.get("dunning_communication_delay_time_zone")\ + if "dunning_communication_delay_time_zone" in dictionary.keys()\ + else APIHelper.SKIP + receives_invoice_emails =\ + dictionary.get("receives_invoice_emails")\ + if "receives_invoice_emails" in dictionary.keys()\ + else APIHelper.SKIP + locale =\ + dictionary.get("locale")\ + if "locale" in dictionary.keys()\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + if "scheduled_cancellation_at" in dictionary.keys(): + scheduled_cancellation_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("scheduled_cancellation_at")).datetime\ + if dictionary.get("scheduled_cancellation_at") else None + else: scheduled_cancellation_at = APIHelper.SKIP - credit_balance_in_cents = dictionary.get("credit_balance_in_cents") if dictionary.get("credit_balance_in_cents") else APIHelper.SKIP - prepayment_balance_in_cents = dictionary.get("prepayment_balance_in_cents") if dictionary.get("prepayment_balance_in_cents") else APIHelper.SKIP - if 'prepaid_configuration' in dictionary.keys(): - prepaid_configuration = PrepaidConfiguration.from_dictionary(dictionary.get('prepaid_configuration')) if dictionary.get('prepaid_configuration') else None + credit_balance_in_cents =\ + dictionary.get("credit_balance_in_cents")\ + if dictionary.get("credit_balance_in_cents")\ + else APIHelper.SKIP + prepayment_balance_in_cents =\ + dictionary.get("prepayment_balance_in_cents")\ + if dictionary.get("prepayment_balance_in_cents")\ + else APIHelper.SKIP + if "prepaid_configuration" in dictionary.keys(): + prepaid_configuration =\ + PrepaidConfiguration.from_dictionary( + dictionary.get("prepaid_configuration"))\ + if dictionary.get("prepaid_configuration") else None else: prepaid_configuration = APIHelper.SKIP - self_service_page_token = dictionary.get("self_service_page_token") if dictionary.get("self_service_page_token") else APIHelper.SKIP + self_service_page_token =\ + dictionary.get("self_service_page_token")\ + if dictionary.get("self_service_page_token")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, state, @@ -804,133 +1035,763 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'balance_in_cents={(self.balance_in_cents if hasattr(self, "balance_in_cents") else None)!r}, ' - f'total_revenue_in_cents={(self.total_revenue_in_cents if hasattr(self, "total_revenue_in_cents") else None)!r}, ' - f'product_price_in_cents={(self.product_price_in_cents if hasattr(self, "product_price_in_cents") else None)!r}, ' - f'product_version_number={(self.product_version_number if hasattr(self, "product_version_number") else None)!r}, ' - f'current_period_ends_at={(self.current_period_ends_at if hasattr(self, "current_period_ends_at") else None)!r}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!r}, ' - f'trial_started_at={(self.trial_started_at if hasattr(self, "trial_started_at") else None)!r}, ' - f'trial_ended_at={(self.trial_ended_at if hasattr(self, "trial_ended_at") else None)!r}, ' - f'activated_at={(self.activated_at if hasattr(self, "activated_at") else None)!r}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!r}, ' - f'cancellation_method={(self.cancellation_method if hasattr(self, "cancellation_method") else None)!r}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!r}, ' - f'canceled_at={(self.canceled_at if hasattr(self, "canceled_at") else None)!r}, ' - f'current_period_started_at={(self.current_period_started_at if hasattr(self, "current_period_started_at") else None)!r}, ' - f'previous_state={(self.previous_state if hasattr(self, "previous_state") else None)!r}, ' - f'signup_payment_id={(self.signup_payment_id if hasattr(self, "signup_payment_id") else None)!r}, ' - f'signup_revenue={(self.signup_revenue if hasattr(self, "signup_revenue") else None)!r}, ' - f'delayed_cancel_at={(self.delayed_cancel_at if hasattr(self, "delayed_cancel_at") else None)!r}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!r}, ' - f'snap_day={(self.snap_day if hasattr(self, "snap_day") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!r}, ' - f'product={(self.product if hasattr(self, "product") else None)!r}, ' - f'credit_card={(self.credit_card if hasattr(self, "credit_card") else None)!r}, ' - f'group={(self.group if hasattr(self, "group") else None)!r}, ' - f'bank_account={(self.bank_account if hasattr(self, "bank_account") else None)!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'referral_code={(self.referral_code if hasattr(self, "referral_code") else None)!r}, ' - f'next_product_id={(self.next_product_id if hasattr(self, "next_product_id") else None)!r}, ' - f'next_product_handle={(self.next_product_handle if hasattr(self, "next_product_handle") else None)!r}, ' - f'coupon_use_count={(self.coupon_use_count if hasattr(self, "coupon_use_count") else None)!r}, ' - f'coupon_uses_allowed={(self.coupon_uses_allowed if hasattr(self, "coupon_uses_allowed") else None)!r}, ' - f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!r}, ' - f'automatically_resume_at={(self.automatically_resume_at if hasattr(self, "automatically_resume_at") else None)!r}, ' - f'coupon_codes={(self.coupon_codes if hasattr(self, "coupon_codes") else None)!r}, ' - f'offer_id={(self.offer_id if hasattr(self, "offer_id") else None)!r}, ' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!r}, ' - f'current_billing_amount_in_cents={(self.current_billing_amount_in_cents if hasattr(self, "current_billing_amount_in_cents") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'product_price_point_type={(self.product_price_point_type if hasattr(self, "product_price_point_type") else None)!r}, ' - f'next_product_price_point_id={(self.next_product_price_point_id if hasattr(self, "next_product_price_point_id") else None)!r}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!r}, ' - f'stored_credential_transaction_id={(self.stored_credential_transaction_id if hasattr(self, "stored_credential_transaction_id") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'on_hold_at={(self.on_hold_at if hasattr(self, "on_hold_at") else None)!r}, ' - f'prepaid_dunning={(self.prepaid_dunning if hasattr(self, "prepaid_dunning") else None)!r}, ' - f'coupons={(self.coupons if hasattr(self, "coupons") else None)!r}, ' - f'dunning_communication_delay_enabled={(self.dunning_communication_delay_enabled if hasattr(self, "dunning_communication_delay_enabled") else None)!r}, ' - f'dunning_communication_delay_time_zone={(self.dunning_communication_delay_time_zone if hasattr(self, "dunning_communication_delay_time_zone") else None)!r}, ' - f'receives_invoice_emails={(self.receives_invoice_emails if hasattr(self, "receives_invoice_emails") else None)!r}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'scheduled_cancellation_at={(self.scheduled_cancellation_at if hasattr(self, "scheduled_cancellation_at") else None)!r}, ' - f'credit_balance_in_cents={(self.credit_balance_in_cents if hasattr(self, "credit_balance_in_cents") else None)!r}, ' - f'prepayment_balance_in_cents={(self.prepayment_balance_in_cents if hasattr(self, "prepayment_balance_in_cents") else None)!r}, ' - f'prepaid_configuration={(self.prepaid_configuration if hasattr(self, "prepaid_configuration") else None)!r}, ' - f'self_service_page_token={(self.self_service_page_token if hasattr(self, "self_service_page_token") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _balance_in_cents=( + self.balance_in_cents + if hasattr(self, "balance_in_cents") + else None + ) + _total_revenue_in_cents=( + self.total_revenue_in_cents + if hasattr(self, "total_revenue_in_cents") + else None + ) + _product_price_in_cents=( + self.product_price_in_cents + if hasattr(self, "product_price_in_cents") + else None + ) + _product_version_number=( + self.product_version_number + if hasattr(self, "product_version_number") + else None + ) + _current_period_ends_at=( + self.current_period_ends_at + if hasattr(self, "current_period_ends_at") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _trial_started_at=( + self.trial_started_at + if hasattr(self, "trial_started_at") + else None + ) + _trial_ended_at=( + self.trial_ended_at + if hasattr(self, "trial_ended_at") + else None + ) + _activated_at=( + self.activated_at + if hasattr(self, "activated_at") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _cancellation_method=( + self.cancellation_method + if hasattr(self, "cancellation_method") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _canceled_at=( + self.canceled_at + if hasattr(self, "canceled_at") + else None + ) + _current_period_started_at=( + self.current_period_started_at + if hasattr(self, "current_period_started_at") + else None + ) + _previous_state=( + self.previous_state + if hasattr(self, "previous_state") + else None + ) + _signup_payment_id=( + self.signup_payment_id + if hasattr(self, "signup_payment_id") + else None + ) + _signup_revenue=( + self.signup_revenue + if hasattr(self, "signup_revenue") + else None + ) + _delayed_cancel_at=( + self.delayed_cancel_at + if hasattr(self, "delayed_cancel_at") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _snap_day=( + self.snap_day + if hasattr(self, "snap_day") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _product=( + self.product + if hasattr(self, "product") + else None + ) + _credit_card=( + self.credit_card + if hasattr(self, "credit_card") + else None + ) + _group=( + self.group + if hasattr(self, "group") + else None + ) + _bank_account=( + self.bank_account + if hasattr(self, "bank_account") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _referral_code=( + self.referral_code + if hasattr(self, "referral_code") + else None + ) + _next_product_id=( + self.next_product_id + if hasattr(self, "next_product_id") + else None + ) + _next_product_handle=( + self.next_product_handle + if hasattr(self, "next_product_handle") + else None + ) + _coupon_use_count=( + self.coupon_use_count + if hasattr(self, "coupon_use_count") + else None + ) + _coupon_uses_allowed=( + self.coupon_uses_allowed + if hasattr(self, "coupon_uses_allowed") + else None + ) + _reason_code=( + self.reason_code + if hasattr(self, "reason_code") + else None + ) + _automatically_resume_at=( + self.automatically_resume_at + if hasattr(self, "automatically_resume_at") + else None + ) + _coupon_codes=( + self.coupon_codes + if hasattr(self, "coupon_codes") + else None + ) + _offer_id=( + self.offer_id + if hasattr(self, "offer_id") + else None + ) + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _current_billing_amount_in_cents=( + self.current_billing_amount_in_cents + if hasattr(self, "current_billing_amount_in_cents") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_type=( + self.product_price_point_type + if hasattr(self, "product_price_point_type") + else None + ) + _next_product_price_point_id=( + self.next_product_price_point_id + if hasattr(self, "next_product_price_point_id") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _stored_credential_transaction_id=( + self.stored_credential_transaction_id + if hasattr(self, "stored_credential_transaction_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _on_hold_at=( + self.on_hold_at + if hasattr(self, "on_hold_at") + else None + ) + _prepaid_dunning=( + self.prepaid_dunning + if hasattr(self, "prepaid_dunning") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _dunning_communication_delay_enabled=( + self.dunning_communication_delay_enabled + if hasattr(self, "dunning_communication_delay_enabled") + else None + ) + _dunning_communication_delay_time_zone=( + self.dunning_communication_delay_time_zone + if hasattr(self, "dunning_communication_delay_time_zone") + else None + ) + _receives_invoice_emails=( + self.receives_invoice_emails + if hasattr(self, "receives_invoice_emails") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _scheduled_cancellation_at=( + self.scheduled_cancellation_at + if hasattr(self, "scheduled_cancellation_at") + else None + ) + _credit_balance_in_cents=( + self.credit_balance_in_cents + if hasattr(self, "credit_balance_in_cents") + else None + ) + _prepayment_balance_in_cents=( + self.prepayment_balance_in_cents + if hasattr(self, "prepayment_balance_in_cents") + else None + ) + _prepaid_configuration=( + self.prepaid_configuration + if hasattr(self, "prepaid_configuration") + else None + ) + _self_service_page_token=( + self.self_service_page_token + if hasattr(self, "self_service_page_token") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"state={_state!r}, " + f"balance_in_cents={_balance_in_cents!r}, " + f"total_revenue_in_cents={_total_revenue_in_cents!r}, " + f"product_price_in_cents={_product_price_in_cents!r}, " + f"product_version_number={_product_version_number!r}, " + f"current_period_ends_at={_current_period_ends_at!r}, " + f"next_assessment_at={_next_assessment_at!r}, " + f"trial_started_at={_trial_started_at!r}, " + f"trial_ended_at={_trial_ended_at!r}, " + f"activated_at={_activated_at!r}, " + f"expires_at={_expires_at!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"cancellation_message={_cancellation_message!r}, " + f"cancellation_method={_cancellation_method!r}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!r}, " + f"canceled_at={_canceled_at!r}, " + f"current_period_started_at={_current_period_started_at!r}, " + f"previous_state={_previous_state!r}, " + f"signup_payment_id={_signup_payment_id!r}, " + f"signup_revenue={_signup_revenue!r}, " + f"delayed_cancel_at={_delayed_cancel_at!r}, " + f"coupon_code={_coupon_code!r}, " + f"snap_day={_snap_day!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"customer={_customer!r}, " + f"product={_product!r}, " + f"credit_card={_credit_card!r}, " + f"group={_group!r}, " + f"bank_account={_bank_account!r}, " + f"payment_type={_payment_type!r}, " + f"referral_code={_referral_code!r}, " + f"next_product_id={_next_product_id!r}, " + f"next_product_handle={_next_product_handle!r}, " + f"coupon_use_count={_coupon_use_count!r}, " + f"coupon_uses_allowed={_coupon_uses_allowed!r}, " + f"reason_code={_reason_code!r}, " + f"automatically_resume_at={_automatically_resume_at!r}, " + f"coupon_codes={_coupon_codes!r}, " + f"offer_id={_offer_id!r}, " + f"payer_id={_payer_id!r}, " + f"current_billing_amount_in_cents={_current_billing_amount_in_cents!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"product_price_point_type={_product_price_point_type!r}, " + f"next_product_price_point_id={_next_product_price_point_id!r}, " + f"net_terms={_net_terms!r}, " + f"stored_credential_transaction_id={_stored_credential_transaction_id!r}, " + f"reference={_reference!r}, " + f"on_hold_at={_on_hold_at!r}, " + f"prepaid_dunning={_prepaid_dunning!r}, " + f"coupons={_coupons!r}, " + f"dunning_communication_delay_enabled={_dunning_communication_delay_enabled!r}, " + f"dunning_communication_delay_time_zone={_dunning_communication_delay_time_zone!r}, " + f"receives_invoice_emails={_receives_invoice_emails!r}, " + f"locale={_locale!r}, " + f"currency={_currency!r}, " + f"scheduled_cancellation_at={_scheduled_cancellation_at!r}, " + f"credit_balance_in_cents={_credit_balance_in_cents!r}, " + f"prepayment_balance_in_cents={_prepayment_balance_in_cents!r}, " + f"prepaid_configuration={_prepaid_configuration!r}, " + f"self_service_page_token={_self_service_page_token!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'balance_in_cents={(self.balance_in_cents if hasattr(self, "balance_in_cents") else None)!s}, ' - f'total_revenue_in_cents={(self.total_revenue_in_cents if hasattr(self, "total_revenue_in_cents") else None)!s}, ' - f'product_price_in_cents={(self.product_price_in_cents if hasattr(self, "product_price_in_cents") else None)!s}, ' - f'product_version_number={(self.product_version_number if hasattr(self, "product_version_number") else None)!s}, ' - f'current_period_ends_at={(self.current_period_ends_at if hasattr(self, "current_period_ends_at") else None)!s}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!s}, ' - f'trial_started_at={(self.trial_started_at if hasattr(self, "trial_started_at") else None)!s}, ' - f'trial_ended_at={(self.trial_ended_at if hasattr(self, "trial_ended_at") else None)!s}, ' - f'activated_at={(self.activated_at if hasattr(self, "activated_at") else None)!s}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'cancellation_message={(self.cancellation_message if hasattr(self, "cancellation_message") else None)!s}, ' - f'cancellation_method={(self.cancellation_method if hasattr(self, "cancellation_method") else None)!s}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!s}, ' - f'canceled_at={(self.canceled_at if hasattr(self, "canceled_at") else None)!s}, ' - f'current_period_started_at={(self.current_period_started_at if hasattr(self, "current_period_started_at") else None)!s}, ' - f'previous_state={(self.previous_state if hasattr(self, "previous_state") else None)!s}, ' - f'signup_payment_id={(self.signup_payment_id if hasattr(self, "signup_payment_id") else None)!s}, ' - f'signup_revenue={(self.signup_revenue if hasattr(self, "signup_revenue") else None)!s}, ' - f'delayed_cancel_at={(self.delayed_cancel_at if hasattr(self, "delayed_cancel_at") else None)!s}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!s}, ' - f'snap_day={(self.snap_day if hasattr(self, "snap_day") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'customer={(self.customer if hasattr(self, "customer") else None)!s}, ' - f'product={(self.product if hasattr(self, "product") else None)!s}, ' - f'credit_card={(self.credit_card if hasattr(self, "credit_card") else None)!s}, ' - f'group={(self.group if hasattr(self, "group") else None)!s}, ' - f'bank_account={(self.bank_account if hasattr(self, "bank_account") else None)!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'referral_code={(self.referral_code if hasattr(self, "referral_code") else None)!s}, ' - f'next_product_id={(self.next_product_id if hasattr(self, "next_product_id") else None)!s}, ' - f'next_product_handle={(self.next_product_handle if hasattr(self, "next_product_handle") else None)!s}, ' - f'coupon_use_count={(self.coupon_use_count if hasattr(self, "coupon_use_count") else None)!s}, ' - f'coupon_uses_allowed={(self.coupon_uses_allowed if hasattr(self, "coupon_uses_allowed") else None)!s}, ' - f'reason_code={(self.reason_code if hasattr(self, "reason_code") else None)!s}, ' - f'automatically_resume_at={(self.automatically_resume_at if hasattr(self, "automatically_resume_at") else None)!s}, ' - f'coupon_codes={(self.coupon_codes if hasattr(self, "coupon_codes") else None)!s}, ' - f'offer_id={(self.offer_id if hasattr(self, "offer_id") else None)!s}, ' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!s}, ' - f'current_billing_amount_in_cents={(self.current_billing_amount_in_cents if hasattr(self, "current_billing_amount_in_cents") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'product_price_point_type={(self.product_price_point_type if hasattr(self, "product_price_point_type") else None)!s}, ' - f'next_product_price_point_id={(self.next_product_price_point_id if hasattr(self, "next_product_price_point_id") else None)!s}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!s}, ' - f'stored_credential_transaction_id={(self.stored_credential_transaction_id if hasattr(self, "stored_credential_transaction_id") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'on_hold_at={(self.on_hold_at if hasattr(self, "on_hold_at") else None)!s}, ' - f'prepaid_dunning={(self.prepaid_dunning if hasattr(self, "prepaid_dunning") else None)!s}, ' - f'coupons={(self.coupons if hasattr(self, "coupons") else None)!s}, ' - f'dunning_communication_delay_enabled={(self.dunning_communication_delay_enabled if hasattr(self, "dunning_communication_delay_enabled") else None)!s}, ' - f'dunning_communication_delay_time_zone={(self.dunning_communication_delay_time_zone if hasattr(self, "dunning_communication_delay_time_zone") else None)!s}, ' - f'receives_invoice_emails={(self.receives_invoice_emails if hasattr(self, "receives_invoice_emails") else None)!s}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'scheduled_cancellation_at={(self.scheduled_cancellation_at if hasattr(self, "scheduled_cancellation_at") else None)!s}, ' - f'credit_balance_in_cents={(self.credit_balance_in_cents if hasattr(self, "credit_balance_in_cents") else None)!s}, ' - f'prepayment_balance_in_cents={(self.prepayment_balance_in_cents if hasattr(self, "prepayment_balance_in_cents") else None)!s}, ' - f'prepaid_configuration={(self.prepaid_configuration if hasattr(self, "prepaid_configuration") else None)!s}, ' - f'self_service_page_token={(self.self_service_page_token if hasattr(self, "self_service_page_token") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _balance_in_cents=( + self.balance_in_cents + if hasattr(self, "balance_in_cents") + else None + ) + _total_revenue_in_cents=( + self.total_revenue_in_cents + if hasattr(self, "total_revenue_in_cents") + else None + ) + _product_price_in_cents=( + self.product_price_in_cents + if hasattr(self, "product_price_in_cents") + else None + ) + _product_version_number=( + self.product_version_number + if hasattr(self, "product_version_number") + else None + ) + _current_period_ends_at=( + self.current_period_ends_at + if hasattr(self, "current_period_ends_at") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _trial_started_at=( + self.trial_started_at + if hasattr(self, "trial_started_at") + else None + ) + _trial_ended_at=( + self.trial_ended_at + if hasattr(self, "trial_ended_at") + else None + ) + _activated_at=( + self.activated_at + if hasattr(self, "activated_at") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _cancellation_message=( + self.cancellation_message + if hasattr(self, "cancellation_message") + else None + ) + _cancellation_method=( + self.cancellation_method + if hasattr(self, "cancellation_method") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _canceled_at=( + self.canceled_at + if hasattr(self, "canceled_at") + else None + ) + _current_period_started_at=( + self.current_period_started_at + if hasattr(self, "current_period_started_at") + else None + ) + _previous_state=( + self.previous_state + if hasattr(self, "previous_state") + else None + ) + _signup_payment_id=( + self.signup_payment_id + if hasattr(self, "signup_payment_id") + else None + ) + _signup_revenue=( + self.signup_revenue + if hasattr(self, "signup_revenue") + else None + ) + _delayed_cancel_at=( + self.delayed_cancel_at + if hasattr(self, "delayed_cancel_at") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _snap_day=( + self.snap_day + if hasattr(self, "snap_day") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _customer=( + self.customer + if hasattr(self, "customer") + else None + ) + _product=( + self.product + if hasattr(self, "product") + else None + ) + _credit_card=( + self.credit_card + if hasattr(self, "credit_card") + else None + ) + _group=( + self.group + if hasattr(self, "group") + else None + ) + _bank_account=( + self.bank_account + if hasattr(self, "bank_account") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _referral_code=( + self.referral_code + if hasattr(self, "referral_code") + else None + ) + _next_product_id=( + self.next_product_id + if hasattr(self, "next_product_id") + else None + ) + _next_product_handle=( + self.next_product_handle + if hasattr(self, "next_product_handle") + else None + ) + _coupon_use_count=( + self.coupon_use_count + if hasattr(self, "coupon_use_count") + else None + ) + _coupon_uses_allowed=( + self.coupon_uses_allowed + if hasattr(self, "coupon_uses_allowed") + else None + ) + _reason_code=( + self.reason_code + if hasattr(self, "reason_code") + else None + ) + _automatically_resume_at=( + self.automatically_resume_at + if hasattr(self, "automatically_resume_at") + else None + ) + _coupon_codes=( + self.coupon_codes + if hasattr(self, "coupon_codes") + else None + ) + _offer_id=( + self.offer_id + if hasattr(self, "offer_id") + else None + ) + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _current_billing_amount_in_cents=( + self.current_billing_amount_in_cents + if hasattr(self, "current_billing_amount_in_cents") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_type=( + self.product_price_point_type + if hasattr(self, "product_price_point_type") + else None + ) + _next_product_price_point_id=( + self.next_product_price_point_id + if hasattr(self, "next_product_price_point_id") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _stored_credential_transaction_id=( + self.stored_credential_transaction_id + if hasattr(self, "stored_credential_transaction_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _on_hold_at=( + self.on_hold_at + if hasattr(self, "on_hold_at") + else None + ) + _prepaid_dunning=( + self.prepaid_dunning + if hasattr(self, "prepaid_dunning") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _dunning_communication_delay_enabled=( + self.dunning_communication_delay_enabled + if hasattr(self, "dunning_communication_delay_enabled") + else None + ) + _dunning_communication_delay_time_zone=( + self.dunning_communication_delay_time_zone + if hasattr(self, "dunning_communication_delay_time_zone") + else None + ) + _receives_invoice_emails=( + self.receives_invoice_emails + if hasattr(self, "receives_invoice_emails") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _scheduled_cancellation_at=( + self.scheduled_cancellation_at + if hasattr(self, "scheduled_cancellation_at") + else None + ) + _credit_balance_in_cents=( + self.credit_balance_in_cents + if hasattr(self, "credit_balance_in_cents") + else None + ) + _prepayment_balance_in_cents=( + self.prepayment_balance_in_cents + if hasattr(self, "prepayment_balance_in_cents") + else None + ) + _prepaid_configuration=( + self.prepaid_configuration + if hasattr(self, "prepaid_configuration") + else None + ) + _self_service_page_token=( + self.self_service_page_token + if hasattr(self, "self_service_page_token") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"state={_state!s}, " + f"balance_in_cents={_balance_in_cents!s}, " + f"total_revenue_in_cents={_total_revenue_in_cents!s}, " + f"product_price_in_cents={_product_price_in_cents!s}, " + f"product_version_number={_product_version_number!s}, " + f"current_period_ends_at={_current_period_ends_at!s}, " + f"next_assessment_at={_next_assessment_at!s}, " + f"trial_started_at={_trial_started_at!s}, " + f"trial_ended_at={_trial_ended_at!s}, " + f"activated_at={_activated_at!s}, " + f"expires_at={_expires_at!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"cancellation_message={_cancellation_message!s}, " + f"cancellation_method={_cancellation_method!s}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!s}, " + f"canceled_at={_canceled_at!s}, " + f"current_period_started_at={_current_period_started_at!s}, " + f"previous_state={_previous_state!s}, " + f"signup_payment_id={_signup_payment_id!s}, " + f"signup_revenue={_signup_revenue!s}, " + f"delayed_cancel_at={_delayed_cancel_at!s}, " + f"coupon_code={_coupon_code!s}, " + f"snap_day={_snap_day!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"customer={_customer!s}, " + f"product={_product!s}, " + f"credit_card={_credit_card!s}, " + f"group={_group!s}, " + f"bank_account={_bank_account!s}, " + f"payment_type={_payment_type!s}, " + f"referral_code={_referral_code!s}, " + f"next_product_id={_next_product_id!s}, " + f"next_product_handle={_next_product_handle!s}, " + f"coupon_use_count={_coupon_use_count!s}, " + f"coupon_uses_allowed={_coupon_uses_allowed!s}, " + f"reason_code={_reason_code!s}, " + f"automatically_resume_at={_automatically_resume_at!s}, " + f"coupon_codes={_coupon_codes!s}, " + f"offer_id={_offer_id!s}, " + f"payer_id={_payer_id!s}, " + f"current_billing_amount_in_cents={_current_billing_amount_in_cents!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"product_price_point_type={_product_price_point_type!s}, " + f"next_product_price_point_id={_next_product_price_point_id!s}, " + f"net_terms={_net_terms!s}, " + f"stored_credential_transaction_id={_stored_credential_transaction_id!s}, " + f"reference={_reference!s}, " + f"on_hold_at={_on_hold_at!s}, " + f"prepaid_dunning={_prepaid_dunning!s}, " + f"coupons={_coupons!s}, " + f"dunning_communication_delay_enabled={_dunning_communication_delay_enabled!s}, " + f"dunning_communication_delay_time_zone={_dunning_communication_delay_time_zone!s}, " + f"receives_invoice_emails={_receives_invoice_emails!s}, " + f"locale={_locale!s}, " + f"currency={_currency!s}, " + f"scheduled_cancellation_at={_scheduled_cancellation_at!s}, " + f"credit_balance_in_cents={_credit_balance_in_cents!s}, " + f"prepayment_balance_in_cents={_prepayment_balance_in_cents!s}, " + f"prepaid_configuration={_prepaid_configuration!s}, " + f"self_service_page_token={_self_service_page_token!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_component.py b/advancedbilling/models/subscription_component.py index 9d51eb41..11b5b5c8 100644 --- a/advancedbilling/models/subscription_component.py +++ b/advancedbilling/models/subscription_component.py @@ -1,18 +1,20 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.historic_usage import HistoricUsage -from advancedbilling.models.subscription_component_subscription import SubscriptionComponentSubscription +from advancedbilling.models.historic_usage import ( + HistoricUsage, +) +from advancedbilling.models.subscription_component_subscription import ( + SubscriptionComponentSubscription, +) class SubscriptionComponent(object): - """Implementation of the 'Subscription Component' model. Attributes: @@ -20,32 +22,28 @@ class SubscriptionComponent(object): name (str): The model property of type str. kind (ComponentKind): A handle for the component type unit_name (str): The model property of type str. - enabled (bool): (for on/off components) indicates if the component is - enabled for the subscription + enabled (bool): (for on/off components) indicates if the component is enabled + for the subscription unit_balance (int): The model property of type int. currency (str): The model property of type str. - allocated_quantity (int | str | None): For Quantity-based components: - The current allocation for the component on the given - subscription. For On/Off components: Use 1 for on. Use 0 for off. - pricing_scheme (PricingScheme): The model property of type - PricingScheme. + allocated_quantity (int | str | None): For Quantity-based components: The + current allocation for the component on the given subscription. For + On/Off components: Use 1 for on. Use 0 for off. + pricing_scheme (PricingScheme): The model property of type PricingScheme. component_id (int): The model property of type int. component_handle (str): The model property of type str. subscription_id (int): The model property of type int. recurring (bool): The model property of type bool. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. downgrade_credit (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. archived_at (datetime): The model property of type datetime. price_point_id (int): The model property of type int. price_point_handle (str): The model property of type str. - price_point_type (PricePointType): The model property of type - PricePointType. + price_point_type (PricePointType): The model property of type PricePointType. price_point_name (str): The model property of type str. product_family_id (int): The model property of type int. product_family_handle (str): The model property of type str. @@ -54,210 +52,219 @@ class SubscriptionComponent(object): use_site_exchange_rate (bool): The model property of type bool. description (str): The model property of type str. allow_fractional_quantities (bool): The model property of type bool. - subscription (SubscriptionComponentSubscription): An optional object, - will be returned if provided `include=subscription` query param. + subscription (SubscriptionComponentSubscription): An optional object, will be + returned if provided `include=subscription` query param. historic_usages (List[HistoricUsage]): The model property of type List[HistoricUsage]. display_on_hosted_page (bool): The model property of type bool. - interval (int): The numerical interval. i.e. an interval of '30' - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + interval (int): The numerical interval. i.e. an interval of '30' coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "name": 'name', - "kind": 'kind', - "unit_name": 'unit_name', - "enabled": 'enabled', - "unit_balance": 'unit_balance', - "currency": 'currency', - "allocated_quantity": 'allocated_quantity', - "pricing_scheme": 'pricing_scheme', - "component_id": 'component_id', - "component_handle": 'component_handle', - "subscription_id": 'subscription_id', - "recurring": 'recurring', - "upgrade_charge": 'upgrade_charge', - "downgrade_credit": 'downgrade_credit', - "archived_at": 'archived_at', - "price_point_id": 'price_point_id', - "price_point_handle": 'price_point_handle', - "price_point_type": 'price_point_type', - "price_point_name": 'price_point_name', - "product_family_id": 'product_family_id', - "product_family_handle": 'product_family_handle', - "created_at": 'created_at', - "updated_at": 'updated_at', - "use_site_exchange_rate": 'use_site_exchange_rate', - "description": 'description', - "allow_fractional_quantities": 'allow_fractional_quantities', - "subscription": 'subscription', - "historic_usages": 'historic_usages', - "display_on_hosted_page": 'display_on_hosted_page', - "interval": 'interval', - "interval_unit": 'interval_unit' + "id": "id", + "name": "name", + "kind": "kind", + "unit_name": "unit_name", + "enabled": "enabled", + "unit_balance": "unit_balance", + "currency": "currency", + "allocated_quantity": "allocated_quantity", + "pricing_scheme": "pricing_scheme", + "component_id": "component_id", + "component_handle": "component_handle", + "subscription_id": "subscription_id", + "recurring": "recurring", + "upgrade_charge": "upgrade_charge", + "downgrade_credit": "downgrade_credit", + "archived_at": "archived_at", + "price_point_id": "price_point_id", + "price_point_handle": "price_point_handle", + "price_point_type": "price_point_type", + "price_point_name": "price_point_name", + "product_family_id": "product_family_id", + "product_family_handle": "product_family_handle", + "created_at": "created_at", + "updated_at": "updated_at", + "use_site_exchange_rate": "use_site_exchange_rate", + "description": "description", + "allow_fractional_quantities": "allow_fractional_quantities", + "subscription": "subscription", + "historic_usages": "historic_usages", + "display_on_hosted_page": "display_on_hosted_page", + "interval": "interval", + "interval_unit": "interval_unit", } _optionals = [ - 'id', - 'name', - 'kind', - 'unit_name', - 'enabled', - 'unit_balance', - 'currency', - 'allocated_quantity', - 'pricing_scheme', - 'component_id', - 'component_handle', - 'subscription_id', - 'recurring', - 'upgrade_charge', - 'downgrade_credit', - 'archived_at', - 'price_point_id', - 'price_point_handle', - 'price_point_type', - 'price_point_name', - 'product_family_id', - 'product_family_handle', - 'created_at', - 'updated_at', - 'use_site_exchange_rate', - 'description', - 'allow_fractional_quantities', - 'subscription', - 'historic_usages', - 'display_on_hosted_page', - 'interval', - 'interval_unit', + "id", + "name", + "kind", + "unit_name", + "enabled", + "unit_balance", + "currency", + "allocated_quantity", + "pricing_scheme", + "component_id", + "component_handle", + "subscription_id", + "recurring", + "upgrade_charge", + "downgrade_credit", + "archived_at", + "price_point_id", + "price_point_handle", + "price_point_type", + "price_point_name", + "product_family_id", + "product_family_handle", + "created_at", + "updated_at", + "use_site_exchange_rate", + "description", + "allow_fractional_quantities", + "subscription", + "historic_usages", + "display_on_hosted_page", + "interval", + "interval_unit", ] _nullables = [ - 'pricing_scheme', - 'component_handle', - 'upgrade_charge', - 'downgrade_credit', - 'archived_at', - 'price_point_id', - 'price_point_handle', - 'price_point_type', - 'price_point_name', - 'use_site_exchange_rate', - 'description', - 'interval_unit', + "pricing_scheme", + "component_handle", + "upgrade_charge", + "downgrade_credit", + "archived_at", + "price_point_id", + "price_point_handle", + "price_point_type", + "price_point_name", + "use_site_exchange_rate", + "description", + "interval_unit", ] - def __init__(self, - id=APIHelper.SKIP, - name=APIHelper.SKIP, - kind=APIHelper.SKIP, - unit_name=APIHelper.SKIP, - enabled=APIHelper.SKIP, - unit_balance=APIHelper.SKIP, - currency=APIHelper.SKIP, - allocated_quantity=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - component_id=APIHelper.SKIP, - component_handle=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - recurring=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - downgrade_credit=APIHelper.SKIP, - archived_at=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - price_point_handle=APIHelper.SKIP, - price_point_type=APIHelper.SKIP, - price_point_name=APIHelper.SKIP, - product_family_id=APIHelper.SKIP, - product_family_handle=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - description=APIHelper.SKIP, - allow_fractional_quantities=APIHelper.SKIP, - subscription=APIHelper.SKIP, - historic_usages=APIHelper.SKIP, - display_on_hosted_page=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionComponent class""" - + def __init__( + self, + id=APIHelper.SKIP, + name=APIHelper.SKIP, + kind=APIHelper.SKIP, + unit_name=APIHelper.SKIP, + enabled=APIHelper.SKIP, + unit_balance=APIHelper.SKIP, + currency=APIHelper.SKIP, + allocated_quantity=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + component_id=APIHelper.SKIP, + component_handle=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + recurring=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP, + archived_at=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + price_point_handle=APIHelper.SKIP, + price_point_type=APIHelper.SKIP, + price_point_name=APIHelper.SKIP, + product_family_id=APIHelper.SKIP, + product_family_handle=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + description=APIHelper.SKIP, + allow_fractional_quantities=APIHelper.SKIP, + subscription=APIHelper.SKIP, + historic_usages=APIHelper.SKIP, + display_on_hosted_page=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionComponent instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if name is not APIHelper.SKIP: - self.name = name + self.name = name if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if unit_name is not APIHelper.SKIP: - self.unit_name = unit_name + self.unit_name = unit_name if enabled is not APIHelper.SKIP: - self.enabled = enabled + self.enabled = enabled if unit_balance is not APIHelper.SKIP: - self.unit_balance = unit_balance + self.unit_balance = unit_balance if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if allocated_quantity is not APIHelper.SKIP: - self.allocated_quantity = allocated_quantity + self.allocated_quantity = allocated_quantity if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if component_handle is not APIHelper.SKIP: - self.component_handle = component_handle + self.component_handle = component_handle if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit + self.downgrade_credit = downgrade_credit if archived_at is not APIHelper.SKIP: - self.archived_at = APIHelper.apply_datetime_converter(archived_at, APIHelper.RFC3339DateTime) if archived_at else None + self.archived_at =\ + APIHelper.apply_datetime_converter( + archived_at, APIHelper.RFC3339DateTime)\ + if archived_at else None if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if price_point_handle is not APIHelper.SKIP: - self.price_point_handle = price_point_handle + self.price_point_handle = price_point_handle if price_point_type is not APIHelper.SKIP: - self.price_point_type = price_point_type + self.price_point_type = price_point_type if price_point_name is not APIHelper.SKIP: - self.price_point_name = price_point_name + self.price_point_name = price_point_name if product_family_id is not APIHelper.SKIP: - self.product_family_id = product_family_id + self.product_family_id = product_family_id if product_family_handle is not APIHelper.SKIP: - self.product_family_handle = product_family_handle + self.product_family_handle = product_family_handle if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if description is not APIHelper.SKIP: - self.description = description + self.description = description if allow_fractional_quantities is not APIHelper.SKIP: - self.allow_fractional_quantities = allow_fractional_quantities + self.allow_fractional_quantities = allow_fractional_quantities if subscription is not APIHelper.SKIP: - self.subscription = subscription + self.subscription = subscription if historic_usages is not APIHelper.SKIP: - self.historic_usages = historic_usages + self.historic_usages = historic_usages if display_on_hosted_page is not APIHelper.SKIP: - self.display_on_hosted_page = display_on_hosted_page + self.display_on_hosted_page = display_on_hosted_page if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit # Add additional model properties to the instance if additional_properties is None: @@ -267,7 +274,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -278,53 +285,155 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - unit_name = dictionary.get("unit_name") if dictionary.get("unit_name") else APIHelper.SKIP - enabled = dictionary.get("enabled") if "enabled" in dictionary.keys() else APIHelper.SKIP - unit_balance = dictionary.get("unit_balance") if dictionary.get("unit_balance") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - allocated_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionComponentAllocatedQuantity'), dictionary.get('allocated_quantity'), False) if dictionary.get('allocated_quantity') is not None else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if "pricing_scheme" in dictionary.keys() else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if "component_handle" in dictionary.keys() else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP - downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP - if 'archived_at' in dictionary.keys(): - archived_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("archived_at")).datetime if dictionary.get("archived_at") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + unit_name =\ + dictionary.get("unit_name")\ + if dictionary.get("unit_name")\ + else APIHelper.SKIP + enabled =\ + dictionary.get("enabled")\ + if "enabled" in dictionary.keys()\ + else APIHelper.SKIP + unit_balance =\ + dictionary.get("unit_balance")\ + if dictionary.get("unit_balance")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + allocated_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionComponentAllocatedQuantity"), + dictionary.get("allocated_quantity"), + False)\ + if dictionary.get("allocated_quantity") is not None\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if "pricing_scheme" in dictionary.keys()\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + component_handle =\ + dictionary.get("component_handle")\ + if "component_handle" in dictionary.keys()\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if "recurring" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + downgrade_credit =\ + dictionary.get("downgrade_credit")\ + if "downgrade_credit" in dictionary.keys()\ + else APIHelper.SKIP + if "archived_at" in dictionary.keys(): + archived_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("archived_at")).datetime\ + if dictionary.get("archived_at") else None + else: archived_at = APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if "price_point_id" in dictionary.keys() else APIHelper.SKIP - price_point_handle = dictionary.get("price_point_handle") if "price_point_handle" in dictionary.keys() else APIHelper.SKIP - price_point_type = dictionary.get("price_point_type") if "price_point_type" in dictionary.keys() else APIHelper.SKIP - price_point_name = dictionary.get("price_point_name") if "price_point_name" in dictionary.keys() else APIHelper.SKIP - product_family_id = dictionary.get("product_family_id") if dictionary.get("product_family_id") else APIHelper.SKIP - product_family_handle = dictionary.get("product_family_handle") if dictionary.get("product_family_handle") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - allow_fractional_quantities = dictionary.get("allow_fractional_quantities") if "allow_fractional_quantities" in dictionary.keys() else APIHelper.SKIP - subscription = SubscriptionComponentSubscription.from_dictionary(dictionary.get('subscription')) if 'subscription' in dictionary.keys() else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if "price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + price_point_handle =\ + dictionary.get("price_point_handle")\ + if "price_point_handle" in dictionary.keys()\ + else APIHelper.SKIP + price_point_type =\ + dictionary.get("price_point_type")\ + if "price_point_type" in dictionary.keys()\ + else APIHelper.SKIP + price_point_name =\ + dictionary.get("price_point_name")\ + if "price_point_name" in dictionary.keys()\ + else APIHelper.SKIP + product_family_id =\ + dictionary.get("product_family_id")\ + if dictionary.get("product_family_id")\ + else APIHelper.SKIP + product_family_handle =\ + dictionary.get("product_family_handle")\ + if dictionary.get("product_family_handle")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + allow_fractional_quantities =\ + dictionary.get("allow_fractional_quantities")\ + if "allow_fractional_quantities" in dictionary.keys()\ + else APIHelper.SKIP + subscription =\ + SubscriptionComponentSubscription.from_dictionary( + dictionary.get("subscription"))\ + if "subscription" in dictionary.keys()\ + else APIHelper.SKIP historic_usages = None - if dictionary.get('historic_usages') is not None: - historic_usages = [HistoricUsage.from_dictionary(x) for x in dictionary.get('historic_usages')] + if dictionary.get("historic_usages") is not None: + historic_usages = [ + HistoricUsage.from_dictionary(x) + for x in dictionary.get("historic_usages") + ] else: historic_usages = APIHelper.SKIP - display_on_hosted_page = dictionary.get("display_on_hosted_page") if "display_on_hosted_page" in dictionary.keys() else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + display_on_hosted_page =\ + dictionary.get("display_on_hosted_page")\ + if "display_on_hosted_page" in dictionary.keys()\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, name, @@ -361,73 +470,403 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'unit_name={(self.unit_name if hasattr(self, "unit_name") else None)!r}, ' - f'enabled={(self.enabled if hasattr(self, "enabled") else None)!r}, ' - f'unit_balance={(self.unit_balance if hasattr(self, "unit_balance") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!r}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'price_point_handle={(self.price_point_handle if hasattr(self, "price_point_handle") else None)!r}, ' - f'price_point_type={(self.price_point_type if hasattr(self, "price_point_type") else None)!r}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!r}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!r}, ' - f'product_family_handle={(self.product_family_handle if hasattr(self, "product_family_handle") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!r}, ' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!r}, ' - f'historic_usages={(self.historic_usages if hasattr(self, "historic_usages") else None)!r}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _unit_name=( + self.unit_name + if hasattr(self, "unit_name") + else None + ) + _enabled=( + self.enabled + if hasattr(self, "enabled") + else None + ) + _unit_balance=( + self.unit_balance + if hasattr(self, "unit_balance") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _price_point_handle=( + self.price_point_handle + if hasattr(self, "price_point_handle") + else None + ) + _price_point_type=( + self.price_point_type + if hasattr(self, "price_point_type") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_family_handle=( + self.product_family_handle + if hasattr(self, "product_family_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _historic_usages=( + self.historic_usages + if hasattr(self, "historic_usages") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"name={_name!r}, " + f"kind={_kind!r}, " + f"unit_name={_unit_name!r}, " + f"enabled={_enabled!r}, " + f"unit_balance={_unit_balance!r}, " + f"currency={_currency!r}, " + f"allocated_quantity={_allocated_quantity!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"subscription_id={_subscription_id!r}, " + f"recurring={_recurring!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"downgrade_credit={_downgrade_credit!r}, " + f"archived_at={_archived_at!r}, " + f"price_point_id={_price_point_id!r}, " + f"price_point_handle={_price_point_handle!r}, " + f"price_point_type={_price_point_type!r}, " + f"price_point_name={_price_point_name!r}, " + f"product_family_id={_product_family_id!r}, " + f"product_family_handle={_product_family_handle!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"description={_description!r}, " + f"allow_fractional_quantities={_allow_fractional_quantities!r}, " + f"subscription={_subscription!r}, " + f"historic_usages={_historic_usages!r}, " + f"display_on_hosted_page={_display_on_hosted_page!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'unit_name={(self.unit_name if hasattr(self, "unit_name") else None)!s}, ' - f'enabled={(self.enabled if hasattr(self, "enabled") else None)!s}, ' - f'unit_balance={(self.unit_balance if hasattr(self, "unit_balance") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'downgrade_credit={(self.downgrade_credit if hasattr(self, "downgrade_credit") else None)!s}, ' - f'archived_at={(self.archived_at if hasattr(self, "archived_at") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'price_point_handle={(self.price_point_handle if hasattr(self, "price_point_handle") else None)!s}, ' - f'price_point_type={(self.price_point_type if hasattr(self, "price_point_type") else None)!s}, ' - f'price_point_name={(self.price_point_name if hasattr(self, "price_point_name") else None)!s}, ' - f'product_family_id={(self.product_family_id if hasattr(self, "product_family_id") else None)!s}, ' - f'product_family_handle={(self.product_family_handle if hasattr(self, "product_family_handle") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'allow_fractional_quantities={(self.allow_fractional_quantities if hasattr(self, "allow_fractional_quantities") else None)!s}, ' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!s}, ' - f'historic_usages={(self.historic_usages if hasattr(self, "historic_usages") else None)!s}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _unit_name=( + self.unit_name + if hasattr(self, "unit_name") + else None + ) + _enabled=( + self.enabled + if hasattr(self, "enabled") + else None + ) + _unit_balance=( + self.unit_balance + if hasattr(self, "unit_balance") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _downgrade_credit=( + self.downgrade_credit + if hasattr(self, "downgrade_credit") + else None + ) + _archived_at=( + self.archived_at + if hasattr(self, "archived_at") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _price_point_handle=( + self.price_point_handle + if hasattr(self, "price_point_handle") + else None + ) + _price_point_type=( + self.price_point_type + if hasattr(self, "price_point_type") + else None + ) + _price_point_name=( + self.price_point_name + if hasattr(self, "price_point_name") + else None + ) + _product_family_id=( + self.product_family_id + if hasattr(self, "product_family_id") + else None + ) + _product_family_handle=( + self.product_family_handle + if hasattr(self, "product_family_handle") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _allow_fractional_quantities=( + self.allow_fractional_quantities + if hasattr(self, "allow_fractional_quantities") + else None + ) + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _historic_usages=( + self.historic_usages + if hasattr(self, "historic_usages") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"name={_name!s}, " + f"kind={_kind!s}, " + f"unit_name={_unit_name!s}, " + f"enabled={_enabled!s}, " + f"unit_balance={_unit_balance!s}, " + f"currency={_currency!s}, " + f"allocated_quantity={_allocated_quantity!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"subscription_id={_subscription_id!s}, " + f"recurring={_recurring!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"downgrade_credit={_downgrade_credit!s}, " + f"archived_at={_archived_at!s}, " + f"price_point_id={_price_point_id!s}, " + f"price_point_handle={_price_point_handle!s}, " + f"price_point_type={_price_point_type!s}, " + f"price_point_name={_price_point_name!s}, " + f"product_family_id={_product_family_id!s}, " + f"product_family_handle={_product_family_handle!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"description={_description!s}, " + f"allow_fractional_quantities={_allow_fractional_quantities!s}, " + f"subscription={_subscription!s}, " + f"historic_usages={_historic_usages!s}, " + f"display_on_hosted_page={_display_on_hosted_page!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_component_allocation_error_item.py b/advancedbilling/models/subscription_component_allocation_error_item.py index c04d6743..4b48b8fa 100644 --- a/advancedbilling/models/subscription_component_allocation_error_item.py +++ b/advancedbilling/models/subscription_component_allocation_error_item.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionComponentAllocationErrorItem(object): - """Implementation of the 'Subscription Component Allocation Error Item' model. Attributes: kind (str): The model property of type str. message (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "kind": 'kind', - "message": 'message' + "kind": "kind", + "message": "message", } _optionals = [ - 'kind', - 'message', + "kind", + "message", ] - def __init__(self, - kind=APIHelper.SKIP, - message=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionComponentAllocationErrorItem class""" - + def __init__( + self, + kind=APIHelper.SKIP, + message=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionComponentAllocationErrorItem instance.""" # Initialize members of the class if kind is not APIHelper.SKIP: - self.kind = kind + self.kind = kind if message is not APIHelper.SKIP: - self.message = message + self.message = message # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - kind = dictionary.get("kind") if dictionary.get("kind") else APIHelper.SKIP - message = dictionary.get("message") if dictionary.get("message") else APIHelper.SKIP + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else APIHelper.SKIP + message =\ + dictionary.get("message")\ + if dictionary.get("message")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(kind, message, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'message={(self.message if hasattr(self, "message") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _message=( + self.message + if hasattr(self, "message") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"kind={_kind!r}, " + f"message={_message!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'message={(self.message if hasattr(self, "message") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _message=( + self.message + if hasattr(self, "message") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"kind={_kind!s}, " + f"message={_message!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_component_response.py b/advancedbilling/models/subscription_component_response.py index d878fc91..ad33aa66 100644 --- a/advancedbilling/models/subscription_component_response.py +++ b/advancedbilling/models/subscription_component_response.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_component import SubscriptionComponent +from advancedbilling.models.subscription_component import ( + SubscriptionComponent, +) class SubscriptionComponentResponse(object): - """Implementation of the 'Subscription Component Response' model. Attributes: component (SubscriptionComponent): The model property of type SubscriptionComponent. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component": 'component' + "component": "component", } _optionals = [ - 'component', + "component", ] - def __init__(self, - component=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionComponentResponse class""" - + def __init__( + self, + component=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionComponentResponse instance.""" # Initialize members of the class if component is not APIHelper.SKIP: - self.component = component + self.component = component # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,24 +59,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component = SubscriptionComponent.from_dictionary(dictionary.get('component')) if 'component' in dictionary.keys() else APIHelper.SKIP + component =\ + SubscriptionComponent.from_dictionary( + dictionary.get("component"))\ + if "component" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component={(self.component if hasattr(self, "component") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component=( + self.component + if hasattr(self, "component") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component={_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component={(self.component if hasattr(self, "component") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component=( + self.component + if hasattr(self, "component") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component={_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_component_subscription.py b/advancedbilling/models/subscription_component_subscription.py index c45f0a75..971cea81 100644 --- a/advancedbilling/models/subscription_component_subscription.py +++ b/advancedbilling/models/subscription_component_subscription.py @@ -1,115 +1,111 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionComponentSubscription(object): - """Implementation of the 'Subscription Component Subscription' model. - An optional object, will be returned if provided `include=subscription` - query param. + An optional object, will be returned if provided `include=subscription` query + param. Attributes: - state (SubscriptionState): The state of a subscription. * **Live - States** * `active` - A normal, active subscription. It is not - in a trial and is paid and up to date. * `assessing` - An - internal (transient) state that indicates a subscription is in the - middle of periodic assessment. Do not base any access decisions in - your app on this state, as it may not always be exposed. * - `pending` - An internal (transient) state that indicates a - subscription is in the creation process. Do not base any access - decisions in your app on this state, as it may not always be - exposed. * `trialing` - A subscription in trialing state has a - valid trial subscription. This type of subscription may transition - to active once payment is received when the trial has ended. - Otherwise, it may go to a Problem or End of Life state. * - `paused` - An internal state that indicates that your account with - Advanced Billing is in arrears. * **Problem States** * - `past_due` - Indicates that the most recent payment has failed, - and payment is past due for this subscription. If you have enabled - our automated dunning, this subscription will be in the dunning - process (additional status and callbacks from the dunning process - will be available in the future). If you are handling dunning and - payment updates yourself, you will want to use this state to - initiate a payment update from your customers. * - `soft_failure` - Indicates that normal assessment/processing of - the subscription has failed for a reason that cannot be fixed by - the Customer. For example, a Soft Fail may result from a timeout - at the gateway or incorrect credentials on your part. The - subscriptions should be retried automatically. An interface is - being built for you to review problems resulting from these events - to take manual action when needed. * `unpaid` - Indicates an - unpaid subscription. A subscription is marked unpaid if the retry - period expires and you have configured your - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) settings to have a Final Action of `mark the - subscription unpaid`. * **End of Life States** * `canceled` - - Indicates a canceled subscription. This may happen at your request - (via the API or the web interface) or due to the expiration of the - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) process without payment. See the - [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109 - 503629-Reactivating-and-Resuming) documentation for info on how to - restart a canceled subscription. While a subscription is - canceled, its period will not advance, it will not accrue any new - charges, and Advanced Billing will not attempt to collect the - overdue balance. * `expired` - Indicates a subscription that - has expired due to running its normal life cycle. Some products - may be configured to have an expiration period. An expired - subscription then is one that stayed active until it fulfilled its - full period. * `failed_to_create` - Indicates that signup has - failed. (You may see this state in a signup_failure webhook.) - * `on_hold` - Indicates that a subscription’s billing has been - temporarily stopped. While it is expected that the subscription - will resume and return to active status, this is still treated as - an “End of Life” state because the customer is not paying for - services during this time. * `suspended` - Indicates that a - prepaid subscription has used up all their prepayment balance. If - a prepayment is applied, it will return to an active state. * - `trial_ended` - A subscription in a trial_ended state is a - subscription that completed a no-obligation trial and did not have - a card on file at the expiration of the trial period. See [Product - Pricing – No Obligation - Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869- - Product-Editing) for more details. See [Subscription - States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853- - Subscription-States) for more info about subscription states and - state transitions. + state (SubscriptionState): The state of a subscription. * **Live States** + * `active` - A normal, active subscription. It is not in a trial and is + paid and up to date. * `assessing` - An internal (transient) state + that indicates a subscription is in the middle of periodic assessment. Do + not base any access decisions in your app on this state, as it may not + always be exposed. * `pending` - An internal (transient) state that + indicates a subscription is in the creation process. Do not base any + access decisions in your app on this state, as it may not always be + exposed. * `trialing` - A subscription in trialing state has a valid + trial subscription. This type of subscription may transition to active + once payment is received when the trial has ended. Otherwise, it may go + to a Problem or End of Life state. * `paused` - An internal state + that indicates that your account with Advanced Billing is in arrears. * + **Problem States** * `past_due` - Indicates that the most recent + payment has failed, and payment is past due for this subscription. If you + have enabled our automated dunning, this subscription will be in the + dunning process (additional status and callbacks from the dunning process + will be available in the future). If you are handling dunning and payment + updates yourself, you will want to use this state to initiate a payment + update from your customers. * `soft_failure` - Indicates that normal + assessment/processing of the subscription has failed for a reason that + cannot be fixed by the Customer. For example, a Soft Fail may result from + a timeout at the gateway or incorrect credentials on your part. The + subscriptions should be retried automatically. An interface is being + built for you to review problems resulting from these events to take + manual action when needed. * `unpaid` - Indicates an unpaid + subscription. A subscription is marked unpaid if the retry period expires + and you have configured your + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) settings to have a Final Action of `mark the subscription + unpaid`. * **End of Life States** * `canceled` - Indicates a canceled + subscription. This may happen at your request (via the API or the web + interface) or due to the expiration of the + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) process without payment. See the + [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629- + Reactivating-and-Resuming) documentation for info on how to restart a + canceled subscription. While a subscription is canceled, its period + will not advance, it will not accrue any new charges, and Advanced + Billing will not attempt to collect the overdue balance. * `expired` + - Indicates a subscription that has expired due to running its normal + life cycle. Some products may be configured to have an expiration period. + An expired subscription then is one that stayed active until it fulfilled + its full period. * `failed_to_create` - Indicates that signup has + failed. (You may see this state in a signup_failure webhook.) * + `on_hold` - Indicates that a subscription’s billing has been temporarily + stopped. While it is expected that the subscription will resume and + return to active status, this is still treated as an “End of Life” state + because the customer is not paying for services during this time. * + `suspended` - Indicates that a prepaid subscription has used up all their + prepayment balance. If a prepayment is applied, it will return to an + active state. * `trial_ended` - A subscription in a trial_ended state + is a subscription that completed a no-obligation trial and did not have a + card on file at the expiration of the trial period. See [Product Pricing + – No Obligation + Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product + -Editing) for more details. See [Subscription + States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri + ption-States) for more info about subscription states and state + transitions. updated_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "state": 'state', - "updated_at": 'updated_at' + "state": "state", + "updated_at": "updated_at", } _optionals = [ - 'state', - 'updated_at', + "state", + "updated_at", ] - def __init__(self, - state=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionComponentSubscription class""" - + def __init__( + self, + state=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionComponentSubscription instance.""" # Initialize members of the class if state is not APIHelper.SKIP: - self.state = state + self.state = state if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None # Add additional model properties to the instance if additional_properties is None: @@ -119,7 +115,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -130,15 +126,22 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(state, updated_at, @@ -146,7 +149,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -157,7 +160,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -167,13 +169,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _state=( + self.state + if hasattr(self, "state") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"state={_state!r}, " + f"updated_at={_updated_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _state=( + self.state + if hasattr(self, "state") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"state={_state!s}, " + f"updated_at={_updated_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_custom_price.py b/advancedbilling/models/subscription_custom_price.py index 024a8d0f..d8c75771 100644 --- a/advancedbilling/models/subscription_custom_price.py +++ b/advancedbilling/models/subscription_custom_price.py @@ -1,131 +1,130 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.interval_unit import ( + IntervalUnit, +) class SubscriptionCustomPrice(object): - """Implementation of the 'Subscription Custom Price' model. - (Optional) Used in place of `product_price_point_id` to define a custom - price point unique to the subscription + (Optional) Used in place of `product_price_point_id` to define a custom price + point unique to the subscription. A subscription can have up to 30 custom price + points. Exceeding this limit will result in an API error. Attributes: name (str): (Optional) handle (str): (Optional) price_in_cents (str | int): Required if using `custom_price` attribute. interval (str | int): Required if using `custom_price` attribute. - interval_unit (IntervalUnit): Required if using `custom_price` - attribute. + interval_unit (IntervalUnit): Required if using `custom_price` attribute. trial_price_in_cents (str | int | None): (Optional) trial_interval (str | int | None): (Optional) trial_interval_unit (IntervalUnit): (Optional) - trial_type (TrialType): Indicates how a trial is handled when the - trail period ends and there is no credit card on file. For - `no_obligation`, the subscription transitions to a Trial Ended - state. Maxio will not send any emails or statements. For - `payment_expected`, the subscription transitions to a Past Due - state. Maxio will send normal dunning emails and statements - according to your other settings. + trial_type (TrialType): Indicates how a trial is handled when the trail + period ends and there is no credit card on file. For `no_obligation`, the + subscription transitions to a Trial Ended state. Maxio will not send any + emails or statements. For `payment_expected`, the subscription + transitions to a Past Due state. Maxio will send normal dunning emails + and statements according to your other settings. initial_charge_in_cents (str | int | None): (Optional) initial_charge_after_trial (bool): (Optional) expiration_interval (str | int | None): (Optional) expiration_interval_unit (ExpirationIntervalUnit): (Optional) tax_included (bool): (Optional) - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_in_cents": 'price_in_cents', - "interval": 'interval', - "interval_unit": 'interval_unit', - "name": 'name', - "handle": 'handle', - "trial_price_in_cents": 'trial_price_in_cents', - "trial_interval": 'trial_interval', - "trial_interval_unit": 'trial_interval_unit', - "trial_type": 'trial_type', - "initial_charge_in_cents": 'initial_charge_in_cents', - "initial_charge_after_trial": 'initial_charge_after_trial', - "expiration_interval": 'expiration_interval', - "expiration_interval_unit": 'expiration_interval_unit', - "tax_included": 'tax_included' + "price_in_cents": "price_in_cents", + "interval": "interval", + "interval_unit": "interval_unit", + "name": "name", + "handle": "handle", + "trial_price_in_cents": "trial_price_in_cents", + "trial_interval": "trial_interval", + "trial_interval_unit": "trial_interval_unit", + "trial_type": "trial_type", + "initial_charge_in_cents": "initial_charge_in_cents", + "initial_charge_after_trial": "initial_charge_after_trial", + "expiration_interval": "expiration_interval", + "expiration_interval_unit": "expiration_interval_unit", + "tax_included": "tax_included", } _optionals = [ - 'name', - 'handle', - 'trial_price_in_cents', - 'trial_interval', - 'trial_interval_unit', - 'trial_type', - 'initial_charge_in_cents', - 'initial_charge_after_trial', - 'expiration_interval', - 'expiration_interval_unit', - 'tax_included', + "name", + "handle", + "trial_price_in_cents", + "trial_interval", + "trial_interval_unit", + "trial_type", + "initial_charge_in_cents", + "initial_charge_after_trial", + "expiration_interval", + "expiration_interval_unit", + "tax_included", ] _nullables = [ - 'interval_unit', - 'trial_type', - 'expiration_interval_unit', + "interval_unit", + "trial_type", + "expiration_interval_unit", ] - def __init__(self, - price_in_cents=None, - interval=None, - interval_unit=None, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - trial_price_in_cents=APIHelper.SKIP, - trial_interval=APIHelper.SKIP, - trial_interval_unit=APIHelper.SKIP, - trial_type=APIHelper.SKIP, - initial_charge_in_cents=APIHelper.SKIP, - initial_charge_after_trial=APIHelper.SKIP, - expiration_interval=APIHelper.SKIP, - expiration_interval_unit=APIHelper.SKIP, - tax_included=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionCustomPrice class""" - + def __init__( + self, + price_in_cents=None, + interval=None, + interval_unit=None, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + trial_price_in_cents=APIHelper.SKIP, + trial_interval=APIHelper.SKIP, + trial_interval_unit=APIHelper.SKIP, + trial_type=APIHelper.SKIP, + initial_charge_in_cents=APIHelper.SKIP, + initial_charge_after_trial=APIHelper.SKIP, + expiration_interval=APIHelper.SKIP, + expiration_interval_unit=APIHelper.SKIP, + tax_included=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionCustomPrice instance.""" # Initialize members of the class if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle - self.price_in_cents = price_in_cents - self.interval = interval - self.interval_unit = interval_unit + self.handle = handle + self.price_in_cents = price_in_cents + self.interval = interval + self.interval_unit = interval_unit if trial_price_in_cents is not APIHelper.SKIP: - self.trial_price_in_cents = trial_price_in_cents + self.trial_price_in_cents = trial_price_in_cents if trial_interval is not APIHelper.SKIP: - self.trial_interval = trial_interval + self.trial_interval = trial_interval if trial_interval_unit is not APIHelper.SKIP: - self.trial_interval_unit = trial_interval_unit + self.trial_interval_unit = trial_interval_unit if trial_type is not APIHelper.SKIP: - self.trial_type = trial_type + self.trial_type = trial_type if initial_charge_in_cents is not APIHelper.SKIP: - self.initial_charge_in_cents = initial_charge_in_cents + self.initial_charge_in_cents = initial_charge_in_cents if initial_charge_after_trial is not APIHelper.SKIP: - self.initial_charge_after_trial = initial_charge_after_trial + self.initial_charge_after_trial = initial_charge_after_trial if expiration_interval is not APIHelper.SKIP: - self.expiration_interval = expiration_interval + self.expiration_interval = expiration_interval if expiration_interval_unit is not APIHelper.SKIP: - self.expiration_interval_unit = expiration_interval_unit + self.expiration_interval_unit = expiration_interval_unit if tax_included is not APIHelper.SKIP: - self.tax_included = tax_included + self.tax_included = tax_included # Add additional model properties to the instance if additional_properties is None: @@ -135,7 +134,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -146,28 +145,87 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_in_cents = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionCustomPricePriceInCents'), dictionary.get('price_in_cents'), False) if dictionary.get('price_in_cents') is not None else None - interval = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionCustomPriceInterval'), dictionary.get('interval'), False) if dictionary.get('interval') is not None else None - interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else None - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - trial_price_in_cents = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionCustomPriceTrialPriceInCents'), dictionary.get('trial_price_in_cents'), False) if dictionary.get('trial_price_in_cents') is not None else APIHelper.SKIP - trial_interval = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionCustomPriceTrialInterval'), dictionary.get('trial_interval'), False) if dictionary.get('trial_interval') is not None else APIHelper.SKIP - trial_interval_unit = dictionary.get("trial_interval_unit") if dictionary.get("trial_interval_unit") else APIHelper.SKIP - trial_type = dictionary.get("trial_type") if "trial_type" in dictionary.keys() else APIHelper.SKIP - initial_charge_in_cents = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionCustomPriceInitialChargeInCents'), dictionary.get('initial_charge_in_cents'), False) if dictionary.get('initial_charge_in_cents') is not None else APIHelper.SKIP - initial_charge_after_trial = dictionary.get("initial_charge_after_trial") if "initial_charge_after_trial" in dictionary.keys() else APIHelper.SKIP - expiration_interval = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionCustomPriceExpirationInterval'), dictionary.get('expiration_interval'), False) if dictionary.get('expiration_interval') is not None else APIHelper.SKIP - expiration_interval_unit = dictionary.get("expiration_interval_unit") if "expiration_interval_unit" in dictionary.keys() else APIHelper.SKIP - tax_included = dictionary.get("tax_included") if "tax_included" in dictionary.keys() else APIHelper.SKIP + price_in_cents = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionCustomPricePriceInCents"), + dictionary.get("price_in_cents"), + False)\ + if dictionary.get("price_in_cents") is not None\ + else None + interval = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionCustomPriceInterval"), + dictionary.get("interval"), + False)\ + if dictionary.get("interval") is not None\ + else None + interval_unit =\ + dictionary.get("interval_unit")\ + if dictionary.get("interval_unit")\ + else None + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + trial_price_in_cents = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionCustomPriceTrialPriceInCents"), + dictionary.get("trial_price_in_cents"), + False)\ + if dictionary.get("trial_price_in_cents") is not None\ + else APIHelper.SKIP + trial_interval = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionCustomPriceTrialInterval"), + dictionary.get("trial_interval"), + False)\ + if dictionary.get("trial_interval") is not None\ + else APIHelper.SKIP + trial_interval_unit =\ + dictionary.get("trial_interval_unit")\ + if dictionary.get("trial_interval_unit")\ + else APIHelper.SKIP + trial_type =\ + dictionary.get("trial_type")\ + if "trial_type" in dictionary.keys()\ + else APIHelper.SKIP + initial_charge_in_cents = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionCustomPriceInitialChargeInCents"), + dictionary.get("initial_charge_in_cents"), + False)\ + if dictionary.get("initial_charge_in_cents") is not None\ + else APIHelper.SKIP + initial_charge_after_trial =\ + dictionary.get("initial_charge_after_trial")\ + if "initial_charge_after_trial" in dictionary.keys()\ + else APIHelper.SKIP + expiration_interval = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionCustomPriceExpirationInterval"), + dictionary.get("expiration_interval"), + False)\ + if dictionary.get("expiration_interval") is not None\ + else APIHelper.SKIP + expiration_interval_unit =\ + dictionary.get("expiration_interval_unit")\ + if "expiration_interval_unit" in dictionary.keys()\ + else APIHelper.SKIP + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_in_cents, interval, @@ -187,7 +245,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -198,56 +256,192 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if isinstance(dictionary, cls): - return UnionTypeLookUp.get('SubscriptionCustomPricePriceInCents').validate(dictionary.price_in_cents).is_valid \ - and UnionTypeLookUp.get('SubscriptionCustomPriceInterval').validate(dictionary.interval).is_valid \ - and APIHelper.is_valid_type(value=dictionary.interval_unit, - type_callable=lambda value: IntervalUnit.validate(value), - is_value_nullable=True) + return (UnionTypeLookUp.get("SubscriptionCustomPricePriceInCents") + .validate(dictionary.price_in_cents).is_valid) \ + and (UnionTypeLookUp.get("SubscriptionCustomPriceInterval") + .validate(dictionary.interval).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.interval_unit, + type_callable=lambda value: + IntervalUnit.validate(value), + is_value_nullable=True) if not isinstance(dictionary, dict): return False - return UnionTypeLookUp.get('SubscriptionCustomPricePriceInCents').validate(dictionary.get('price_in_cents')).is_valid \ - and UnionTypeLookUp.get('SubscriptionCustomPriceInterval').validate(dictionary.get('interval')).is_valid \ - and APIHelper.is_valid_type(value=dictionary.get('interval_unit'), - type_callable=lambda value: IntervalUnit.validate(value), - is_value_nullable=True) + return (UnionTypeLookUp.get("SubscriptionCustomPricePriceInCents") + .validate(dictionary.get("price_in_cents")).is_valid) \ + and (UnionTypeLookUp.get("SubscriptionCustomPriceInterval") + .validate(dictionary.get("interval")).is_valid) \ + and APIHelper.is_valid_type( + value=dictionary.get("interval_unit"), + type_callable=lambda value: + IntervalUnit.validate(value), + is_value_nullable=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'price_in_cents={self.price_in_cents!r}, ' - f'interval={self.interval!r}, ' - f'interval_unit={self.interval_unit!r}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!r}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!r}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!r}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!r}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!r}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!r}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!r}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!r}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"trial_price_in_cents={_trial_price_in_cents!r}, " + f"trial_interval={_trial_interval!r}, " + f"trial_interval_unit={_trial_interval_unit!r}, " + f"trial_type={_trial_type!r}, " + f"initial_charge_in_cents={_initial_charge_in_cents!r}, " + f"initial_charge_after_trial={_initial_charge_after_trial!r}, " + f"expiration_interval={_expiration_interval!r}, " + f"expiration_interval_unit={_expiration_interval_unit!r}, " + f"tax_included={_tax_included!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'price_in_cents={self.price_in_cents!s}, ' - f'interval={self.interval!s}, ' - f'interval_unit={self.interval_unit!s}, ' - f'trial_price_in_cents={(self.trial_price_in_cents if hasattr(self, "trial_price_in_cents") else None)!s}, ' - f'trial_interval={(self.trial_interval if hasattr(self, "trial_interval") else None)!s}, ' - f'trial_interval_unit={(self.trial_interval_unit if hasattr(self, "trial_interval_unit") else None)!s}, ' - f'trial_type={(self.trial_type if hasattr(self, "trial_type") else None)!s}, ' - f'initial_charge_in_cents={(self.initial_charge_in_cents if hasattr(self, "initial_charge_in_cents") else None)!s}, ' - f'initial_charge_after_trial={(self.initial_charge_after_trial if hasattr(self, "initial_charge_after_trial") else None)!s}, ' - f'expiration_interval={(self.expiration_interval if hasattr(self, "expiration_interval") else None)!s}, ' - f'expiration_interval_unit={(self.expiration_interval_unit if hasattr(self, "expiration_interval_unit") else None)!s}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=self.price_in_cents + _interval=self.interval + _interval_unit=self.interval_unit + _trial_price_in_cents=( + self.trial_price_in_cents + if hasattr(self, "trial_price_in_cents") + else None + ) + _trial_interval=( + self.trial_interval + if hasattr(self, "trial_interval") + else None + ) + _trial_interval_unit=( + self.trial_interval_unit + if hasattr(self, "trial_interval_unit") + else None + ) + _trial_type=( + self.trial_type + if hasattr(self, "trial_type") + else None + ) + _initial_charge_in_cents=( + self.initial_charge_in_cents + if hasattr(self, "initial_charge_in_cents") + else None + ) + _initial_charge_after_trial=( + self.initial_charge_after_trial + if hasattr(self, "initial_charge_after_trial") + else None + ) + _expiration_interval=( + self.expiration_interval + if hasattr(self, "expiration_interval") + else None + ) + _expiration_interval_unit=( + self.expiration_interval_unit + if hasattr(self, "expiration_interval_unit") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"trial_price_in_cents={_trial_price_in_cents!s}, " + f"trial_interval={_trial_interval!s}, " + f"trial_interval_unit={_trial_interval_unit!s}, " + f"trial_type={_trial_type!s}, " + f"initial_charge_in_cents={_initial_charge_in_cents!s}, " + f"initial_charge_after_trial={_initial_charge_after_trial!s}, " + f"expiration_interval={_expiration_interval!s}, " + f"expiration_interval_unit={_expiration_interval_unit!s}, " + f"tax_included={_tax_included!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_date_field.py b/advancedbilling/models/subscription_date_field.py index e17d3d8e..a305c88d 100644 --- a/advancedbilling/models/subscription_date_field.py +++ b/advancedbilling/models/subscription_date_field.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionDateField(object): - """Implementation of the 'Subscription Date Field' enum. Attributes: @@ -22,30 +19,32 @@ class SubscriptionDateField(object): TRIAL_STARTED_AT: The enum member of type str. TRIAL_ENDED_AT: The enum member of type str. UPDATED_AT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CURRENT_PERIOD_ENDS_AT = 'current_period_ends_at' - CURRENT_PERIOD_STARTS_AT = 'current_period_starts_at' + CURRENT_PERIOD_ENDS_AT = "current_period_ends_at" + + CURRENT_PERIOD_STARTS_AT = "current_period_starts_at" - CREATED_AT = 'created_at' + CREATED_AT = "created_at" - ACTIVATED_AT = 'activated_at' + ACTIVATED_AT = "activated_at" - CANCELED_AT = 'canceled_at' + CANCELED_AT = "canceled_at" - EXPIRES_AT = 'expires_at' + EXPIRES_AT = "expires_at" - TRIAL_STARTED_AT = 'trial_started_at' + TRIAL_STARTED_AT = "trial_started_at" - TRIAL_ENDED_AT = 'trial_ended_at' + TRIAL_ENDED_AT = "trial_ended_at" - UPDATED_AT = 'updated_at' + UPDATED_AT = "updated_at" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_filter.py b/advancedbilling/models/subscription_filter.py index b4c89210..e229780a 100644 --- a/advancedbilling/models/subscription_filter.py +++ b/advancedbilling/models/subscription_filter.py @@ -1,108 +1,106 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 import dateutil.parser from advancedbilling.api_helper import APIHelper class SubscriptionFilter(object): - """Implementation of the 'Subscription Filter' model. Nested filter used for List Subscription Components For Site Filter Attributes: states (List[SubscriptionStateFilter]): Allows fetching components - allocations that belong to the subscription with matching states - based on provided values. To use this filter you also have to - include the following param in the request `include=subscription`. - Use in query - `filter[subscription][states]=active,canceled&include=subscription` - . - date_field (SubscriptionListDateField): The type of filter you'd like - to apply to your search. To use this filter you also have to - include the following param in the request `include=subscription`. - start_date (date): The start date (format YYYY-MM-DD) with which to - filter the date_field. Returns components that belong to the - subscription with a timestamp at or after midnight (12:00:00 AM) - in your site’s time zone on the date specified. To use this filter - you also have to include the following param in the request - `include=subscription`. - end_date (date): The end date (format YYYY-MM-DD) with which to filter - the date_field. Returns components that belong to the subscription - with a timestamp up to and including 11:59:59PM in your site’s - time zone on the date specified. To use this filter you also have - to include the following param in the request - `include=subscription`. + allocations that belong to the subscription with matching states based on + provided values. To use this filter you also have to include the + following param in the request `include=subscription`. Use in query + `filter[subscription][states]=active,canceled&include=subscription`. + date_field (SubscriptionListDateField): The type of filter you'd like to + apply to your search. To use this filter you also have to include the + following param in the request `include=subscription`. + start_date (date): The start date (format YYYY-MM-DD) with which to filter + the date_field. Returns components that belong to the subscription with a + timestamp at or after midnight (12:00:00 AM) in your site’s time zone on + the date specified. To use this filter you also have to include the + following param in the request `include=subscription`. + end_date (date): The end date (format YYYY-MM-DD) with which to filter the + date_field. Returns components that belong to the subscription with a + timestamp up to and including 11:59:59PM in your site’s time zone on the + date specified. To use this filter you also have to include the following + param in the request `include=subscription`. start_datetime (datetime): The start date and time (format YYYY-MM-DD - HH:MM:SS) with which to filter the date_field. Returns components - that belong to the subscription with a timestamp at or after exact - time provided in query. You can specify timezone in query - - otherwise your site''s time zone will be used. If provided, this - parameter will be used instead of start_date. To use this filter - you also have to include the following param in the request - `include=subscription`. - end_datetime (datetime): The end date and time (format YYYY-MM-DD - HH:MM:SS) with which to filter the date_field. Returns components - that belong to the subscription with a timestamp at or before - exact time provided in query. You can specify timezone in query - - otherwise your site''s time zone will be used. If provided, this - parameter will be used instead of end_date. To use this filter you - also have to include the following param in the request - `include=subscription`. - additional_properties (Dict[str, object]): The additional properties - for the model. + HH:MM:SS) with which to filter the date_field. Returns components that + belong to the subscription with a timestamp at or after exact time + provided in query. You can specify timezone in query - otherwise your + site''s time zone will be used. If provided, this parameter will be used + instead of start_date. To use this filter you also have to include the + following param in the request `include=subscription`. + end_datetime (datetime): The end date and time (format YYYY-MM-DD HH:MM:SS) + with which to filter the date_field. Returns components that belong to + the subscription with a timestamp at or before exact time provided in + query. You can specify timezone in query - otherwise your site''s time + zone will be used. If provided, this parameter will be used instead of + end_date. To use this filter you also have to include the following param + in the request `include=subscription`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "states": 'states', - "date_field": 'date_field', - "start_date": 'start_date', - "end_date": 'end_date', - "start_datetime": 'start_datetime', - "end_datetime": 'end_datetime' + "states": "states", + "date_field": "date_field", + "start_date": "start_date", + "end_date": "end_date", + "start_datetime": "start_datetime", + "end_datetime": "end_datetime", } _optionals = [ - 'states', - 'date_field', - 'start_date', - 'end_date', - 'start_datetime', - 'end_datetime', + "states", + "date_field", + "start_date", + "end_date", + "start_datetime", + "end_datetime", ] - def __init__(self, - states=APIHelper.SKIP, - date_field=APIHelper.SKIP, - start_date=APIHelper.SKIP, - end_date=APIHelper.SKIP, - start_datetime=APIHelper.SKIP, - end_datetime=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionFilter class""" - + def __init__( + self, + states=APIHelper.SKIP, + date_field=APIHelper.SKIP, + start_date=APIHelper.SKIP, + end_date=APIHelper.SKIP, + start_datetime=APIHelper.SKIP, + end_datetime=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionFilter instance.""" # Initialize members of the class if states is not APIHelper.SKIP: - self.states = states + self.states = states if date_field is not APIHelper.SKIP: - self.date_field = date_field + self.date_field = date_field if start_date is not APIHelper.SKIP: - self.start_date = start_date + self.start_date = start_date if end_date is not APIHelper.SKIP: - self.end_date = end_date + self.end_date = end_date if start_datetime is not APIHelper.SKIP: - self.start_datetime = APIHelper.apply_datetime_converter(start_datetime, APIHelper.RFC3339DateTime) if start_datetime else None + self.start_datetime =\ + APIHelper.apply_datetime_converter( + start_datetime, APIHelper.RFC3339DateTime)\ + if start_datetime else None if end_datetime is not APIHelper.SKIP: - self.end_datetime = APIHelper.apply_datetime_converter(end_datetime, APIHelper.RFC3339DateTime) if end_datetime else None + self.end_datetime =\ + APIHelper.apply_datetime_converter( + end_datetime, APIHelper.RFC3339DateTime)\ + if end_datetime else None # Add additional model properties to the instance if additional_properties is None: @@ -112,7 +110,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -123,19 +121,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - states = dictionary.get("states") if dictionary.get("states") else APIHelper.SKIP - date_field = dictionary.get("date_field") if dictionary.get("date_field") else APIHelper.SKIP - start_date = dateutil.parser.parse(dictionary.get('start_date')).date() if dictionary.get('start_date') else APIHelper.SKIP - end_date = dateutil.parser.parse(dictionary.get('end_date')).date() if dictionary.get('end_date') else APIHelper.SKIP - start_datetime = APIHelper.RFC3339DateTime.from_value(dictionary.get("start_datetime")).datetime if dictionary.get("start_datetime") else APIHelper.SKIP - end_datetime = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_datetime")).datetime if dictionary.get("end_datetime") else APIHelper.SKIP + states =\ + dictionary.get("states")\ + if dictionary.get("states")\ + else APIHelper.SKIP + date_field =\ + dictionary.get("date_field")\ + if dictionary.get("date_field")\ + else APIHelper.SKIP + start_date = dateutil.parser.parse( + dictionary.get("start_date")).date()\ + if dictionary.get("start_date") else APIHelper.SKIP + end_date = dateutil.parser.parse( + dictionary.get("end_date")).date()\ + if dictionary.get("end_date") else APIHelper.SKIP + start_datetime = APIHelper.RFC3339DateTime.from_value( + dictionary.get("start_datetime")).datetime\ + if dictionary.get("start_datetime") else APIHelper.SKIP + end_datetime = APIHelper.RFC3339DateTime.from_value( + dictionary.get("end_datetime")).datetime\ + if dictionary.get("end_datetime") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(states, date_field, @@ -146,21 +160,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'states={(self.states if hasattr(self, "states") else None)!r}, ' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!r}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!r}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!r}, ' - f'start_datetime={(self.start_datetime if hasattr(self, "start_datetime") else None)!r}, ' - f'end_datetime={(self.end_datetime if hasattr(self, "end_datetime") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _states=( + self.states + if hasattr(self, "states") + else None + ) + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _start_datetime=( + self.start_datetime + if hasattr(self, "start_datetime") + else None + ) + _end_datetime=( + self.end_datetime + if hasattr(self, "end_datetime") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"states={_states!r}, " + f"date_field={_date_field!r}, " + f"start_date={_start_date!r}, " + f"end_date={_end_date!r}, " + f"start_datetime={_start_datetime!r}, " + f"end_datetime={_end_datetime!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'states={(self.states if hasattr(self, "states") else None)!s}, ' - f'date_field={(self.date_field if hasattr(self, "date_field") else None)!s}, ' - f'start_date={(self.start_date if hasattr(self, "start_date") else None)!s}, ' - f'end_date={(self.end_date if hasattr(self, "end_date") else None)!s}, ' - f'start_datetime={(self.start_datetime if hasattr(self, "start_datetime") else None)!s}, ' - f'end_datetime={(self.end_datetime if hasattr(self, "end_datetime") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _states=( + self.states + if hasattr(self, "states") + else None + ) + _date_field=( + self.date_field + if hasattr(self, "date_field") + else None + ) + _start_date=( + self.start_date + if hasattr(self, "start_date") + else None + ) + _end_date=( + self.end_date + if hasattr(self, "end_date") + else None + ) + _start_datetime=( + self.start_datetime + if hasattr(self, "start_datetime") + else None + ) + _end_datetime=( + self.end_datetime + if hasattr(self, "end_datetime") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"states={_states!s}, " + f"date_field={_date_field!s}, " + f"start_date={_start_date!s}, " + f"end_date={_end_date!s}, " + f"start_datetime={_start_datetime!s}, " + f"end_datetime={_end_datetime!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group.py b/advancedbilling/models/subscription_group.py index c1253344..7515fb75 100644 --- a/advancedbilling/models/subscription_group.py +++ b/advancedbilling/models/subscription_group.py @@ -1,72 +1,80 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_group_payment_profile import SubscriptionGroupPaymentProfile +from advancedbilling.models.subscription_group_payment_profile import ( + SubscriptionGroupPaymentProfile, +) class SubscriptionGroup(object): - """Implementation of the 'Subscription Group' model. Attributes: + uid (str): The model property of type str. customer_id (int): The model property of type int. - payment_profile (SubscriptionGroupPaymentProfile): The model property - of type SubscriptionGroupPaymentProfile. - payment_collection_method (CollectionMethod): The type of payment - collection to be used in the subscription. For legacy Statements - Architecture valid options are - `invoice`, `automatic`. For - current Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. + payment_profile (SubscriptionGroupPaymentProfile): The model property of type + SubscriptionGroupPaymentProfile. + payment_collection_method (CollectionMethod): The type of payment collection + to be used in the subscription. For legacy Statements Architecture valid + options are - `invoice`, `automatic`. For current Relationship Invoicing + Architecture valid options are - `remittance`, `automatic`, `prepaid`. subscription_ids (List[int]): The model property of type List[int]. created_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "customer_id": 'customer_id', - "payment_profile": 'payment_profile', - "payment_collection_method": 'payment_collection_method', - "subscription_ids": 'subscription_ids', - "created_at": 'created_at' + "uid": "uid", + "customer_id": "customer_id", + "payment_profile": "payment_profile", + "payment_collection_method": "payment_collection_method", + "subscription_ids": "subscription_ids", + "created_at": "created_at", } _optionals = [ - 'customer_id', - 'payment_profile', - 'payment_collection_method', - 'subscription_ids', - 'created_at', + "uid", + "customer_id", + "payment_profile", + "payment_collection_method", + "subscription_ids", + "created_at", ] - def __init__(self, - customer_id=APIHelper.SKIP, - payment_profile=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - subscription_ids=APIHelper.SKIP, - created_at=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroup class""" - + def __init__( + self, + uid=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + payment_profile=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + subscription_ids=APIHelper.SKIP, + created_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroup instance.""" # Initialize members of the class + if uid is not APIHelper.SKIP: + self.uid = uid if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if payment_profile is not APIHelper.SKIP: - self.payment_profile = payment_profile + self.payment_profile = payment_profile if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method if subscription_ids is not APIHelper.SKIP: - self.subscription_ids = subscription_ids + self.subscription_ids = subscription_ids if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +84,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,20 +95,42 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - payment_profile = SubscriptionGroupPaymentProfile.from_dictionary(dictionary.get('payment_profile')) if 'payment_profile' in dictionary.keys() else APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP - subscription_ids = dictionary.get("subscription_ids") if dictionary.get("subscription_ids") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + payment_profile =\ + SubscriptionGroupPaymentProfile.from_dictionary( + dictionary.get("payment_profile"))\ + if "payment_profile" in dictionary.keys()\ + else APIHelper.SKIP + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + subscription_ids =\ + dictionary.get("subscription_ids")\ + if dictionary.get("subscription_ids")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model - return cls(customer_id, + return cls(uid, + customer_id, payment_profile, payment_collection_method, subscription_ids, @@ -108,19 +138,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'payment_profile={(self.payment_profile if hasattr(self, "payment_profile") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile=( + self.payment_profile + if hasattr(self, "payment_profile") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"customer_id={_customer_id!r}, " + f"payment_profile={_payment_profile!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"subscription_ids={_subscription_ids!r}, " + f"created_at={_created_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'payment_profile={(self.payment_profile if hasattr(self, "payment_profile") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile=( + self.payment_profile + if hasattr(self, "payment_profile") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"customer_id={_customer_id!s}, " + f"payment_profile={_payment_profile!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"subscription_ids={_subscription_ids!s}, " + f"created_at={_created_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_balances.py b/advancedbilling/models/subscription_group_balances.py index 356337db..14e153c6 100644 --- a/advancedbilling/models/subscription_group_balances.py +++ b/advancedbilling/models/subscription_group_balances.py @@ -1,65 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.account_balance import AccountBalance +from advancedbilling.models.account_balance import ( + AccountBalance, +) class SubscriptionGroupBalances(object): - """Implementation of the 'Subscription Group Balances' model. Attributes: - prepayments (AccountBalance): The model property of type - AccountBalance. - service_credits (AccountBalance): The model property of type - AccountBalance. - open_invoices (AccountBalance): The model property of type - AccountBalance. - pending_discounts (AccountBalance): The model property of type - AccountBalance. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepayments (AccountBalance): The model property of type AccountBalance. + service_credits (AccountBalance): The model property of type AccountBalance. + open_invoices (AccountBalance): The model property of type AccountBalance. + pending_discounts (AccountBalance): The model property of type AccountBalance. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayments": 'prepayments', - "service_credits": 'service_credits', - "open_invoices": 'open_invoices', - "pending_discounts": 'pending_discounts' + "prepayments": "prepayments", + "service_credits": "service_credits", + "open_invoices": "open_invoices", + "pending_discounts": "pending_discounts", } _optionals = [ - 'prepayments', - 'service_credits', - 'open_invoices', - 'pending_discounts', + "prepayments", + "service_credits", + "open_invoices", + "pending_discounts", ] - def __init__(self, - prepayments=APIHelper.SKIP, - service_credits=APIHelper.SKIP, - open_invoices=APIHelper.SKIP, - pending_discounts=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupBalances class""" - + def __init__( + self, + prepayments=APIHelper.SKIP, + service_credits=APIHelper.SKIP, + open_invoices=APIHelper.SKIP, + pending_discounts=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupBalances instance.""" # Initialize members of the class if prepayments is not APIHelper.SKIP: - self.prepayments = prepayments + self.prepayments = prepayments if service_credits is not APIHelper.SKIP: - self.service_credits = service_credits + self.service_credits = service_credits if open_invoices is not APIHelper.SKIP: - self.open_invoices = open_invoices + self.open_invoices = open_invoices if pending_discounts is not APIHelper.SKIP: - self.pending_discounts = pending_discounts + self.pending_discounts = pending_discounts # Add additional model properties to the instance if additional_properties is None: @@ -69,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -80,17 +76,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepayments = AccountBalance.from_dictionary(dictionary.get('prepayments')) if 'prepayments' in dictionary.keys() else APIHelper.SKIP - service_credits = AccountBalance.from_dictionary(dictionary.get('service_credits')) if 'service_credits' in dictionary.keys() else APIHelper.SKIP - open_invoices = AccountBalance.from_dictionary(dictionary.get('open_invoices')) if 'open_invoices' in dictionary.keys() else APIHelper.SKIP - pending_discounts = AccountBalance.from_dictionary(dictionary.get('pending_discounts')) if 'pending_discounts' in dictionary.keys() else APIHelper.SKIP + prepayments =\ + AccountBalance.from_dictionary( + dictionary.get("prepayments"))\ + if "prepayments" in dictionary.keys()\ + else APIHelper.SKIP + service_credits =\ + AccountBalance.from_dictionary( + dictionary.get("service_credits"))\ + if "service_credits" in dictionary.keys()\ + else APIHelper.SKIP + open_invoices =\ + AccountBalance.from_dictionary( + dictionary.get("open_invoices"))\ + if "open_invoices" in dictionary.keys()\ + else APIHelper.SKIP + pending_discounts =\ + AccountBalance.from_dictionary( + dictionary.get("pending_discounts"))\ + if "pending_discounts" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayments, service_credits, @@ -99,17 +113,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayments={(self.prepayments if hasattr(self, "prepayments") else None)!r}, ' - f'service_credits={(self.service_credits if hasattr(self, "service_credits") else None)!r}, ' - f'open_invoices={(self.open_invoices if hasattr(self, "open_invoices") else None)!r}, ' - f'pending_discounts={(self.pending_discounts if hasattr(self, "pending_discounts") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayments=( + self.prepayments + if hasattr(self, "prepayments") + else None + ) + _service_credits=( + self.service_credits + if hasattr(self, "service_credits") + else None + ) + _open_invoices=( + self.open_invoices + if hasattr(self, "open_invoices") + else None + ) + _pending_discounts=( + self.pending_discounts + if hasattr(self, "pending_discounts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayments={_prepayments!r}, " + f"service_credits={_service_credits!r}, " + f"open_invoices={_open_invoices!r}, " + f"pending_discounts={_pending_discounts!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayments={(self.prepayments if hasattr(self, "prepayments") else None)!s}, ' - f'service_credits={(self.service_credits if hasattr(self, "service_credits") else None)!s}, ' - f'open_invoices={(self.open_invoices if hasattr(self, "open_invoices") else None)!s}, ' - f'pending_discounts={(self.pending_discounts if hasattr(self, "pending_discounts") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayments=( + self.prepayments + if hasattr(self, "prepayments") + else None + ) + _service_credits=( + self.service_credits + if hasattr(self, "service_credits") + else None + ) + _open_invoices=( + self.open_invoices + if hasattr(self, "open_invoices") + else None + ) + _pending_discounts=( + self.pending_discounts + if hasattr(self, "pending_discounts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayments={_prepayments!s}, " + f"service_credits={_service_credits!s}, " + f"open_invoices={_open_invoices!s}, " + f"pending_discounts={_pending_discounts!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_bank_account.py b/advancedbilling/models/subscription_group_bank_account.py index d274627c..9791f42f 100644 --- a/advancedbilling/models/subscription_group_bank_account.py +++ b/advancedbilling/models/subscription_group_bank_account.py @@ -1,32 +1,28 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupBankAccount(object): - """Implementation of the 'Subscription Group Bank Account' model. Attributes: bank_name (str): (Required when creating a subscription with ACH or - GoCardless) The name of the bank where the customer’s account - resides - bank_account_number (str): (Required when creating a subscription with - ACH. Required when creating a subscription with GoCardless and - bank_iban is blank) The customerʼs bank account number - bank_routing_number (str): (Required when creating a subscription with - ACH. Optional when creating a subscription with GoCardless). The - routing number of the bank. It becomes bank_code while passing via - GoCardless API - bank_iban (str): (Optional when creating a subscription with - GoCardless). International Bank Account Number. Alternatively, - local bank details can be provided + GoCardless) The name of the bank where the customer’s account resides + bank_account_number (str): (Required when creating a subscription with ACH. + Required when creating a subscription with GoCardless and bank_iban is + blank) The customerʼs bank account number + bank_routing_number (str): (Required when creating a subscription with ACH. + Optional when creating a subscription with GoCardless). The routing + number of the bank. It becomes bank_code while passing via GoCardless API + bank_iban (str): (Optional when creating a subscription with GoCardless). + International Bank Account Number. Alternatively, local bank details can + be provided bank_branch_code (str): (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided bank_account_type (BankAccountType): Defaults to checking @@ -38,106 +34,106 @@ class SubscriptionGroupBankAccount(object): billing_zip (str): The model property of type str. billing_country (str): The model property of type str. chargify_token (str): The model property of type str. - current_vault (BankAccountVault): The vault that stores the payment - profile with the provided vault_token. Use `bogus` for testing. + current_vault (BankAccountVault): The vault that stores the payment profile + with the provided vault_token. Use `bogus` for testing. gateway_handle (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "bank_name": 'bank_name', - "bank_account_number": 'bank_account_number', - "bank_routing_number": 'bank_routing_number', - "bank_iban": 'bank_iban', - "bank_branch_code": 'bank_branch_code', - "bank_account_type": 'bank_account_type', - "bank_account_holder_type": 'bank_account_holder_type', - "payment_type": 'payment_type', - "billing_address": 'billing_address', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "billing_country": 'billing_country', - "chargify_token": 'chargify_token', - "current_vault": 'current_vault', - "gateway_handle": 'gateway_handle' + "bank_name": "bank_name", + "bank_account_number": "bank_account_number", + "bank_routing_number": "bank_routing_number", + "bank_iban": "bank_iban", + "bank_branch_code": "bank_branch_code", + "bank_account_type": "bank_account_type", + "bank_account_holder_type": "bank_account_holder_type", + "payment_type": "payment_type", + "billing_address": "billing_address", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "billing_country": "billing_country", + "chargify_token": "chargify_token", + "current_vault": "current_vault", + "gateway_handle": "gateway_handle", } _optionals = [ - 'bank_name', - 'bank_account_number', - 'bank_routing_number', - 'bank_iban', - 'bank_branch_code', - 'bank_account_type', - 'bank_account_holder_type', - 'payment_type', - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'chargify_token', - 'current_vault', - 'gateway_handle', + "bank_name", + "bank_account_number", + "bank_routing_number", + "bank_iban", + "bank_branch_code", + "bank_account_type", + "bank_account_holder_type", + "payment_type", + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "chargify_token", + "current_vault", + "gateway_handle", ] - def __init__(self, - bank_name=APIHelper.SKIP, - bank_account_number=APIHelper.SKIP, - bank_routing_number=APIHelper.SKIP, - bank_iban=APIHelper.SKIP, - bank_branch_code=APIHelper.SKIP, - bank_account_type=APIHelper.SKIP, - bank_account_holder_type=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - chargify_token=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupBankAccount class""" - + def __init__( + self, + bank_name=APIHelper.SKIP, + bank_account_number=APIHelper.SKIP, + bank_routing_number=APIHelper.SKIP, + bank_iban=APIHelper.SKIP, + bank_branch_code=APIHelper.SKIP, + bank_account_type=APIHelper.SKIP, + bank_account_holder_type=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + chargify_token=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupBankAccount instance.""" # Initialize members of the class if bank_name is not APIHelper.SKIP: - self.bank_name = bank_name + self.bank_name = bank_name if bank_account_number is not APIHelper.SKIP: - self.bank_account_number = bank_account_number + self.bank_account_number = bank_account_number if bank_routing_number is not APIHelper.SKIP: - self.bank_routing_number = bank_routing_number + self.bank_routing_number = bank_routing_number if bank_iban is not APIHelper.SKIP: - self.bank_iban = bank_iban + self.bank_iban = bank_iban if bank_branch_code is not APIHelper.SKIP: - self.bank_branch_code = bank_branch_code + self.bank_branch_code = bank_branch_code if bank_account_type is not APIHelper.SKIP: - self.bank_account_type = bank_account_type + self.bank_account_type = bank_account_type if bank_account_holder_type is not APIHelper.SKIP: - self.bank_account_holder_type = bank_account_holder_type + self.bank_account_holder_type = bank_account_holder_type if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type + self.payment_type = payment_type if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if chargify_token is not APIHelper.SKIP: - self.chargify_token = chargify_token + self.chargify_token = chargify_token if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle # Add additional model properties to the instance if additional_properties is None: @@ -147,7 +143,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -158,29 +154,79 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - bank_name = dictionary.get("bank_name") if dictionary.get("bank_name") else APIHelper.SKIP - bank_account_number = dictionary.get("bank_account_number") if dictionary.get("bank_account_number") else APIHelper.SKIP - bank_routing_number = dictionary.get("bank_routing_number") if dictionary.get("bank_routing_number") else APIHelper.SKIP - bank_iban = dictionary.get("bank_iban") if dictionary.get("bank_iban") else APIHelper.SKIP - bank_branch_code = dictionary.get("bank_branch_code") if dictionary.get("bank_branch_code") else APIHelper.SKIP - bank_account_type = dictionary.get("bank_account_type") if dictionary.get("bank_account_type") else APIHelper.SKIP - bank_account_holder_type = dictionary.get("bank_account_holder_type") if dictionary.get("bank_account_holder_type") else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if dictionary.get("billing_address") else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if dictionary.get("billing_city") else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if dictionary.get("billing_state") else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if dictionary.get("billing_zip") else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if dictionary.get("billing_country") else APIHelper.SKIP - chargify_token = dictionary.get("chargify_token") if dictionary.get("chargify_token") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if dictionary.get("gateway_handle") else APIHelper.SKIP + bank_name =\ + dictionary.get("bank_name")\ + if dictionary.get("bank_name")\ + else APIHelper.SKIP + bank_account_number =\ + dictionary.get("bank_account_number")\ + if dictionary.get("bank_account_number")\ + else APIHelper.SKIP + bank_routing_number =\ + dictionary.get("bank_routing_number")\ + if dictionary.get("bank_routing_number")\ + else APIHelper.SKIP + bank_iban =\ + dictionary.get("bank_iban")\ + if dictionary.get("bank_iban")\ + else APIHelper.SKIP + bank_branch_code =\ + dictionary.get("bank_branch_code")\ + if dictionary.get("bank_branch_code")\ + else APIHelper.SKIP + bank_account_type =\ + dictionary.get("bank_account_type")\ + if dictionary.get("bank_account_type")\ + else APIHelper.SKIP + bank_account_holder_type =\ + dictionary.get("bank_account_holder_type")\ + if dictionary.get("bank_account_holder_type")\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if dictionary.get("billing_address")\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if dictionary.get("billing_city")\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if dictionary.get("billing_state")\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if dictionary.get("billing_zip")\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if dictionary.get("billing_country")\ + else APIHelper.SKIP + chargify_token =\ + dictionary.get("chargify_token")\ + if dictionary.get("chargify_token")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if dictionary.get("gateway_handle")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(bank_name, bank_account_number, @@ -202,7 +248,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -213,7 +259,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -223,41 +268,211 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!r}, ' - f'bank_account_number={(self.bank_account_number if hasattr(self, "bank_account_number") else None)!r}, ' - f'bank_routing_number={(self.bank_routing_number if hasattr(self, "bank_routing_number") else None)!r}, ' - f'bank_iban={(self.bank_iban if hasattr(self, "bank_iban") else None)!r}, ' - f'bank_branch_code={(self.bank_branch_code if hasattr(self, "bank_branch_code") else None)!r}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!r}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _bank_account_number=( + self.bank_account_number + if hasattr(self, "bank_account_number") + else None + ) + _bank_routing_number=( + self.bank_routing_number + if hasattr(self, "bank_routing_number") + else None + ) + _bank_iban=( + self.bank_iban + if hasattr(self, "bank_iban") + else None + ) + _bank_branch_code=( + self.bank_branch_code + if hasattr(self, "bank_branch_code") + else None + ) + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"bank_name={_bank_name!r}, " + f"bank_account_number={_bank_account_number!r}, " + f"bank_routing_number={_bank_routing_number!r}, " + f"bank_iban={_bank_iban!r}, " + f"bank_branch_code={_bank_branch_code!r}, " + f"bank_account_type={_bank_account_type!r}, " + f"bank_account_holder_type={_bank_account_holder_type!r}, " + f"payment_type={_payment_type!r}, " + f"billing_address={_billing_address!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"billing_country={_billing_country!r}, " + f"chargify_token={_chargify_token!r}, " + f"current_vault={_current_vault!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'bank_name={(self.bank_name if hasattr(self, "bank_name") else None)!s}, ' - f'bank_account_number={(self.bank_account_number if hasattr(self, "bank_account_number") else None)!s}, ' - f'bank_routing_number={(self.bank_routing_number if hasattr(self, "bank_routing_number") else None)!s}, ' - f'bank_iban={(self.bank_iban if hasattr(self, "bank_iban") else None)!s}, ' - f'bank_branch_code={(self.bank_branch_code if hasattr(self, "bank_branch_code") else None)!s}, ' - f'bank_account_type={(self.bank_account_type if hasattr(self, "bank_account_type") else None)!s}, ' - f'bank_account_holder_type={(self.bank_account_holder_type if hasattr(self, "bank_account_holder_type") else None)!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _bank_name=( + self.bank_name + if hasattr(self, "bank_name") + else None + ) + _bank_account_number=( + self.bank_account_number + if hasattr(self, "bank_account_number") + else None + ) + _bank_routing_number=( + self.bank_routing_number + if hasattr(self, "bank_routing_number") + else None + ) + _bank_iban=( + self.bank_iban + if hasattr(self, "bank_iban") + else None + ) + _bank_branch_code=( + self.bank_branch_code + if hasattr(self, "bank_branch_code") + else None + ) + _bank_account_type=( + self.bank_account_type + if hasattr(self, "bank_account_type") + else None + ) + _bank_account_holder_type=( + self.bank_account_holder_type + if hasattr(self, "bank_account_holder_type") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"bank_name={_bank_name!s}, " + f"bank_account_number={_bank_account_number!s}, " + f"bank_routing_number={_bank_routing_number!s}, " + f"bank_iban={_bank_iban!s}, " + f"bank_branch_code={_bank_branch_code!s}, " + f"bank_account_type={_bank_account_type!s}, " + f"bank_account_holder_type={_bank_account_holder_type!s}, " + f"payment_type={_payment_type!s}, " + f"billing_address={_billing_address!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"billing_country={_billing_country!s}, " + f"chargify_token={_chargify_token!s}, " + f"current_vault={_current_vault!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_component_custom_price.py b/advancedbilling/models/subscription_group_component_custom_price.py index c574c0ae..e19b134a 100644 --- a/advancedbilling/models/subscription_group_component_custom_price.py +++ b/advancedbilling/models/subscription_group_component_custom_price.py @@ -1,63 +1,63 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.component_custom_price import ( + ComponentCustomPrice, +) from advancedbilling.models.price import Price class SubscriptionGroupComponentCustomPrice(object): - """Implementation of the 'Subscription Group Component Custom Price' model. - Used in place of `price_point_id` to define a custom price point unique to - the subscription. You still need to provide `component_id`. + Used in place of `price_point_id` to define a custom price point unique to the + subscription. You still need to provide `component_id`. Attributes: - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. prices (List[Price]): The model property of type List[Price]. - overage_pricing (List[ComponentCustomPrice]): The model property of - type List[ComponentCustomPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + overage_pricing (List[ComponentCustomPrice]): The model property of type + List[ComponentCustomPrice]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "pricing_scheme": 'pricing_scheme', - "prices": 'prices', - "overage_pricing": 'overage_pricing' + "pricing_scheme": "pricing_scheme", + "prices": "prices", + "overage_pricing": "overage_pricing", } _optionals = [ - 'pricing_scheme', - 'prices', - 'overage_pricing', + "pricing_scheme", + "prices", + "overage_pricing", ] - def __init__(self, - pricing_scheme=APIHelper.SKIP, - prices=APIHelper.SKIP, - overage_pricing=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupComponentCustomPrice class""" - + def __init__( + self, + pricing_scheme=APIHelper.SKIP, + prices=APIHelper.SKIP, + overage_pricing=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupComponentCustomPrice instance.""" # Initialize members of the class if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices if overage_pricing is not APIHelper.SKIP: - self.overage_pricing = overage_pricing + self.overage_pricing = overage_pricing # Add additional model properties to the instance if additional_properties is None: @@ -67,7 +67,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -78,24 +78,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + Price.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP overage_pricing = None - if dictionary.get('overage_pricing') is not None: - overage_pricing = [ComponentCustomPrice.from_dictionary(x) for x in dictionary.get('overage_pricing')] + if dictionary.get("overage_pricing") is not None: + overage_pricing = [ + ComponentCustomPrice.from_dictionary(x) + for x in dictionary.get("overage_pricing") + ] else: overage_pricing = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(pricing_scheme, prices, @@ -104,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -115,7 +126,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -125,15 +135,55 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'overage_pricing={(self.overage_pricing if hasattr(self, "overage_pricing") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _overage_pricing=( + self.overage_pricing + if hasattr(self, "overage_pricing") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"overage_pricing={_overage_pricing!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'overage_pricing={(self.overage_pricing if hasattr(self, "overage_pricing") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _overage_pricing=( + self.overage_pricing + if hasattr(self, "overage_pricing") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"overage_pricing={_overage_pricing!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_credit_card.py b/advancedbilling/models/subscription_group_credit_card.py index f371b8ad..7a1aecc2 100644 --- a/advancedbilling/models/subscription_group_credit_card.py +++ b/advancedbilling/models/subscription_group_credit_card.py @@ -1,23 +1,21 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupCreditCard(object): - """Implementation of the 'Subscription Group Credit Card' model. Attributes: chargify_token (str): The model property of type str. vault_token (str): The model property of type str. - current_vault (CreditCardVault): The vault that stores the payment - profile with the provided `vault_token`. Use `bogus` for testing. + current_vault (CreditCardVault): The vault that stores the payment profile + with the provided `vault_token`. Use `bogus` for testing. gateway_handle (str): The model property of type str. first_name (str): The model property of type str. last_name (str): The model property of type str. @@ -27,134 +25,133 @@ class SubscriptionGroupCreditCard(object): billing_state (str): The model property of type str. billing_zip (str): The model property of type str. billing_country (str): The model property of type str. - full_number (str | int | None): The model property of type str | int | + full_number (str | int | None): The model property of type str | int | None. + expiration_month (str | int | None): The model property of type str | int | + None. + expiration_year (str | int | None): The model property of type str | int | None. - expiration_month (str | int | None): The model property of type str | - int | None. - expiration_year (str | int | None): The model property of type str | - int | None. last_four (str): The model property of type str. card_type (CardType): The type of card used. customer_vault_token (str): The model property of type str. cvv (str): The model property of type str. payment_type (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "chargify_token": 'chargify_token', - "vault_token": 'vault_token', - "current_vault": 'current_vault', - "gateway_handle": 'gateway_handle', - "first_name": 'first_name', - "last_name": 'last_name', - "billing_address": 'billing_address', - "billing_address_2": 'billing_address_2', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "billing_country": 'billing_country', - "full_number": 'full_number', - "expiration_month": 'expiration_month', - "expiration_year": 'expiration_year', - "last_four": 'last_four', - "card_type": 'card_type', - "customer_vault_token": 'customer_vault_token', - "cvv": 'cvv', - "payment_type": 'payment_type' + "chargify_token": "chargify_token", + "vault_token": "vault_token", + "current_vault": "current_vault", + "gateway_handle": "gateway_handle", + "first_name": "first_name", + "last_name": "last_name", + "billing_address": "billing_address", + "billing_address_2": "billing_address_2", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "billing_country": "billing_country", + "full_number": "full_number", + "expiration_month": "expiration_month", + "expiration_year": "expiration_year", + "last_four": "last_four", + "card_type": "card_type", + "customer_vault_token": "customer_vault_token", + "cvv": "cvv", + "payment_type": "payment_type", } _optionals = [ - 'chargify_token', - 'vault_token', - 'current_vault', - 'gateway_handle', - 'first_name', - 'last_name', - 'billing_address', - 'billing_address_2', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'full_number', - 'expiration_month', - 'expiration_year', - 'last_four', - 'card_type', - 'customer_vault_token', - 'cvv', - 'payment_type', + "chargify_token", + "vault_token", + "current_vault", + "gateway_handle", + "first_name", + "last_name", + "billing_address", + "billing_address_2", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "full_number", + "expiration_month", + "expiration_year", + "last_four", + "card_type", + "customer_vault_token", + "cvv", + "payment_type", ] - def __init__(self, - chargify_token=APIHelper.SKIP, - vault_token=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - gateway_handle=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - full_number=APIHelper.SKIP, - expiration_month=APIHelper.SKIP, - expiration_year=APIHelper.SKIP, - last_four=APIHelper.SKIP, - card_type=APIHelper.SKIP, - customer_vault_token=APIHelper.SKIP, - cvv=APIHelper.SKIP, - payment_type=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupCreditCard class""" - + def __init__( + self, + chargify_token=APIHelper.SKIP, + vault_token=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + full_number=APIHelper.SKIP, + expiration_month=APIHelper.SKIP, + expiration_year=APIHelper.SKIP, + last_four=APIHelper.SKIP, + card_type=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + cvv=APIHelper.SKIP, + payment_type=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupCreditCard instance.""" # Initialize members of the class if chargify_token is not APIHelper.SKIP: - self.chargify_token = chargify_token + self.chargify_token = chargify_token if vault_token is not APIHelper.SKIP: - self.vault_token = vault_token + self.vault_token = vault_token if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if gateway_handle is not APIHelper.SKIP: - self.gateway_handle = gateway_handle + self.gateway_handle = gateway_handle if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 + self.billing_address_2 = billing_address_2 if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if full_number is not APIHelper.SKIP: - self.full_number = full_number + self.full_number = full_number if expiration_month is not APIHelper.SKIP: - self.expiration_month = expiration_month + self.expiration_month = expiration_month if expiration_year is not APIHelper.SKIP: - self.expiration_year = expiration_year + self.expiration_year = expiration_year if last_four is not APIHelper.SKIP: - self.last_four = last_four + self.last_four = last_four if card_type is not APIHelper.SKIP: - self.card_type = card_type + self.card_type = card_type if customer_vault_token is not APIHelper.SKIP: - self.customer_vault_token = customer_vault_token + self.customer_vault_token = customer_vault_token if cvv is not APIHelper.SKIP: - self.cvv = cvv + self.cvv = cvv if payment_type is not APIHelper.SKIP: - self.payment_type = payment_type + self.payment_type = payment_type # Add additional model properties to the instance if additional_properties is None: @@ -164,7 +161,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -175,34 +172,105 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - chargify_token = dictionary.get("chargify_token") if dictionary.get("chargify_token") else APIHelper.SKIP - vault_token = dictionary.get("vault_token") if dictionary.get("vault_token") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - gateway_handle = dictionary.get("gateway_handle") if dictionary.get("gateway_handle") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if dictionary.get("billing_address") else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if dictionary.get("billing_address_2") else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if dictionary.get("billing_city") else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if dictionary.get("billing_state") else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if dictionary.get("billing_zip") else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if dictionary.get("billing_country") else APIHelper.SKIP - full_number = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupCreditCardFullNumber'), dictionary.get('full_number'), False) if dictionary.get('full_number') is not None else APIHelper.SKIP - expiration_month = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupCreditCardExpirationMonth'), dictionary.get('expiration_month'), False) if dictionary.get('expiration_month') is not None else APIHelper.SKIP - expiration_year = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupCreditCardExpirationYear'), dictionary.get('expiration_year'), False) if dictionary.get('expiration_year') is not None else APIHelper.SKIP - last_four = dictionary.get("last_four") if dictionary.get("last_four") else APIHelper.SKIP - card_type = dictionary.get("card_type") if dictionary.get("card_type") else APIHelper.SKIP - customer_vault_token = dictionary.get("customer_vault_token") if dictionary.get("customer_vault_token") else APIHelper.SKIP - cvv = dictionary.get("cvv") if dictionary.get("cvv") else APIHelper.SKIP - payment_type = dictionary.get("payment_type") if dictionary.get("payment_type") else APIHelper.SKIP + chargify_token =\ + dictionary.get("chargify_token")\ + if dictionary.get("chargify_token")\ + else APIHelper.SKIP + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if dictionary.get("gateway_handle")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if dictionary.get("billing_address")\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if dictionary.get("billing_address_2")\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if dictionary.get("billing_city")\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if dictionary.get("billing_state")\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if dictionary.get("billing_zip")\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if dictionary.get("billing_country")\ + else APIHelper.SKIP + full_number = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupCreditCardFullNumber"), + dictionary.get("full_number"), + False)\ + if dictionary.get("full_number") is not None\ + else APIHelper.SKIP + expiration_month = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupCreditCardExpirationMonth"), + dictionary.get("expiration_month"), + False)\ + if dictionary.get("expiration_month") is not None\ + else APIHelper.SKIP + expiration_year = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupCreditCardExpirationYear"), + dictionary.get("expiration_year"), + False)\ + if dictionary.get("expiration_year") is not None\ + else APIHelper.SKIP + last_four =\ + dictionary.get("last_four")\ + if dictionary.get("last_four")\ + else APIHelper.SKIP + card_type =\ + dictionary.get("card_type")\ + if dictionary.get("card_type")\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if dictionary.get("customer_vault_token")\ + else APIHelper.SKIP + cvv =\ + dictionary.get("cvv")\ + if dictionary.get("cvv")\ + else APIHelper.SKIP + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(chargify_token, vault_token, @@ -228,7 +296,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -239,7 +307,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -249,49 +316,259 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!r}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!r}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!r}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!r}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!r}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!r}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!r}, ' - f'cvv={(self.cvv if hasattr(self, "cvv") else None)!r}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _cvv=( + self.cvv + if hasattr(self, "cvv") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!r}, " + f"vault_token={_vault_token!r}, " + f"current_vault={_current_vault!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"billing_address={_billing_address!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"billing_country={_billing_country!r}, " + f"full_number={_full_number!r}, " + f"expiration_month={_expiration_month!r}, " + f"expiration_year={_expiration_year!r}, " + f"last_four={_last_four!r}, " + f"card_type={_card_type!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"cvv={_cvv!r}, " + f"payment_type={_payment_type!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'chargify_token={(self.chargify_token if hasattr(self, "chargify_token") else None)!s}, ' - f'vault_token={(self.vault_token if hasattr(self, "vault_token") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'gateway_handle={(self.gateway_handle if hasattr(self, "gateway_handle") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!s}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!s}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!s}, ' - f'last_four={(self.last_four if hasattr(self, "last_four") else None)!s}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!s}, ' - f'customer_vault_token={(self.customer_vault_token if hasattr(self, "customer_vault_token") else None)!s}, ' - f'cvv={(self.cvv if hasattr(self, "cvv") else None)!s}, ' - f'payment_type={(self.payment_type if hasattr(self, "payment_type") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _chargify_token=( + self.chargify_token + if hasattr(self, "chargify_token") + else None + ) + _vault_token=( + self.vault_token + if hasattr(self, "vault_token") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _last_four=( + self.last_four + if hasattr(self, "last_four") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _cvv=( + self.cvv + if hasattr(self, "cvv") + else None + ) + _payment_type=( + self.payment_type + if hasattr(self, "payment_type") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"chargify_token={_chargify_token!s}, " + f"vault_token={_vault_token!s}, " + f"current_vault={_current_vault!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"billing_address={_billing_address!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"billing_country={_billing_country!s}, " + f"full_number={_full_number!s}, " + f"expiration_month={_expiration_month!s}, " + f"expiration_year={_expiration_year!s}, " + f"last_four={_last_four!s}, " + f"card_type={_card_type!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"cvv={_cvv!s}, " + f"payment_type={_payment_type!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_customer.py b/advancedbilling/models/subscription_group_customer.py index f245e74a..925c0e99 100644 --- a/advancedbilling/models/subscription_group_customer.py +++ b/advancedbilling/models/subscription_group_customer.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupCustomer(object): - """Implementation of the 'Subscription Group Customer' model. Attributes: @@ -19,48 +17,48 @@ class SubscriptionGroupCustomer(object): organization (str): The model property of type str. email (str): The model property of type str. reference (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "organization": 'organization', - "email": 'email', - "reference": 'reference' + "first_name": "first_name", + "last_name": "last_name", + "organization": "organization", + "email": "email", + "reference": "reference", } _optionals = [ - 'first_name', - 'last_name', - 'organization', - 'email', - 'reference', + "first_name", + "last_name", + "organization", + "email", + "reference", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - organization=APIHelper.SKIP, - email=APIHelper.SKIP, - reference=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupCustomer class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + organization=APIHelper.SKIP, + email=APIHelper.SKIP, + reference=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupCustomer instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if email is not APIHelper.SKIP: - self.email = email + self.email = email if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference # Add additional model properties to the instance if additional_properties is None: @@ -70,7 +68,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -81,18 +79,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - organization = dictionary.get("organization") if dictionary.get("organization") else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if dictionary.get("organization")\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -102,19 +117,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"organization={_organization!r}, " + f"email={_email!r}, " + f"reference={_reference!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"organization={_organization!s}, " + f"email={_email!s}, " + f"reference={_reference!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_include.py b/advancedbilling/models/subscription_group_include.py index 6d156e08..b3367e5d 100644 --- a/advancedbilling/models/subscription_group_include.py +++ b/advancedbilling/models/subscription_group_include.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionGroupInclude(object): - """Implementation of the 'Subscription Group Include' enum. Attributes: CURRENT_BILLING_AMOUNT_IN_CENTS: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CURRENT_BILLING_AMOUNT_IN_CENTS = 'current_billing_amount_in_cents' + + CURRENT_BILLING_AMOUNT_IN_CENTS = "current_billing_amount_in_cents" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_group_item.py b/advancedbilling/models/subscription_group_item.py index cd9dbdce..2be88259 100644 --- a/advancedbilling/models/subscription_group_item.py +++ b/advancedbilling/models/subscription_group_item.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupItem(object): - """Implementation of the 'Subscription Group Item' model. Attributes: @@ -24,79 +22,79 @@ class SubscriptionGroupItem(object): coupon_code (str): The model property of type str. total_revenue_in_cents (int): The model property of type int. balance_in_cents (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "reference": 'reference', - "product_id": 'product_id', - "product_handle": 'product_handle', - "product_price_point_id": 'product_price_point_id', - "product_price_point_handle": 'product_price_point_handle', - "currency": 'currency', - "coupon_code": 'coupon_code', - "total_revenue_in_cents": 'total_revenue_in_cents', - "balance_in_cents": 'balance_in_cents' + "id": "id", + "reference": "reference", + "product_id": "product_id", + "product_handle": "product_handle", + "product_price_point_id": "product_price_point_id", + "product_price_point_handle": "product_price_point_handle", + "currency": "currency", + "coupon_code": "coupon_code", + "total_revenue_in_cents": "total_revenue_in_cents", + "balance_in_cents": "balance_in_cents", } _optionals = [ - 'id', - 'reference', - 'product_id', - 'product_handle', - 'product_price_point_id', - 'product_price_point_handle', - 'currency', - 'coupon_code', - 'total_revenue_in_cents', - 'balance_in_cents', + "id", + "reference", + "product_id", + "product_handle", + "product_price_point_id", + "product_price_point_handle", + "currency", + "coupon_code", + "total_revenue_in_cents", + "balance_in_cents", ] _nullables = [ - 'reference', - 'product_handle', - 'coupon_code', + "reference", + "product_handle", + "coupon_code", ] - def __init__(self, - id=APIHelper.SKIP, - reference=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_handle=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - product_price_point_handle=APIHelper.SKIP, - currency=APIHelper.SKIP, - coupon_code=APIHelper.SKIP, - total_revenue_in_cents=APIHelper.SKIP, - balance_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupItem class""" - + def __init__( + self, + id=APIHelper.SKIP, + reference=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_handle=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + product_price_point_handle=APIHelper.SKIP, + currency=APIHelper.SKIP, + coupon_code=APIHelper.SKIP, + total_revenue_in_cents=APIHelper.SKIP, + balance_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupItem instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if product_price_point_handle is not APIHelper.SKIP: - self.product_price_point_handle = product_price_point_handle + self.product_price_point_handle = product_price_point_handle if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if coupon_code is not APIHelper.SKIP: - self.coupon_code = coupon_code + self.coupon_code = coupon_code if total_revenue_in_cents is not APIHelper.SKIP: - self.total_revenue_in_cents = total_revenue_in_cents + self.total_revenue_in_cents = total_revenue_in_cents if balance_in_cents is not APIHelper.SKIP: - self.balance_in_cents = balance_in_cents + self.balance_in_cents = balance_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -106,7 +104,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -117,23 +115,55 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - reference = dictionary.get("reference") if "reference" in dictionary.keys() else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_handle = dictionary.get("product_handle") if "product_handle" in dictionary.keys() else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - product_price_point_handle = dictionary.get("product_price_point_handle") if dictionary.get("product_price_point_handle") else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - coupon_code = dictionary.get("coupon_code") if "coupon_code" in dictionary.keys() else APIHelper.SKIP - total_revenue_in_cents = dictionary.get("total_revenue_in_cents") if dictionary.get("total_revenue_in_cents") else APIHelper.SKIP - balance_in_cents = dictionary.get("balance_in_cents") if dictionary.get("balance_in_cents") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if "reference" in dictionary.keys()\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_handle =\ + dictionary.get("product_handle")\ + if "product_handle" in dictionary.keys()\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + product_price_point_handle =\ + dictionary.get("product_price_point_handle")\ + if dictionary.get("product_price_point_handle")\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + coupon_code =\ + dictionary.get("coupon_code")\ + if "coupon_code" in dictionary.keys()\ + else APIHelper.SKIP + total_revenue_in_cents =\ + dictionary.get("total_revenue_in_cents")\ + if dictionary.get("total_revenue_in_cents")\ + else APIHelper.SKIP + balance_in_cents =\ + dictionary.get("balance_in_cents")\ + if dictionary.get("balance_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, reference, @@ -148,29 +178,139 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!r}, ' - f'total_revenue_in_cents={(self.total_revenue_in_cents if hasattr(self, "total_revenue_in_cents") else None)!r}, ' - f'balance_in_cents={(self.balance_in_cents if hasattr(self, "balance_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _total_revenue_in_cents=( + self.total_revenue_in_cents + if hasattr(self, "total_revenue_in_cents") + else None + ) + _balance_in_cents=( + self.balance_in_cents + if hasattr(self, "balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"reference={_reference!r}, " + f"product_id={_product_id!r}, " + f"product_handle={_product_handle!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"product_price_point_handle={_product_price_point_handle!r}, " + f"currency={_currency!r}, " + f"coupon_code={_coupon_code!r}, " + f"total_revenue_in_cents={_total_revenue_in_cents!r}, " + f"balance_in_cents={_balance_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'coupon_code={(self.coupon_code if hasattr(self, "coupon_code") else None)!s}, ' - f'total_revenue_in_cents={(self.total_revenue_in_cents if hasattr(self, "total_revenue_in_cents") else None)!s}, ' - f'balance_in_cents={(self.balance_in_cents if hasattr(self, "balance_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _coupon_code=( + self.coupon_code + if hasattr(self, "coupon_code") + else None + ) + _total_revenue_in_cents=( + self.total_revenue_in_cents + if hasattr(self, "total_revenue_in_cents") + else None + ) + _balance_in_cents=( + self.balance_in_cents + if hasattr(self, "balance_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"reference={_reference!s}, " + f"product_id={_product_id!s}, " + f"product_handle={_product_handle!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"product_price_point_handle={_product_price_point_handle!s}, " + f"currency={_currency!s}, " + f"coupon_code={_coupon_code!s}, " + f"total_revenue_in_cents={_total_revenue_in_cents!s}, " + f"balance_in_cents={_balance_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_members_array_error.py b/advancedbilling/models/subscription_group_members_array_error.py index c4175ae0..560cd3ee 100644 --- a/advancedbilling/models/subscription_group_members_array_error.py +++ b/advancedbilling/models/subscription_group_members_array_error.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupMembersArrayError(object): - """Implementation of the 'Subscription Group Members Array Error' model. Attributes: members (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "members": 'members' + "members": "members", } - def __init__(self, - members=None, - additional_properties=None): - """Constructor for the SubscriptionGroupMembersArrayError class""" - + def __init__( + self, + members=None, + additional_properties=None): + """Initialize a SubscriptionGroupMembersArrayError instance.""" # Initialize members of the class - self.members = members + self.members = members # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,21 +50,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - members = dictionary.get("members") if dictionary.get("members") else None + members =\ + dictionary.get("members")\ + if dictionary.get("members")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(members, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -77,23 +80,44 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.members, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.members, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('members'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("members"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'members={self.members!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _members=self.members + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"members={_members!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'members={self.members!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _members=self.members + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"members={_members!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_payment_profile.py b/advancedbilling/models/subscription_group_payment_profile.py index 5e9f1367..016d6048 100644 --- a/advancedbilling/models/subscription_group_payment_profile.py +++ b/advancedbilling/models/subscription_group_payment_profile.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupPaymentProfile(object): - """Implementation of the 'Subscription Group Payment Profile' model. Attributes: @@ -18,43 +16,43 @@ class SubscriptionGroupPaymentProfile(object): first_name (str): The model property of type str. last_name (str): The model property of type str. masked_card_number (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "first_name": 'first_name', - "last_name": 'last_name', - "masked_card_number": 'masked_card_number' + "id": "id", + "first_name": "first_name", + "last_name": "last_name", + "masked_card_number": "masked_card_number", } _optionals = [ - 'id', - 'first_name', - 'last_name', - 'masked_card_number', + "id", + "first_name", + "last_name", + "masked_card_number", ] - def __init__(self, - id=APIHelper.SKIP, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - masked_card_number=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupPaymentProfile class""" - + def __init__( + self, + id=APIHelper.SKIP, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + masked_card_number=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupPaymentProfile instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if masked_card_number is not APIHelper.SKIP: - self.masked_card_number = masked_card_number + self.masked_card_number = masked_card_number # Add additional model properties to the instance if additional_properties is None: @@ -64,7 +62,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -75,17 +73,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - masked_card_number = dictionary.get("masked_card_number") if dictionary.get("masked_card_number") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + masked_card_number =\ + dictionary.get("masked_card_number")\ + if dictionary.get("masked_card_number")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, first_name, @@ -94,17 +106,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"masked_card_number={_masked_card_number!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'masked_card_number={(self.masked_card_number if hasattr(self, "masked_card_number") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _masked_card_number=( + self.masked_card_number + if hasattr(self, "masked_card_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"masked_card_number={_masked_card_number!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_prepayment.py b/advancedbilling/models/subscription_group_prepayment.py index c441e813..c9fd68e5 100644 --- a/advancedbilling/models/subscription_group_prepayment.py +++ b/advancedbilling/models/subscription_group_prepayment.py @@ -1,15 +1,11 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class SubscriptionGroupPrepayment(object): - """Implementation of the 'Subscription Group Prepayment' model. Attributes: @@ -18,32 +14,32 @@ class SubscriptionGroupPrepayment(object): memo (str): The model property of type str. method (SubscriptionGroupPrepaymentMethod): The model property of type SubscriptionGroupPrepaymentMethod. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "amount": 'amount', - "details": 'details', - "memo": 'memo', - "method": 'method' + "amount": "amount", + "details": "details", + "memo": "memo", + "method": "method", } - def __init__(self, - amount=None, - details=None, - memo=None, - method=None, - additional_properties=None): - """Constructor for the SubscriptionGroupPrepayment class""" - + def __init__( + self, + amount=None, + details=None, + memo=None, + method=None, + additional_properties=None): + """Initialize a SubscriptionGroupPrepayment instance.""" # Initialize members of the class - self.amount = amount - self.details = details - self.memo = memo - self.method = method + self.amount = amount + self.details = details + self.memo = memo + self.method = method # Add additional model properties to the instance if additional_properties is None: @@ -53,7 +49,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -64,17 +60,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - amount = dictionary.get("amount") if dictionary.get("amount") else None - details = dictionary.get("details") if dictionary.get("details") else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - method = dictionary.get("method") if dictionary.get("method") else None + amount =\ + dictionary.get("amount")\ + if dictionary.get("amount")\ + else None + details =\ + dictionary.get("details")\ + if dictionary.get("details")\ + else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + method =\ + dictionary.get("method")\ + if dictionary.get("method")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(amount, details, @@ -83,17 +93,35 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!r}, ' - f'details={self.details!r}, ' - f'memo={self.memo!r}, ' - f'method={self.method!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _amount=self.amount + _details=self.details + _memo=self.memo + _method=self.method + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!r}, " + f"details={_details!r}, " + f"memo={_memo!r}, " + f"method={_method!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'amount={self.amount!s}, ' - f'details={self.details!s}, ' - f'memo={self.memo!s}, ' - f'method={self.method!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _amount=self.amount + _details=self.details + _memo=self.memo + _method=self.method + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"amount={_amount!s}, " + f"details={_details!s}, " + f"memo={_memo!s}, " + f"method={_method!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_prepayment_method.py b/advancedbilling/models/subscription_group_prepayment_method.py index ab68c38d..47707f73 100644 --- a/advancedbilling/models/subscription_group_prepayment_method.py +++ b/advancedbilling/models/subscription_group_prepayment_method.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionGroupPrepaymentMethod(object): - """Implementation of the 'Subscription Group Prepayment Method' enum. Attributes: @@ -19,24 +16,26 @@ class SubscriptionGroupPrepaymentMethod(object): ACH: The enum member of type str. PAYPAL_ACCOUNT: The enum member of type str. OTHER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CHECK = 'check' - CASH = 'cash' + CHECK = "check" + + CASH = "cash" - MONEY_ORDER = 'money_order' + MONEY_ORDER = "money_order" - ACH = 'ach' + ACH = "ach" - PAYPAL_ACCOUNT = 'paypal_account' + PAYPAL_ACCOUNT = "paypal_account" - OTHER = 'other' + OTHER = "other" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_group_prepayment_request.py b/advancedbilling/models/subscription_group_prepayment_request.py index a92ebb00..d0490668 100644 --- a/advancedbilling/models/subscription_group_prepayment_request.py +++ b/advancedbilling/models/subscription_group_prepayment_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_group_prepayment import SubscriptionGroupPrepayment +# ruff: noqa: E501 +from advancedbilling.models.subscription_group_prepayment import ( + SubscriptionGroupPrepayment, +) -class SubscriptionGroupPrepaymentRequest(object): +class SubscriptionGroupPrepaymentRequest(object): """Implementation of the 'Subscription Group Prepayment Request' model. Attributes: prepayment (SubscriptionGroupPrepayment): The model property of type SubscriptionGroupPrepayment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepayment": 'prepayment' + "prepayment": "prepayment", } - def __init__(self, - prepayment=None, - additional_properties=None): - """Constructor for the SubscriptionGroupPrepaymentRequest class""" - + def __init__( + self, + prepayment=None, + additional_properties=None): + """Initialize a SubscriptionGroupPrepaymentRequest instance.""" # Initialize members of the class - self.prepayment = prepayment + self.prepayment = prepayment # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepayment = SubscriptionGroupPrepayment.from_dictionary(dictionary.get('prepayment')) if dictionary.get('prepayment') else None + prepayment =\ + SubscriptionGroupPrepayment.from_dictionary( + dictionary.get("prepayment"))\ + if dictionary.get("prepayment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepayment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepayment={self.prepayment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepayment=self.prepayment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepayment={_prepayment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_prepayment_response.py b/advancedbilling/models/subscription_group_prepayment_response.py index 959277fb..0851ca50 100644 --- a/advancedbilling/models/subscription_group_prepayment_response.py +++ b/advancedbilling/models/subscription_group_prepayment_response.py @@ -1,71 +1,68 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupPrepaymentResponse(object): - """Implementation of the 'Subscription Group Prepayment Response' model. Attributes: id (int): The model property of type int. amount_in_cents (int): The amount in cents of the entry. - ending_balance_in_cents (int): The ending balance in cents of the - account. + ending_balance_in_cents (int): The ending balance in cents of the account. entry_type (ServiceCreditType): The type of entry memo (str): A memo attached to the entry. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "amount_in_cents": 'amount_in_cents', - "ending_balance_in_cents": 'ending_balance_in_cents', - "entry_type": 'entry_type', - "memo": 'memo' + "id": "id", + "amount_in_cents": "amount_in_cents", + "ending_balance_in_cents": "ending_balance_in_cents", + "entry_type": "entry_type", + "memo": "memo", } _optionals = [ - 'id', - 'amount_in_cents', - 'ending_balance_in_cents', - 'entry_type', - 'memo', + "id", + "amount_in_cents", + "ending_balance_in_cents", + "entry_type", + "memo", ] _nullables = [ - 'memo', + "memo", ] - def __init__(self, - id=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - ending_balance_in_cents=APIHelper.SKIP, - entry_type=APIHelper.SKIP, - memo=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupPrepaymentResponse class""" - + def __init__( + self, + id=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + ending_balance_in_cents=APIHelper.SKIP, + entry_type=APIHelper.SKIP, + memo=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupPrepaymentResponse instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if ending_balance_in_cents is not APIHelper.SKIP: - self.ending_balance_in_cents = ending_balance_in_cents + self.ending_balance_in_cents = ending_balance_in_cents if entry_type is not APIHelper.SKIP: - self.entry_type = entry_type + self.entry_type = entry_type if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo # Add additional model properties to the instance if additional_properties is None: @@ -75,7 +72,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -86,18 +83,35 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else APIHelper.SKIP - ending_balance_in_cents = dictionary.get("ending_balance_in_cents") if dictionary.get("ending_balance_in_cents") else APIHelper.SKIP - entry_type = dictionary.get("entry_type") if dictionary.get("entry_type") else APIHelper.SKIP - memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if dictionary.get("amount_in_cents")\ + else APIHelper.SKIP + ending_balance_in_cents =\ + dictionary.get("ending_balance_in_cents")\ + if dictionary.get("ending_balance_in_cents")\ + else APIHelper.SKIP + entry_type =\ + dictionary.get("entry_type")\ + if dictionary.get("entry_type")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if "memo" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, amount_in_cents, @@ -107,19 +121,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!r}, ' - f'entry_type={(self.entry_type if hasattr(self, "entry_type") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _entry_type=( + self.entry_type + if hasattr(self, "entry_type") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"ending_balance_in_cents={_ending_balance_in_cents!r}, " + f"entry_type={_entry_type!r}, " + f"memo={_memo!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'ending_balance_in_cents={(self.ending_balance_in_cents if hasattr(self, "ending_balance_in_cents") else None)!s}, ' - f'entry_type={(self.entry_type if hasattr(self, "entry_type") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _ending_balance_in_cents=( + self.ending_balance_in_cents + if hasattr(self, "ending_balance_in_cents") + else None + ) + _entry_type=( + self.entry_type + if hasattr(self, "entry_type") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"ending_balance_in_cents={_ending_balance_in_cents!s}, " + f"entry_type={_entry_type!s}, " + f"memo={_memo!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_response.py b/advancedbilling/models/subscription_group_response.py index 2e7c12c1..2467e2d4 100644 --- a/advancedbilling/models/subscription_group_response.py +++ b/advancedbilling/models/subscription_group_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_group import SubscriptionGroup +# ruff: noqa: E501 +from advancedbilling.models.subscription_group import ( + SubscriptionGroup, +) -class SubscriptionGroupResponse(object): +class SubscriptionGroupResponse(object): """Implementation of the 'Subscription Group Response' model. Attributes: subscription_group (SubscriptionGroup): The model property of type SubscriptionGroup. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_group": 'subscription_group' + "subscription_group": "subscription_group", } - def __init__(self, - subscription_group=None, - additional_properties=None): - """Constructor for the SubscriptionGroupResponse class""" - + def __init__( + self, + subscription_group=None, + additional_properties=None): + """Initialize a SubscriptionGroupResponse instance.""" # Initialize members of the class - self.subscription_group = subscription_group + self.subscription_group = subscription_group # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_group = SubscriptionGroup.from_dictionary(dictionary.get('subscription_group')) if dictionary.get('subscription_group') else None + subscription_group =\ + SubscriptionGroup.from_dictionary( + dictionary.get("subscription_group"))\ + if dictionary.get("subscription_group") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_group, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup.py b/advancedbilling/models/subscription_group_signup.py index 41bbde8f..a9d894e4 100644 --- a/advancedbilling/models/subscription_group_signup.py +++ b/advancedbilling/models/subscription_group_signup.py @@ -1,94 +1,99 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payer_attributes import PayerAttributes -from advancedbilling.models.subscription_group_bank_account import SubscriptionGroupBankAccount -from advancedbilling.models.subscription_group_credit_card import SubscriptionGroupCreditCard -from advancedbilling.models.subscription_group_signup_item import SubscriptionGroupSignupItem +from advancedbilling.models.payer_attributes import ( + PayerAttributes, +) +from advancedbilling.models.subscription_group_bank_account import ( + SubscriptionGroupBankAccount, +) +from advancedbilling.models.subscription_group_credit_card import ( + SubscriptionGroupCreditCard, +) +from advancedbilling.models.subscription_group_signup_item import ( + SubscriptionGroupSignupItem, +) class SubscriptionGroupSignup(object): - """Implementation of the 'Subscription Group Signup' model. Attributes: payment_profile_id (int): The model property of type int. payer_id (int): The model property of type int. payer_reference (str): The model property of type str. - payment_collection_method (CollectionMethod): The type of payment - collection to be used in the subscription. For legacy Statements - Architecture valid options are - `invoice`, `automatic`. For - current Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. + payment_collection_method (CollectionMethod): The type of payment collection + to be used in the subscription. For legacy Statements Architecture valid + options are - `invoice`, `automatic`. For current Relationship Invoicing + Architecture valid options are - `remittance`, `automatic`, `prepaid`. payer_attributes (PayerAttributes): The model property of type PayerAttributes. - credit_card_attributes (SubscriptionGroupCreditCard): The model - property of type SubscriptionGroupCreditCard. - bank_account_attributes (SubscriptionGroupBankAccount): The model - property of type SubscriptionGroupBankAccount. - subscriptions (List[SubscriptionGroupSignupItem]): The model property - of type List[SubscriptionGroupSignupItem]. - additional_properties (Dict[str, object]): The additional properties - for the model. + credit_card_attributes (SubscriptionGroupCreditCard): The model property of + type SubscriptionGroupCreditCard. + bank_account_attributes (SubscriptionGroupBankAccount): The model property of + type SubscriptionGroupBankAccount. + subscriptions (List[SubscriptionGroupSignupItem]): The model property of type + List[SubscriptionGroupSignupItem]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscriptions": 'subscriptions', - "payment_profile_id": 'payment_profile_id', - "payer_id": 'payer_id', - "payer_reference": 'payer_reference', - "payment_collection_method": 'payment_collection_method', - "payer_attributes": 'payer_attributes', - "credit_card_attributes": 'credit_card_attributes', - "bank_account_attributes": 'bank_account_attributes' + "subscriptions": "subscriptions", + "payment_profile_id": "payment_profile_id", + "payer_id": "payer_id", + "payer_reference": "payer_reference", + "payment_collection_method": "payment_collection_method", + "payer_attributes": "payer_attributes", + "credit_card_attributes": "credit_card_attributes", + "bank_account_attributes": "bank_account_attributes", } _optionals = [ - 'payment_profile_id', - 'payer_id', - 'payer_reference', - 'payment_collection_method', - 'payer_attributes', - 'credit_card_attributes', - 'bank_account_attributes', + "payment_profile_id", + "payer_id", + "payer_reference", + "payment_collection_method", + "payer_attributes", + "credit_card_attributes", + "bank_account_attributes", ] - def __init__(self, - subscriptions=None, - payment_profile_id=APIHelper.SKIP, - payer_id=APIHelper.SKIP, - payer_reference=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - payer_attributes=APIHelper.SKIP, - credit_card_attributes=APIHelper.SKIP, - bank_account_attributes=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupSignup class""" - + def __init__( + self, + subscriptions=None, + payment_profile_id=APIHelper.SKIP, + payer_id=APIHelper.SKIP, + payer_reference=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + payer_attributes=APIHelper.SKIP, + credit_card_attributes=APIHelper.SKIP, + bank_account_attributes=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupSignup instance.""" # Initialize members of the class if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if payer_id is not APIHelper.SKIP: - self.payer_id = payer_id + self.payer_id = payer_id if payer_reference is not APIHelper.SKIP: - self.payer_reference = payer_reference + self.payer_reference = payer_reference if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method if payer_attributes is not APIHelper.SKIP: - self.payer_attributes = payer_attributes + self.payer_attributes = payer_attributes if credit_card_attributes is not APIHelper.SKIP: - self.credit_card_attributes = credit_card_attributes + self.credit_card_attributes = credit_card_attributes if bank_account_attributes is not APIHelper.SKIP: - self.bank_account_attributes = bank_account_attributes - self.subscriptions = subscriptions + self.bank_account_attributes = bank_account_attributes + self.subscriptions = subscriptions # Add additional model properties to the instance if additional_properties is None: @@ -98,7 +103,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -109,23 +114,52 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary subscriptions = None - if dictionary.get('subscriptions') is not None: - subscriptions = [SubscriptionGroupSignupItem.from_dictionary(x) for x in dictionary.get('subscriptions')] - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - payer_id = dictionary.get("payer_id") if dictionary.get("payer_id") else APIHelper.SKIP - payer_reference = dictionary.get("payer_reference") if dictionary.get("payer_reference") else APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP - payer_attributes = PayerAttributes.from_dictionary(dictionary.get('payer_attributes')) if 'payer_attributes' in dictionary.keys() else APIHelper.SKIP - credit_card_attributes = SubscriptionGroupCreditCard.from_dictionary(dictionary.get('credit_card_attributes')) if 'credit_card_attributes' in dictionary.keys() else APIHelper.SKIP - bank_account_attributes = SubscriptionGroupBankAccount.from_dictionary(dictionary.get('bank_account_attributes')) if 'bank_account_attributes' in dictionary.keys() else APIHelper.SKIP + if dictionary.get("subscriptions") is not None: + subscriptions = [ + SubscriptionGroupSignupItem.from_dictionary(x) + for x in dictionary.get("subscriptions") + ] + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + payer_id =\ + dictionary.get("payer_id")\ + if dictionary.get("payer_id")\ + else APIHelper.SKIP + payer_reference =\ + dictionary.get("payer_reference")\ + if dictionary.get("payer_reference")\ + else APIHelper.SKIP + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + payer_attributes =\ + PayerAttributes.from_dictionary( + dictionary.get("payer_attributes"))\ + if "payer_attributes" in dictionary.keys()\ + else APIHelper.SKIP + credit_card_attributes =\ + SubscriptionGroupCreditCard.from_dictionary( + dictionary.get("credit_card_attributes"))\ + if "credit_card_attributes" in dictionary.keys()\ + else APIHelper.SKIP + bank_account_attributes =\ + SubscriptionGroupBankAccount.from_dictionary( + dictionary.get("bank_account_attributes"))\ + if "bank_account_attributes" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscriptions, payment_profile_id, @@ -138,25 +172,107 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!r}, ' - f'payer_reference={(self.payer_reference if hasattr(self, "payer_reference") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'payer_attributes={(self.payer_attributes if hasattr(self, "payer_attributes") else None)!r}, ' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!r}, ' - f'bank_account_attributes={(self.bank_account_attributes if hasattr(self, "bank_account_attributes") else None)!r}, ' - f'subscriptions={self.subscriptions!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _payer_reference=( + self.payer_reference + if hasattr(self, "payer_reference") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _payer_attributes=( + self.payer_attributes + if hasattr(self, "payer_attributes") + else None + ) + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _bank_account_attributes=( + self.bank_account_attributes + if hasattr(self, "bank_account_attributes") + else None + ) + _subscriptions=self.subscriptions + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile_id={_payment_profile_id!r}, " + f"payer_id={_payer_id!r}, " + f"payer_reference={_payer_reference!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"payer_attributes={_payer_attributes!r}, " + f"credit_card_attributes={_credit_card_attributes!r}, " + f"bank_account_attributes={_bank_account_attributes!r}, " + f"subscriptions={_subscriptions!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!s}, ' - f'payer_reference={(self.payer_reference if hasattr(self, "payer_reference") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'payer_attributes={(self.payer_attributes if hasattr(self, "payer_attributes") else None)!s}, ' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!s}, ' - f'bank_account_attributes={(self.bank_account_attributes if hasattr(self, "bank_account_attributes") else None)!s}, ' - f'subscriptions={self.subscriptions!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _payer_reference=( + self.payer_reference + if hasattr(self, "payer_reference") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _payer_attributes=( + self.payer_attributes + if hasattr(self, "payer_attributes") + else None + ) + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _bank_account_attributes=( + self.bank_account_attributes + if hasattr(self, "bank_account_attributes") + else None + ) + _subscriptions=self.subscriptions + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile_id={_payment_profile_id!s}, " + f"payer_id={_payer_id!s}, " + f"payer_reference={_payer_reference!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"payer_attributes={_payer_attributes!s}, " + f"credit_card_attributes={_credit_card_attributes!s}, " + f"bank_account_attributes={_bank_account_attributes!s}, " + f"subscriptions={_subscriptions!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup_component.py b/advancedbilling/models/subscription_group_signup_component.py index 7ecc6569..03a67c30 100644 --- a/advancedbilling/models/subscription_group_signup_component.py +++ b/advancedbilling/models/subscription_group_signup_component.py @@ -1,73 +1,72 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_group_component_custom_price import SubscriptionGroupComponentCustomPrice +from advancedbilling.models.subscription_group_component_custom_price import ( + SubscriptionGroupComponentCustomPrice, +) class SubscriptionGroupSignupComponent(object): - """Implementation of the 'Subscription Group Signup Component' model. Attributes: component_id (str | int | None): Required if passing any component to `components` attribute. - allocated_quantity (str | int | None): The model property of type str - | int | None. - unit_balance (str | int | None): The model property of type str | int - | None. - price_point_id (str | int | None): The model property of type str | - int | None. + allocated_quantity (str | int | None): The model property of type str | int | + None. + unit_balance (str | int | None): The model property of type str | int | None. + price_point_id (str | int | None): The model property of type str | int | + None. custom_price (SubscriptionGroupComponentCustomPrice): Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "allocated_quantity": 'allocated_quantity', - "unit_balance": 'unit_balance', - "price_point_id": 'price_point_id', - "custom_price": 'custom_price' + "component_id": "component_id", + "allocated_quantity": "allocated_quantity", + "unit_balance": "unit_balance", + "price_point_id": "price_point_id", + "custom_price": "custom_price", } _optionals = [ - 'component_id', - 'allocated_quantity', - 'unit_balance', - 'price_point_id', - 'custom_price', + "component_id", + "allocated_quantity", + "unit_balance", + "price_point_id", + "custom_price", ] - def __init__(self, - component_id=APIHelper.SKIP, - allocated_quantity=APIHelper.SKIP, - unit_balance=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupSignupComponent class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + allocated_quantity=APIHelper.SKIP, + unit_balance=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupSignupComponent instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if allocated_quantity is not APIHelper.SKIP: - self.allocated_quantity = allocated_quantity + self.allocated_quantity = allocated_quantity if unit_balance is not APIHelper.SKIP: - self.unit_balance = unit_balance + self.unit_balance = unit_balance if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price # Add additional model properties to the instance if additional_properties is None: @@ -77,7 +76,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -88,19 +87,48 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupSignupComponentComponentId'), dictionary.get('component_id'), False) if dictionary.get('component_id') is not None else APIHelper.SKIP - allocated_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupSignupComponentAllocatedQuantity'), dictionary.get('allocated_quantity'), False) if dictionary.get('allocated_quantity') is not None else APIHelper.SKIP - unit_balance = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupSignupComponentUnitBalance'), dictionary.get('unit_balance'), False) if dictionary.get('unit_balance') is not None else APIHelper.SKIP - price_point_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('SubscriptionGroupSignupComponentPricePointId'), dictionary.get('price_point_id'), False) if dictionary.get('price_point_id') is not None else APIHelper.SKIP - custom_price = SubscriptionGroupComponentCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP + component_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupSignupComponentComponentId"), + dictionary.get("component_id"), + False)\ + if dictionary.get("component_id") is not None\ + else APIHelper.SKIP + allocated_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupSignupComponentAllocatedQuantity"), + dictionary.get("allocated_quantity"), + False)\ + if dictionary.get("allocated_quantity") is not None\ + else APIHelper.SKIP + unit_balance = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupSignupComponentUnitBalance"), + dictionary.get("unit_balance"), + False)\ + if dictionary.get("unit_balance") is not None\ + else APIHelper.SKIP + price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionGroupSignupComponentPricePointId"), + dictionary.get("price_point_id"), + False)\ + if dictionary.get("price_point_id") is not None\ + else APIHelper.SKIP + custom_price =\ + SubscriptionGroupComponentCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, allocated_quantity, @@ -111,7 +139,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -122,7 +150,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -132,19 +159,79 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!r}, ' - f'unit_balance={(self.unit_balance if hasattr(self, "unit_balance") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _unit_balance=( + self.unit_balance + if hasattr(self, "unit_balance") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"allocated_quantity={_allocated_quantity!r}, " + f"unit_balance={_unit_balance!r}, " + f"price_point_id={_price_point_id!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'allocated_quantity={(self.allocated_quantity if hasattr(self, "allocated_quantity") else None)!s}, ' - f'unit_balance={(self.unit_balance if hasattr(self, "unit_balance") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _allocated_quantity=( + self.allocated_quantity + if hasattr(self, "allocated_quantity") + else None + ) + _unit_balance=( + self.unit_balance + if hasattr(self, "unit_balance") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"allocated_quantity={_allocated_quantity!s}, " + f"unit_balance={_unit_balance!s}, " + f"price_point_id={_price_point_id!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup_error.py b/advancedbilling/models/subscription_group_signup_error.py index 6aaadc47..f9108c55 100644 --- a/advancedbilling/models/subscription_group_signup_error.py +++ b/advancedbilling/models/subscription_group_signup_error.py @@ -1,76 +1,78 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payer_error import PayerError -from advancedbilling.models.subscription_group_subscription_error import SubscriptionGroupSubscriptionError +from advancedbilling.models.payer_error import ( + PayerError, +) +from advancedbilling.models.subscription_group_subscription_error import ( + SubscriptionGroupSubscriptionError, +) class SubscriptionGroupSignupError(object): - """Implementation of the 'Subscription Group Signup Error' model. Attributes: - subscriptions (Dict[str, SubscriptionGroupSubscriptionError]): Object - that as key have subscription position in request subscriptions - array and as value subscription errors object. + subscriptions (Dict[str, SubscriptionGroupSubscriptionError]): Object that as + key have subscription position in request subscriptions array and as + value subscription errors object. payer_reference (str): The model property of type str. payer (PayerError): The model property of type PayerError. subscription_group (List[str]): The model property of type List[str]. payment_profile_id (str): The model property of type str. payer_id (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscriptions": 'subscriptions', - "payer_reference": 'payer_reference', - "payer": 'payer', - "subscription_group": 'subscription_group', - "payment_profile_id": 'payment_profile_id', - "payer_id": 'payer_id' + "subscriptions": "subscriptions", + "payer_reference": "payer_reference", + "payer": "payer", + "subscription_group": "subscription_group", + "payment_profile_id": "payment_profile_id", + "payer_id": "payer_id", } _optionals = [ - 'subscriptions', - 'payer_reference', - 'payer', - 'subscription_group', - 'payment_profile_id', - 'payer_id', + "subscriptions", + "payer_reference", + "payer", + "subscription_group", + "payment_profile_id", + "payer_id", ] - def __init__(self, - subscriptions=APIHelper.SKIP, - payer_reference=APIHelper.SKIP, - payer=APIHelper.SKIP, - subscription_group=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - payer_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupSignupError class""" - + def __init__( + self, + subscriptions=APIHelper.SKIP, + payer_reference=APIHelper.SKIP, + payer=APIHelper.SKIP, + subscription_group=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + payer_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupSignupError instance.""" # Initialize members of the class if subscriptions is not APIHelper.SKIP: - self.subscriptions = subscriptions + self.subscriptions = subscriptions if payer_reference is not APIHelper.SKIP: - self.payer_reference = payer_reference + self.payer_reference = payer_reference if payer is not APIHelper.SKIP: - self.payer = payer + self.payer = payer if subscription_group is not APIHelper.SKIP: - self.subscription_group = subscription_group + self.subscription_group = subscription_group if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if payer_id is not APIHelper.SKIP: - self.payer_id = payer_id + self.payer_id = payer_id # Add additional model properties to the instance if additional_properties is None: @@ -80,7 +82,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -91,19 +93,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscriptions = SubscriptionGroupSubscriptionError.from_dictionary(dictionary.get('subscriptions')) if 'subscriptions' in dictionary.keys() else APIHelper.SKIP - payer_reference = dictionary.get("payer_reference") if dictionary.get("payer_reference") else APIHelper.SKIP - payer = PayerError.from_dictionary(dictionary.get('payer')) if 'payer' in dictionary.keys() else APIHelper.SKIP - subscription_group = dictionary.get("subscription_group") if dictionary.get("subscription_group") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - payer_id = dictionary.get("payer_id") if dictionary.get("payer_id") else APIHelper.SKIP + subscriptions =\ + SubscriptionGroupSubscriptionError.from_dictionary( + dictionary.get("subscriptions"))\ + if "subscriptions" in dictionary.keys()\ + else APIHelper.SKIP + payer_reference =\ + dictionary.get("payer_reference")\ + if dictionary.get("payer_reference")\ + else APIHelper.SKIP + payer =\ + PayerError.from_dictionary( + dictionary.get("payer"))\ + if "payer" in dictionary.keys()\ + else APIHelper.SKIP + subscription_group =\ + dictionary.get("subscription_group")\ + if dictionary.get("subscription_group")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + payer_id =\ + dictionary.get("payer_id")\ + if dictionary.get("payer_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscriptions, payer_reference, @@ -114,21 +138,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!r}, ' - f'payer_reference={(self.payer_reference if hasattr(self, "payer_reference") else None)!r}, ' - f'payer={(self.payer if hasattr(self, "payer") else None)!r}, ' - f'subscription_group={(self.subscription_group if hasattr(self, "subscription_group") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _payer_reference=( + self.payer_reference + if hasattr(self, "payer_reference") + else None + ) + _payer=( + self.payer + if hasattr(self, "payer") + else None + ) + _subscription_group=( + self.subscription_group + if hasattr(self, "subscription_group") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscriptions={_subscriptions!r}, " + f"payer_reference={_payer_reference!r}, " + f"payer={_payer!r}, " + f"subscription_group={_subscription_group!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"payer_id={_payer_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!s}, ' - f'payer_reference={(self.payer_reference if hasattr(self, "payer_reference") else None)!s}, ' - f'payer={(self.payer if hasattr(self, "payer") else None)!s}, ' - f'subscription_group={(self.subscription_group if hasattr(self, "subscription_group") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _payer_reference=( + self.payer_reference + if hasattr(self, "payer_reference") + else None + ) + _payer=( + self.payer + if hasattr(self, "payer") + else None + ) + _subscription_group=( + self.subscription_group + if hasattr(self, "subscription_group") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscriptions={_subscriptions!s}, " + f"payer_reference={_payer_reference!s}, " + f"payer={_payer!s}, " + f"subscription_group={_subscription_group!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"payer_id={_payer_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup_event_data.py b/advancedbilling/models/subscription_group_signup_event_data.py index 97725035..4df6d6e0 100644 --- a/advancedbilling/models/subscription_group_signup_event_data.py +++ b/advancedbilling/models/subscription_group_signup_event_data.py @@ -1,48 +1,50 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.customer import Customer -from advancedbilling.models.subscription_group_signup_failure_data import SubscriptionGroupSignupFailureData +from advancedbilling.models.customer import ( + Customer, +) +from advancedbilling.models.subscription_group_signup_failure_data import ( + SubscriptionGroupSignupFailureData, +) class SubscriptionGroupSignupEventData(object): - """Implementation of the 'Subscription Group Signup Event Data' model. Attributes: - subscription_group (SubscriptionGroupSignupFailureData): The model - property of type SubscriptionGroupSignupFailureData. + subscription_group (SubscriptionGroupSignupFailureData): The model property + of type SubscriptionGroupSignupFailureData. customer (Customer): The model property of type Customer. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_group": 'subscription_group', - "customer": 'customer' + "subscription_group": "subscription_group", + "customer": "customer", } _nullables = [ - 'customer', + "customer", ] - def __init__(self, - subscription_group=None, - customer=None, - additional_properties=None): - """Constructor for the SubscriptionGroupSignupEventData class""" - + def __init__( + self, + subscription_group=None, + customer=None, + additional_properties=None): + """Initialize a SubscriptionGroupSignupEventData instance.""" # Initialize members of the class - self.subscription_group = subscription_group - self.customer = customer + self.subscription_group = subscription_group + self.customer = customer # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +54,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,15 +65,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_group = SubscriptionGroupSignupFailureData.from_dictionary(dictionary.get('subscription_group')) if dictionary.get('subscription_group') else None - customer = Customer.from_dictionary(dictionary.get('customer')) if dictionary.get('customer') else None + subscription_group =\ + SubscriptionGroupSignupFailureData.from_dictionary( + dictionary.get("subscription_group"))\ + if dictionary.get("subscription_group") else None + customer =\ + Customer.from_dictionary( + dictionary.get("customer"))\ + if dictionary.get("customer") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_group, customer, @@ -79,7 +89,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -90,35 +100,56 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.subscription_group, - type_callable=lambda value: SubscriptionGroupSignupFailureData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.customer, - type_callable=lambda value: Customer.validate(value), - is_value_nullable=True, - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.subscription_group, + type_callable=lambda value: + SubscriptionGroupSignupFailureData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.customer, + type_callable=lambda value: + Customer.validate(value), + is_value_nullable=True, + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('subscription_group'), - type_callable=lambda value: SubscriptionGroupSignupFailureData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('customer'), - type_callable=lambda value: Customer.validate(value), - is_value_nullable=True, - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("subscription_group"), + type_callable=lambda value: + SubscriptionGroupSignupFailureData.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("customer"), + type_callable=lambda value: + Customer.validate(value), + is_value_nullable=True, + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!r}, ' - f'customer={self.customer!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_group=self.subscription_group + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!r}, " + f"customer={_customer!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!s}, ' - f'customer={self.customer!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_group=self.subscription_group + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!s}, " + f"customer={_customer!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup_failure_data.py b/advancedbilling/models/subscription_group_signup_failure_data.py index c8a6cb2a..b4b43fd0 100644 --- a/advancedbilling/models/subscription_group_signup_failure_data.py +++ b/advancedbilling/models/subscription_group_signup_failure_data.py @@ -1,20 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.payer_attributes import PayerAttributes -from advancedbilling.models.subscription_group_bank_account import SubscriptionGroupBankAccount -from advancedbilling.models.subscription_group_credit_card import SubscriptionGroupCreditCard -from advancedbilling.models.subscription_group_signup_item import SubscriptionGroupSignupItem +from advancedbilling.models.payer_attributes import ( + PayerAttributes, +) +from advancedbilling.models.subscription_group_bank_account import ( + SubscriptionGroupBankAccount, +) +from advancedbilling.models.subscription_group_credit_card import ( + SubscriptionGroupCreditCard, +) +from advancedbilling.models.subscription_group_signup_item import ( + SubscriptionGroupSignupItem, +) class SubscriptionGroupSignupFailureData(object): - """Implementation of the 'Subscription Group Signup Failure Data' model. Attributes: @@ -24,69 +30,69 @@ class SubscriptionGroupSignupFailureData(object): payment_collection_method (str): The model property of type str. payer_attributes (PayerAttributes): The model property of type PayerAttributes. - credit_card_attributes (SubscriptionGroupCreditCard): The model - property of type SubscriptionGroupCreditCard. - bank_account_attributes (SubscriptionGroupBankAccount): The model - property of type SubscriptionGroupBankAccount. - subscriptions (List[SubscriptionGroupSignupItem]): The model property - of type List[SubscriptionGroupSignupItem]. - additional_properties (Dict[str, object]): The additional properties - for the model. + credit_card_attributes (SubscriptionGroupCreditCard): The model property of + type SubscriptionGroupCreditCard. + bank_account_attributes (SubscriptionGroupBankAccount): The model property of + type SubscriptionGroupBankAccount. + subscriptions (List[SubscriptionGroupSignupItem]): The model property of type + List[SubscriptionGroupSignupItem]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payer_id": 'payer_id', - "payer_reference": 'payer_reference', - "payment_profile_id": 'payment_profile_id', - "payment_collection_method": 'payment_collection_method', - "payer_attributes": 'payer_attributes', - "credit_card_attributes": 'credit_card_attributes', - "bank_account_attributes": 'bank_account_attributes', - "subscriptions": 'subscriptions' + "payer_id": "payer_id", + "payer_reference": "payer_reference", + "payment_profile_id": "payment_profile_id", + "payment_collection_method": "payment_collection_method", + "payer_attributes": "payer_attributes", + "credit_card_attributes": "credit_card_attributes", + "bank_account_attributes": "bank_account_attributes", + "subscriptions": "subscriptions", } _optionals = [ - 'payer_id', - 'payer_reference', - 'payment_profile_id', - 'payment_collection_method', - 'payer_attributes', - 'credit_card_attributes', - 'bank_account_attributes', - 'subscriptions', + "payer_id", + "payer_reference", + "payment_profile_id", + "payment_collection_method", + "payer_attributes", + "credit_card_attributes", + "bank_account_attributes", + "subscriptions", ] - def __init__(self, - payer_id=APIHelper.SKIP, - payer_reference=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - payer_attributes=APIHelper.SKIP, - credit_card_attributes=APIHelper.SKIP, - bank_account_attributes=APIHelper.SKIP, - subscriptions=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupSignupFailureData class""" - + def __init__( + self, + payer_id=APIHelper.SKIP, + payer_reference=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + payer_attributes=APIHelper.SKIP, + credit_card_attributes=APIHelper.SKIP, + bank_account_attributes=APIHelper.SKIP, + subscriptions=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupSignupFailureData instance.""" # Initialize members of the class if payer_id is not APIHelper.SKIP: - self.payer_id = payer_id + self.payer_id = payer_id if payer_reference is not APIHelper.SKIP: - self.payer_reference = payer_reference + self.payer_reference = payer_reference if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method if payer_attributes is not APIHelper.SKIP: - self.payer_attributes = payer_attributes + self.payer_attributes = payer_attributes if credit_card_attributes is not APIHelper.SKIP: - self.credit_card_attributes = credit_card_attributes + self.credit_card_attributes = credit_card_attributes if bank_account_attributes is not APIHelper.SKIP: - self.bank_account_attributes = bank_account_attributes + self.bank_account_attributes = bank_account_attributes if subscriptions is not APIHelper.SKIP: - self.subscriptions = subscriptions + self.subscriptions = subscriptions # Add additional model properties to the instance if additional_properties is None: @@ -96,7 +102,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -107,25 +113,54 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payer_id = dictionary.get("payer_id") if dictionary.get("payer_id") else APIHelper.SKIP - payer_reference = dictionary.get("payer_reference") if dictionary.get("payer_reference") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP - payer_attributes = PayerAttributes.from_dictionary(dictionary.get('payer_attributes')) if 'payer_attributes' in dictionary.keys() else APIHelper.SKIP - credit_card_attributes = SubscriptionGroupCreditCard.from_dictionary(dictionary.get('credit_card_attributes')) if 'credit_card_attributes' in dictionary.keys() else APIHelper.SKIP - bank_account_attributes = SubscriptionGroupBankAccount.from_dictionary(dictionary.get('bank_account_attributes')) if 'bank_account_attributes' in dictionary.keys() else APIHelper.SKIP + payer_id =\ + dictionary.get("payer_id")\ + if dictionary.get("payer_id")\ + else APIHelper.SKIP + payer_reference =\ + dictionary.get("payer_reference")\ + if dictionary.get("payer_reference")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + payer_attributes =\ + PayerAttributes.from_dictionary( + dictionary.get("payer_attributes"))\ + if "payer_attributes" in dictionary.keys()\ + else APIHelper.SKIP + credit_card_attributes =\ + SubscriptionGroupCreditCard.from_dictionary( + dictionary.get("credit_card_attributes"))\ + if "credit_card_attributes" in dictionary.keys()\ + else APIHelper.SKIP + bank_account_attributes =\ + SubscriptionGroupBankAccount.from_dictionary( + dictionary.get("bank_account_attributes"))\ + if "bank_account_attributes" in dictionary.keys()\ + else APIHelper.SKIP subscriptions = None - if dictionary.get('subscriptions') is not None: - subscriptions = [SubscriptionGroupSignupItem.from_dictionary(x) for x in dictionary.get('subscriptions')] + if dictionary.get("subscriptions") is not None: + subscriptions = [ + SubscriptionGroupSignupItem.from_dictionary(x) + for x in dictionary.get("subscriptions") + ] else: subscriptions = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payer_id, payer_reference, @@ -139,7 +174,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -150,7 +185,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -160,25 +194,115 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!r}, ' - f'payer_reference={(self.payer_reference if hasattr(self, "payer_reference") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'payer_attributes={(self.payer_attributes if hasattr(self, "payer_attributes") else None)!r}, ' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!r}, ' - f'bank_account_attributes={(self.bank_account_attributes if hasattr(self, "bank_account_attributes") else None)!r}, ' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _payer_reference=( + self.payer_reference + if hasattr(self, "payer_reference") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _payer_attributes=( + self.payer_attributes + if hasattr(self, "payer_attributes") + else None + ) + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _bank_account_attributes=( + self.bank_account_attributes + if hasattr(self, "bank_account_attributes") + else None + ) + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payer_id={_payer_id!r}, " + f"payer_reference={_payer_reference!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"payer_attributes={_payer_attributes!r}, " + f"credit_card_attributes={_credit_card_attributes!r}, " + f"bank_account_attributes={_bank_account_attributes!r}, " + f"subscriptions={_subscriptions!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payer_id={(self.payer_id if hasattr(self, "payer_id") else None)!s}, ' - f'payer_reference={(self.payer_reference if hasattr(self, "payer_reference") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'payer_attributes={(self.payer_attributes if hasattr(self, "payer_attributes") else None)!s}, ' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!s}, ' - f'bank_account_attributes={(self.bank_account_attributes if hasattr(self, "bank_account_attributes") else None)!s}, ' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payer_id=( + self.payer_id + if hasattr(self, "payer_id") + else None + ) + _payer_reference=( + self.payer_reference + if hasattr(self, "payer_reference") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _payer_attributes=( + self.payer_attributes + if hasattr(self, "payer_attributes") + else None + ) + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _bank_account_attributes=( + self.bank_account_attributes + if hasattr(self, "bank_account_attributes") + else None + ) + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payer_id={_payer_id!s}, " + f"payer_reference={_payer_reference!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"payer_attributes={_payer_attributes!s}, " + f"credit_card_attributes={_credit_card_attributes!s}, " + f"bank_account_attributes={_bank_account_attributes!s}, " + f"subscriptions={_subscriptions!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup_item.py b/advancedbilling/models/subscription_group_signup_item.py index 9dbd60c8..3c670025 100644 --- a/advancedbilling/models/subscription_group_signup_item.py +++ b/advancedbilling/models/subscription_group_signup_item.py @@ -1,139 +1,140 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.calendar_billing import CalendarBilling -from advancedbilling.models.subscription_custom_price import SubscriptionCustomPrice -from advancedbilling.models.subscription_group_signup_component import SubscriptionGroupSignupComponent +from advancedbilling.models.calendar_billing import ( + CalendarBilling, +) +from advancedbilling.models.subscription_custom_price import ( + SubscriptionCustomPrice, +) +from advancedbilling.models.subscription_group_signup_component import ( + SubscriptionGroupSignupComponent, +) class SubscriptionGroupSignupItem(object): - """Implementation of the 'Subscription Group Signup Item' model. Attributes: product_handle (str): The API Handle of the product for which you are - creating a subscription. Required, unless a `product_id` is given - instead. - product_id (int): The Product ID of the product for which you are - creating a subscription. You can pass either `product_id` or - `product_handle`. - product_price_point_id (int): The ID of the particular price point on - the product. - product_price_point_handle (str): The user-friendly API handle of a - product's particular price point. - offer_id (int): Use in place of passing product and component - information to set up the subscription with an existing offer. May - be either the Chargify ID of the offer or its handle prefixed with - `handle:` + creating a subscription. Required, unless a `product_id` is given instead. + product_id (int): The Product ID of the product for which you are creating a + subscription. You can pass either `product_id` or `product_handle`. + product_price_point_id (int): The ID of the particular price point on the + product. + product_price_point_handle (str): The user-friendly API handle of a product's + particular price point. + offer_id (int): Use in place of passing product and component information to + set up the subscription with an existing offer. May be either the + Chargify ID of the offer or its handle prefixed with `handle:` reference (str): The reference value (provided by your app) for the subscription itelf. - primary (bool): One of the subscriptions must be marked as primary in - the group. - currency (str): (Optional) If Multi-Currency is enabled and the - currency is configured in Chargify, pass it at signup to create a - subscription on a non-default currency. Note that you cannot - update the currency of an existing subscription. + primary (bool): One of the subscriptions must be marked as primary in the + group. + currency (str): (Optional) If Multi-Currency is enabled and the currency is + configured in Chargify, pass it at signup to create a subscription on a + non-default currency. Note that you cannot update the currency of an + existing subscription. coupon_codes (List[str]): An array for all the coupons attached to the subscription. - components (List[SubscriptionGroupSignupComponent]): The model - property of type List[SubscriptionGroupSignupComponent]. + components (List[SubscriptionGroupSignupComponent]): The model property of + type List[SubscriptionGroupSignupComponent]. custom_price (SubscriptionCustomPrice): (Optional) Used in place of - `product_price_point_id` to define a custom price point unique to - the subscription - calendar_billing (CalendarBilling): (Optional). Cannot be used when - also specifying next_billing_at - metafields (Dict[str, str]): (Optional) A set of key/value pairs - representing custom fields and their values. Metafields will be - created “on-the-fly” in your site for a given key, if they have - not been created yet. - additional_properties (Dict[str, object]): The additional properties - for the model. + `product_price_point_id` to define a custom price point unique to the + subscription. A subscription can have up to 30 custom price points. + Exceeding this limit will result in an API error. + calendar_billing (CalendarBilling): (Optional). Cannot be used when also + specifying next_billing_at + metafields (Dict[str, str]): (Optional) A set of key/value pairs representing + custom fields and their values. Metafields will be created “on-the-fly” + in your site for a given key, if they have not been created yet. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_handle": 'product_handle', - "product_id": 'product_id', - "product_price_point_id": 'product_price_point_id', - "product_price_point_handle": 'product_price_point_handle', - "offer_id": 'offer_id', - "reference": 'reference', - "primary": 'primary', - "currency": 'currency', - "coupon_codes": 'coupon_codes', - "components": 'components', - "custom_price": 'custom_price', - "calendar_billing": 'calendar_billing', - "metafields": 'metafields' + "product_handle": "product_handle", + "product_id": "product_id", + "product_price_point_id": "product_price_point_id", + "product_price_point_handle": "product_price_point_handle", + "offer_id": "offer_id", + "reference": "reference", + "primary": "primary", + "currency": "currency", + "coupon_codes": "coupon_codes", + "components": "components", + "custom_price": "custom_price", + "calendar_billing": "calendar_billing", + "metafields": "metafields", } _optionals = [ - 'product_handle', - 'product_id', - 'product_price_point_id', - 'product_price_point_handle', - 'offer_id', - 'reference', - 'primary', - 'currency', - 'coupon_codes', - 'components', - 'custom_price', - 'calendar_billing', - 'metafields', + "product_handle", + "product_id", + "product_price_point_id", + "product_price_point_handle", + "offer_id", + "reference", + "primary", + "currency", + "coupon_codes", + "components", + "custom_price", + "calendar_billing", + "metafields", ] - def __init__(self, - product_handle=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - product_price_point_handle=APIHelper.SKIP, - offer_id=APIHelper.SKIP, - reference=APIHelper.SKIP, - primary=APIHelper.SKIP, - currency=APIHelper.SKIP, - coupon_codes=APIHelper.SKIP, - components=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - calendar_billing=APIHelper.SKIP, - metafields=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupSignupItem class""" - + def __init__( + self, + product_handle=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + product_price_point_handle=APIHelper.SKIP, + offer_id=APIHelper.SKIP, + reference=APIHelper.SKIP, + primary=APIHelper.SKIP, + currency=APIHelper.SKIP, + coupon_codes=APIHelper.SKIP, + components=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + calendar_billing=APIHelper.SKIP, + metafields=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupSignupItem instance.""" # Initialize members of the class if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if product_price_point_handle is not APIHelper.SKIP: - self.product_price_point_handle = product_price_point_handle + self.product_price_point_handle = product_price_point_handle if offer_id is not APIHelper.SKIP: - self.offer_id = offer_id + self.offer_id = offer_id if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if primary is not APIHelper.SKIP: - self.primary = primary + self.primary = primary if currency is not APIHelper.SKIP: - self.currency = currency + self.currency = currency if coupon_codes is not APIHelper.SKIP: - self.coupon_codes = coupon_codes + self.coupon_codes = coupon_codes if components is not APIHelper.SKIP: - self.components = components + self.components = components if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price if calendar_billing is not APIHelper.SKIP: - self.calendar_billing = calendar_billing + self.calendar_billing = calendar_billing if metafields is not APIHelper.SKIP: - self.metafields = metafields + self.metafields = metafields # Add additional model properties to the instance if additional_properties is None: @@ -143,7 +144,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -154,30 +155,73 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_handle = dictionary.get("product_handle") if dictionary.get("product_handle") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - product_price_point_handle = dictionary.get("product_price_point_handle") if dictionary.get("product_price_point_handle") else APIHelper.SKIP - offer_id = dictionary.get("offer_id") if dictionary.get("offer_id") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP - primary = dictionary.get("primary") if "primary" in dictionary.keys() else APIHelper.SKIP - currency = dictionary.get("currency") if dictionary.get("currency") else APIHelper.SKIP - coupon_codes = dictionary.get("coupon_codes") if dictionary.get("coupon_codes") else APIHelper.SKIP + product_handle =\ + dictionary.get("product_handle")\ + if dictionary.get("product_handle")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + product_price_point_handle =\ + dictionary.get("product_price_point_handle")\ + if dictionary.get("product_price_point_handle")\ + else APIHelper.SKIP + offer_id =\ + dictionary.get("offer_id")\ + if dictionary.get("offer_id")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + primary =\ + dictionary.get("primary")\ + if "primary" in dictionary.keys()\ + else APIHelper.SKIP + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else APIHelper.SKIP + coupon_codes =\ + dictionary.get("coupon_codes")\ + if dictionary.get("coupon_codes")\ + else APIHelper.SKIP components = None - if dictionary.get('components') is not None: - components = [SubscriptionGroupSignupComponent.from_dictionary(x) for x in dictionary.get('components')] + if dictionary.get("components") is not None: + components = [ + SubscriptionGroupSignupComponent.from_dictionary(x) + for x in dictionary.get("components") + ] else: components = APIHelper.SKIP - custom_price = SubscriptionCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP - calendar_billing = CalendarBilling.from_dictionary(dictionary.get('calendar_billing')) if 'calendar_billing' in dictionary.keys() else APIHelper.SKIP - metafields = dictionary.get("metafields") if dictionary.get("metafields") else APIHelper.SKIP + custom_price =\ + SubscriptionCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + calendar_billing =\ + CalendarBilling.from_dictionary( + dictionary.get("calendar_billing"))\ + if "calendar_billing" in dictionary.keys()\ + else APIHelper.SKIP + metafields =\ + dictionary.get("metafields")\ + if dictionary.get("metafields")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_handle, product_id, @@ -196,7 +240,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -207,7 +251,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -217,35 +260,175 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!r}, ' - f'offer_id={(self.offer_id if hasattr(self, "offer_id") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'primary={(self.primary if hasattr(self, "primary") else None)!r}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!r}, ' - f'coupon_codes={(self.coupon_codes if hasattr(self, "coupon_codes") else None)!r}, ' - f'components={(self.components if hasattr(self, "components") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'calendar_billing={(self.calendar_billing if hasattr(self, "calendar_billing") else None)!r}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _offer_id=( + self.offer_id + if hasattr(self, "offer_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _primary=( + self.primary + if hasattr(self, "primary") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _coupon_codes=( + self.coupon_codes + if hasattr(self, "coupon_codes") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _calendar_billing=( + self.calendar_billing + if hasattr(self, "calendar_billing") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_handle={_product_handle!r}, " + f"product_id={_product_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"product_price_point_handle={_product_price_point_handle!r}, " + f"offer_id={_offer_id!r}, " + f"reference={_reference!r}, " + f"primary={_primary!r}, " + f"currency={_currency!r}, " + f"coupon_codes={_coupon_codes!r}, " + f"components={_components!r}, " + f"custom_price={_custom_price!r}, " + f"calendar_billing={_calendar_billing!r}, " + f"metafields={_metafields!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!s}, ' - f'offer_id={(self.offer_id if hasattr(self, "offer_id") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'primary={(self.primary if hasattr(self, "primary") else None)!s}, ' - f'currency={(self.currency if hasattr(self, "currency") else None)!s}, ' - f'coupon_codes={(self.coupon_codes if hasattr(self, "coupon_codes") else None)!s}, ' - f'components={(self.components if hasattr(self, "components") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'calendar_billing={(self.calendar_billing if hasattr(self, "calendar_billing") else None)!s}, ' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _offer_id=( + self.offer_id + if hasattr(self, "offer_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _primary=( + self.primary + if hasattr(self, "primary") + else None + ) + _currency=( + self.currency + if hasattr(self, "currency") + else None + ) + _coupon_codes=( + self.coupon_codes + if hasattr(self, "coupon_codes") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _calendar_billing=( + self.calendar_billing + if hasattr(self, "calendar_billing") + else None + ) + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_handle={_product_handle!s}, " + f"product_id={_product_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"product_price_point_handle={_product_price_point_handle!s}, " + f"offer_id={_offer_id!s}, " + f"reference={_reference!s}, " + f"primary={_primary!s}, " + f"currency={_currency!s}, " + f"coupon_codes={_coupon_codes!s}, " + f"components={_components!s}, " + f"custom_price={_custom_price!s}, " + f"calendar_billing={_calendar_billing!s}, " + f"metafields={_metafields!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup_request.py b/advancedbilling/models/subscription_group_signup_request.py index 96f8ef5f..c57e3491 100644 --- a/advancedbilling/models/subscription_group_signup_request.py +++ b/advancedbilling/models/subscription_group_signup_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_group_signup import SubscriptionGroupSignup +# ruff: noqa: E501 +from advancedbilling.models.subscription_group_signup import ( + SubscriptionGroupSignup, +) -class SubscriptionGroupSignupRequest(object): +class SubscriptionGroupSignupRequest(object): """Implementation of the 'Subscription Group Signup Request' model. Attributes: - subscription_group (SubscriptionGroupSignup): The model property of - type SubscriptionGroupSignup. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscription_group (SubscriptionGroupSignup): The model property of type + SubscriptionGroupSignup. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_group": 'subscription_group' + "subscription_group": "subscription_group", } - def __init__(self, - subscription_group=None, - additional_properties=None): - """Constructor for the SubscriptionGroupSignupRequest class""" - + def __init__( + self, + subscription_group=None, + additional_properties=None): + """Initialize a SubscriptionGroupSignupRequest instance.""" # Initialize members of the class - self.subscription_group = subscription_group + self.subscription_group = subscription_group # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_group = SubscriptionGroupSignup.from_dictionary(dictionary.get('subscription_group')) if dictionary.get('subscription_group') else None + subscription_group =\ + SubscriptionGroupSignup.from_dictionary( + dictionary.get("subscription_group"))\ + if dictionary.get("subscription_group") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_group, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_signup_response.py b/advancedbilling/models/subscription_group_signup_response.py index d2403284..405fc649 100644 --- a/advancedbilling/models/subscription_group_signup_response.py +++ b/advancedbilling/models/subscription_group_signup_response.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_group_item import SubscriptionGroupItem +from advancedbilling.models.subscription_group_item import ( + SubscriptionGroupItem, +) class SubscriptionGroupSignupResponse(object): - """Implementation of the 'Subscription Group Signup Response' model. Attributes: @@ -22,151 +22,148 @@ class SubscriptionGroupSignupResponse(object): subscription_ids (List[int]): The model property of type List[int]. primary_subscription_id (int): The model property of type int. next_assessment_at (datetime): The model property of type datetime. - state (SubscriptionState): The state of a subscription. * **Live - States** * `active` - A normal, active subscription. It is not - in a trial and is paid and up to date. * `assessing` - An - internal (transient) state that indicates a subscription is in the - middle of periodic assessment. Do not base any access decisions in - your app on this state, as it may not always be exposed. * - `pending` - An internal (transient) state that indicates a - subscription is in the creation process. Do not base any access - decisions in your app on this state, as it may not always be - exposed. * `trialing` - A subscription in trialing state has a - valid trial subscription. This type of subscription may transition - to active once payment is received when the trial has ended. - Otherwise, it may go to a Problem or End of Life state. * - `paused` - An internal state that indicates that your account with - Advanced Billing is in arrears. * **Problem States** * - `past_due` - Indicates that the most recent payment has failed, - and payment is past due for this subscription. If you have enabled - our automated dunning, this subscription will be in the dunning - process (additional status and callbacks from the dunning process - will be available in the future). If you are handling dunning and - payment updates yourself, you will want to use this state to - initiate a payment update from your customers. * - `soft_failure` - Indicates that normal assessment/processing of - the subscription has failed for a reason that cannot be fixed by - the Customer. For example, a Soft Fail may result from a timeout - at the gateway or incorrect credentials on your part. The - subscriptions should be retried automatically. An interface is - being built for you to review problems resulting from these events - to take manual action when needed. * `unpaid` - Indicates an - unpaid subscription. A subscription is marked unpaid if the retry - period expires and you have configured your - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) settings to have a Final Action of `mark the - subscription unpaid`. * **End of Life States** * `canceled` - - Indicates a canceled subscription. This may happen at your request - (via the API or the web interface) or due to the expiration of the - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/2428707658356 - 5-Dunning-Overview) process without payment. See the - [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109 - 503629-Reactivating-and-Resuming) documentation for info on how to - restart a canceled subscription. While a subscription is - canceled, its period will not advance, it will not accrue any new - charges, and Advanced Billing will not attempt to collect the - overdue balance. * `expired` - Indicates a subscription that - has expired due to running its normal life cycle. Some products - may be configured to have an expiration period. An expired - subscription then is one that stayed active until it fulfilled its - full period. * `failed_to_create` - Indicates that signup has - failed. (You may see this state in a signup_failure webhook.) - * `on_hold` - Indicates that a subscription’s billing has been - temporarily stopped. While it is expected that the subscription - will resume and return to active status, this is still treated as - an “End of Life” state because the customer is not paying for - services during this time. * `suspended` - Indicates that a - prepaid subscription has used up all their prepayment balance. If - a prepayment is applied, it will return to an active state. * - `trial_ended` - A subscription in a trial_ended state is a - subscription that completed a no-obligation trial and did not have - a card on file at the expiration of the trial period. See [Product - Pricing – No Obligation - Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869- - Product-Editing) for more details. See [Subscription - States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853- - Subscription-States) for more info about subscription states and - state transitions. + state (SubscriptionState): The state of a subscription. * **Live States** + * `active` - A normal, active subscription. It is not in a trial and is + paid and up to date. * `assessing` - An internal (transient) state + that indicates a subscription is in the middle of periodic assessment. Do + not base any access decisions in your app on this state, as it may not + always be exposed. * `pending` - An internal (transient) state that + indicates a subscription is in the creation process. Do not base any + access decisions in your app on this state, as it may not always be + exposed. * `trialing` - A subscription in trialing state has a valid + trial subscription. This type of subscription may transition to active + once payment is received when the trial has ended. Otherwise, it may go + to a Problem or End of Life state. * `paused` - An internal state + that indicates that your account with Advanced Billing is in arrears. * + **Problem States** * `past_due` - Indicates that the most recent + payment has failed, and payment is past due for this subscription. If you + have enabled our automated dunning, this subscription will be in the + dunning process (additional status and callbacks from the dunning process + will be available in the future). If you are handling dunning and payment + updates yourself, you will want to use this state to initiate a payment + update from your customers. * `soft_failure` - Indicates that normal + assessment/processing of the subscription has failed for a reason that + cannot be fixed by the Customer. For example, a Soft Fail may result from + a timeout at the gateway or incorrect credentials on your part. The + subscriptions should be retried automatically. An interface is being + built for you to review problems resulting from these events to take + manual action when needed. * `unpaid` - Indicates an unpaid + subscription. A subscription is marked unpaid if the retry period expires + and you have configured your + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) settings to have a Final Action of `mark the subscription + unpaid`. * **End of Life States** * `canceled` - Indicates a canceled + subscription. This may happen at your request (via the API or the web + interface) or due to the expiration of the + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni + ng-Overview) process without payment. See the + [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629- + Reactivating-and-Resuming) documentation for info on how to restart a + canceled subscription. While a subscription is canceled, its period + will not advance, it will not accrue any new charges, and Advanced + Billing will not attempt to collect the overdue balance. * `expired` + - Indicates a subscription that has expired due to running its normal + life cycle. Some products may be configured to have an expiration period. + An expired subscription then is one that stayed active until it fulfilled + its full period. * `failed_to_create` - Indicates that signup has + failed. (You may see this state in a signup_failure webhook.) * + `on_hold` - Indicates that a subscription’s billing has been temporarily + stopped. While it is expected that the subscription will resume and + return to active status, this is still treated as an “End of Life” state + because the customer is not paying for services during this time. * + `suspended` - Indicates that a prepaid subscription has used up all their + prepayment balance. If a prepayment is applied, it will return to an + active state. * `trial_ended` - A subscription in a trial_ended state + is a subscription that completed a no-obligation trial and did not have a + card on file at the expiration of the trial period. See [Product Pricing + – No Obligation + Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product + -Editing) for more details. See [Subscription + States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri + ption-States) for more info about subscription states and state + transitions. cancel_at_end_of_period (bool): The model property of type bool. - subscriptions (List[SubscriptionGroupItem]): The model property of - type List[SubscriptionGroupItem]. - payment_collection_method (CollectionMethod): The type of payment - collection to be used in the subscription. For legacy Statements - Architecture valid options are - `invoice`, `automatic`. For - current Relationship Invoicing Architecture valid options are - - `remittance`, `automatic`, `prepaid`. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscriptions (List[SubscriptionGroupItem]): The model property of type + List[SubscriptionGroupItem]. + payment_collection_method (CollectionMethod): The type of payment collection + to be used in the subscription. For legacy Statements Architecture valid + options are - `invoice`, `automatic`. For current Relationship Invoicing + Architecture valid options are - `remittance`, `automatic`, `prepaid`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "uid": 'uid', - "scheme": 'scheme', - "customer_id": 'customer_id', - "payment_profile_id": 'payment_profile_id', - "subscription_ids": 'subscription_ids', - "primary_subscription_id": 'primary_subscription_id', - "next_assessment_at": 'next_assessment_at', - "state": 'state', - "cancel_at_end_of_period": 'cancel_at_end_of_period', - "subscriptions": 'subscriptions', - "payment_collection_method": 'payment_collection_method' + "uid": "uid", + "scheme": "scheme", + "customer_id": "customer_id", + "payment_profile_id": "payment_profile_id", + "subscription_ids": "subscription_ids", + "primary_subscription_id": "primary_subscription_id", + "next_assessment_at": "next_assessment_at", + "state": "state", + "cancel_at_end_of_period": "cancel_at_end_of_period", + "subscriptions": "subscriptions", + "payment_collection_method": "payment_collection_method", } _optionals = [ - 'uid', - 'scheme', - 'customer_id', - 'payment_profile_id', - 'subscription_ids', - 'primary_subscription_id', - 'next_assessment_at', - 'state', - 'cancel_at_end_of_period', - 'subscriptions', - 'payment_collection_method', + "uid", + "scheme", + "customer_id", + "payment_profile_id", + "subscription_ids", + "primary_subscription_id", + "next_assessment_at", + "state", + "cancel_at_end_of_period", + "subscriptions", + "payment_collection_method", ] - def __init__(self, - uid=APIHelper.SKIP, - scheme=APIHelper.SKIP, - customer_id=APIHelper.SKIP, - payment_profile_id=APIHelper.SKIP, - subscription_ids=APIHelper.SKIP, - primary_subscription_id=APIHelper.SKIP, - next_assessment_at=APIHelper.SKIP, - state=APIHelper.SKIP, - cancel_at_end_of_period=APIHelper.SKIP, - subscriptions=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupSignupResponse class""" - + def __init__( + self, + uid=APIHelper.SKIP, + scheme=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + payment_profile_id=APIHelper.SKIP, + subscription_ids=APIHelper.SKIP, + primary_subscription_id=APIHelper.SKIP, + next_assessment_at=APIHelper.SKIP, + state=APIHelper.SKIP, + cancel_at_end_of_period=APIHelper.SKIP, + subscriptions=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupSignupResponse instance.""" # Initialize members of the class if uid is not APIHelper.SKIP: - self.uid = uid + self.uid = uid if scheme is not APIHelper.SKIP: - self.scheme = scheme + self.scheme = scheme if customer_id is not APIHelper.SKIP: - self.customer_id = customer_id + self.customer_id = customer_id if payment_profile_id is not APIHelper.SKIP: - self.payment_profile_id = payment_profile_id + self.payment_profile_id = payment_profile_id if subscription_ids is not APIHelper.SKIP: - self.subscription_ids = subscription_ids + self.subscription_ids = subscription_ids if primary_subscription_id is not APIHelper.SKIP: - self.primary_subscription_id = primary_subscription_id + self.primary_subscription_id = primary_subscription_id if next_assessment_at is not APIHelper.SKIP: - self.next_assessment_at = APIHelper.apply_datetime_converter(next_assessment_at, APIHelper.RFC3339DateTime) if next_assessment_at else None + self.next_assessment_at =\ + APIHelper.apply_datetime_converter( + next_assessment_at, APIHelper.RFC3339DateTime)\ + if next_assessment_at else None if state is not APIHelper.SKIP: - self.state = state + self.state = state if cancel_at_end_of_period is not APIHelper.SKIP: - self.cancel_at_end_of_period = cancel_at_end_of_period + self.cancel_at_end_of_period = cancel_at_end_of_period if subscriptions is not APIHelper.SKIP: - self.subscriptions = subscriptions + self.subscriptions = subscriptions if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method # Add additional model properties to the instance if additional_properties is None: @@ -176,7 +173,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -187,28 +184,62 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP - scheme = dictionary.get("scheme") if dictionary.get("scheme") else APIHelper.SKIP - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else APIHelper.SKIP - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else APIHelper.SKIP - subscription_ids = dictionary.get("subscription_ids") if dictionary.get("subscription_ids") else APIHelper.SKIP - primary_subscription_id = dictionary.get("primary_subscription_id") if dictionary.get("primary_subscription_id") else APIHelper.SKIP - next_assessment_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_assessment_at")).datetime if dictionary.get("next_assessment_at") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - cancel_at_end_of_period = dictionary.get("cancel_at_end_of_period") if "cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + scheme =\ + dictionary.get("scheme")\ + if dictionary.get("scheme")\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if dictionary.get("customer_id")\ + else APIHelper.SKIP + payment_profile_id =\ + dictionary.get("payment_profile_id")\ + if dictionary.get("payment_profile_id")\ + else APIHelper.SKIP + subscription_ids =\ + dictionary.get("subscription_ids")\ + if dictionary.get("subscription_ids")\ + else APIHelper.SKIP + primary_subscription_id =\ + dictionary.get("primary_subscription_id")\ + if dictionary.get("primary_subscription_id")\ + else APIHelper.SKIP + next_assessment_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_assessment_at")).datetime\ + if dictionary.get("next_assessment_at") else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + cancel_at_end_of_period =\ + dictionary.get("cancel_at_end_of_period")\ + if "cancel_at_end_of_period" in dictionary.keys()\ + else APIHelper.SKIP subscriptions = None - if dictionary.get('subscriptions') is not None: - subscriptions = [SubscriptionGroupItem.from_dictionary(x) for x in dictionary.get('subscriptions')] + if dictionary.get("subscriptions") is not None: + subscriptions = [ + SubscriptionGroupItem.from_dictionary(x) + for x in dictionary.get("subscriptions") + ] else: subscriptions = APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(uid, scheme, @@ -224,31 +255,151 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!r}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!r}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!r}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!r}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!r}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!r}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!r}, ' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!r}, " + f"scheme={_scheme!r}, " + f"customer_id={_customer_id!r}, " + f"payment_profile_id={_payment_profile_id!r}, " + f"subscription_ids={_subscription_ids!r}, " + f"primary_subscription_id={_primary_subscription_id!r}, " + f"next_assessment_at={_next_assessment_at!r}, " + f"state={_state!r}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!r}, " + f"subscriptions={_subscriptions!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'uid={(self.uid if hasattr(self, "uid") else None)!s}, ' - f'scheme={(self.scheme if hasattr(self, "scheme") else None)!s}, ' - f'customer_id={(self.customer_id if hasattr(self, "customer_id") else None)!s}, ' - f'payment_profile_id={(self.payment_profile_id if hasattr(self, "payment_profile_id") else None)!s}, ' - f'subscription_ids={(self.subscription_ids if hasattr(self, "subscription_ids") else None)!s}, ' - f'primary_subscription_id={(self.primary_subscription_id if hasattr(self, "primary_subscription_id") else None)!s}, ' - f'next_assessment_at={(self.next_assessment_at if hasattr(self, "next_assessment_at") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'cancel_at_end_of_period={(self.cancel_at_end_of_period if hasattr(self, "cancel_at_end_of_period") else None)!s}, ' - f'subscriptions={(self.subscriptions if hasattr(self, "subscriptions") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _scheme=( + self.scheme + if hasattr(self, "scheme") + else None + ) + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _payment_profile_id=( + self.payment_profile_id + if hasattr(self, "payment_profile_id") + else None + ) + _subscription_ids=( + self.subscription_ids + if hasattr(self, "subscription_ids") + else None + ) + _primary_subscription_id=( + self.primary_subscription_id + if hasattr(self, "primary_subscription_id") + else None + ) + _next_assessment_at=( + self.next_assessment_at + if hasattr(self, "next_assessment_at") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _cancel_at_end_of_period=( + self.cancel_at_end_of_period + if hasattr(self, "cancel_at_end_of_period") + else None + ) + _subscriptions=( + self.subscriptions + if hasattr(self, "subscriptions") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"uid={_uid!s}, " + f"scheme={_scheme!s}, " + f"customer_id={_customer_id!s}, " + f"payment_profile_id={_payment_profile_id!s}, " + f"subscription_ids={_subscription_ids!s}, " + f"primary_subscription_id={_primary_subscription_id!s}, " + f"next_assessment_at={_next_assessment_at!s}, " + f"state={_state!s}, " + f"cancel_at_end_of_period={_cancel_at_end_of_period!s}, " + f"subscriptions={_subscriptions!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_single_error.py b/advancedbilling/models/subscription_group_single_error.py index fa1f6f3e..cc03afc4 100644 --- a/advancedbilling/models/subscription_group_single_error.py +++ b/advancedbilling/models/subscription_group_single_error.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupSingleError(object): - """Implementation of the 'Subscription Group Single Error' model. Attributes: subscription_group (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_group": 'subscription_group' + "subscription_group": "subscription_group", } - def __init__(self, - subscription_group=None, - additional_properties=None): - """Constructor for the SubscriptionGroupSingleError class""" - + def __init__( + self, + subscription_group=None, + additional_properties=None): + """Initialize a SubscriptionGroupSingleError instance.""" # Initialize members of the class - self.subscription_group = subscription_group + self.subscription_group = subscription_group # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,21 +50,26 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_group = dictionary.get("subscription_group") if dictionary.get("subscription_group") else None + subscription_group =\ + dictionary.get("subscription_group")\ + if dictionary.get("subscription_group")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_group, additional_properties) @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -77,23 +80,44 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.subscription_group, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.subscription_group, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('subscription_group'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("subscription_group"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_subscription_error.py b/advancedbilling/models/subscription_group_subscription_error.py index 9938c640..26714f99 100644 --- a/advancedbilling/models/subscription_group_subscription_error.py +++ b/advancedbilling/models/subscription_group_subscription_error.py @@ -1,91 +1,87 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupSubscriptionError(object): - """Implementation of the 'Subscription Group Subscription Error' model. Object which contains subscription errors. Attributes: product (List[str]): The model property of type List[str]. - product_price_point_id (List[str]): The model property of type - List[str]. + product_price_point_id (List[str]): The model property of type List[str]. payment_profile (List[str]): The model property of type List[str]. payment_profile_chargify_token (List[str]): The model property of type List[str]. base (List[str]): The model property of type List[str]. - payment_profile_expiration_month (List[str]): The model property of - type List[str]. - payment_profile_expiration_year (List[str]): The model property of - type List[str]. - payment_profile_full_number (List[str]): The model property of type + payment_profile_expiration_month (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + payment_profile_expiration_year (List[str]): The model property of type + List[str]. + payment_profile_full_number (List[str]): The model property of type List[str]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product": 'product', - "product_price_point_id": 'product_price_point_id', - "payment_profile": 'payment_profile', - "payment_profile_chargify_token": 'payment_profile.chargify_token', - "base": 'base', - "payment_profile_expiration_month": 'payment_profile.expiration_month', - "payment_profile_expiration_year": 'payment_profile.expiration_year', - "payment_profile_full_number": 'payment_profile.full_number' + "product": "product", + "product_price_point_id": "product_price_point_id", + "payment_profile": "payment_profile", + "payment_profile_chargify_token": "payment_profile.chargify_token", + "base": "base", + "payment_profile_expiration_month": "payment_profile.expiration_month", + "payment_profile_expiration_year": "payment_profile.expiration_year", + "payment_profile_full_number": "payment_profile.full_number", } _optionals = [ - 'product', - 'product_price_point_id', - 'payment_profile', - 'payment_profile_chargify_token', - 'base', - 'payment_profile_expiration_month', - 'payment_profile_expiration_year', - 'payment_profile_full_number', + "product", + "product_price_point_id", + "payment_profile", + "payment_profile_chargify_token", + "base", + "payment_profile_expiration_month", + "payment_profile_expiration_year", + "payment_profile_full_number", ] - def __init__(self, - product=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - payment_profile=APIHelper.SKIP, - payment_profile_chargify_token=APIHelper.SKIP, - base=APIHelper.SKIP, - payment_profile_expiration_month=APIHelper.SKIP, - payment_profile_expiration_year=APIHelper.SKIP, - payment_profile_full_number=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupSubscriptionError class""" - + def __init__( + self, + product=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + payment_profile=APIHelper.SKIP, + payment_profile_chargify_token=APIHelper.SKIP, + base=APIHelper.SKIP, + payment_profile_expiration_month=APIHelper.SKIP, + payment_profile_expiration_year=APIHelper.SKIP, + payment_profile_full_number=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupSubscriptionError instance.""" # Initialize members of the class if product is not APIHelper.SKIP: - self.product = product + self.product = product if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if payment_profile is not APIHelper.SKIP: - self.payment_profile = payment_profile + self.payment_profile = payment_profile if payment_profile_chargify_token is not APIHelper.SKIP: - self.payment_profile_chargify_token = payment_profile_chargify_token + self.payment_profile_chargify_token = payment_profile_chargify_token if base is not APIHelper.SKIP: - self.base = base + self.base = base if payment_profile_expiration_month is not APIHelper.SKIP: - self.payment_profile_expiration_month = payment_profile_expiration_month + self.payment_profile_expiration_month = payment_profile_expiration_month if payment_profile_expiration_year is not APIHelper.SKIP: - self.payment_profile_expiration_year = payment_profile_expiration_year + self.payment_profile_expiration_year = payment_profile_expiration_year if payment_profile_full_number is not APIHelper.SKIP: - self.payment_profile_full_number = payment_profile_full_number + self.payment_profile_full_number = payment_profile_full_number # Add additional model properties to the instance if additional_properties is None: @@ -95,7 +91,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -106,21 +102,47 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product = dictionary.get("product") if dictionary.get("product") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - payment_profile = dictionary.get("payment_profile") if dictionary.get("payment_profile") else APIHelper.SKIP - payment_profile_chargify_token = dictionary.get("payment_profile.chargify_token") if dictionary.get("payment_profile.chargify_token") else APIHelper.SKIP - base = dictionary.get("base") if dictionary.get("base") else APIHelper.SKIP - payment_profile_expiration_month = dictionary.get("payment_profile.expiration_month") if dictionary.get("payment_profile.expiration_month") else APIHelper.SKIP - payment_profile_expiration_year = dictionary.get("payment_profile.expiration_year") if dictionary.get("payment_profile.expiration_year") else APIHelper.SKIP - payment_profile_full_number = dictionary.get("payment_profile.full_number") if dictionary.get("payment_profile.full_number") else APIHelper.SKIP + product =\ + dictionary.get("product")\ + if dictionary.get("product")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + payment_profile =\ + dictionary.get("payment_profile")\ + if dictionary.get("payment_profile")\ + else APIHelper.SKIP + payment_profile_chargify_token =\ + dictionary.get("payment_profile.chargify_token")\ + if dictionary.get("payment_profile.chargify_token")\ + else APIHelper.SKIP + base =\ + dictionary.get("base")\ + if dictionary.get("base")\ + else APIHelper.SKIP + payment_profile_expiration_month =\ + dictionary.get("payment_profile.expiration_month")\ + if dictionary.get("payment_profile.expiration_month")\ + else APIHelper.SKIP + payment_profile_expiration_year =\ + dictionary.get("payment_profile.expiration_year")\ + if dictionary.get("payment_profile.expiration_year")\ + else APIHelper.SKIP + payment_profile_full_number =\ + dictionary.get("payment_profile.full_number")\ + if dictionary.get("payment_profile.full_number")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product, product_price_point_id, @@ -133,25 +155,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product={(self.product if hasattr(self, "product") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'payment_profile={(self.payment_profile if hasattr(self, "payment_profile") else None)!r}, ' - f'payment_profile_chargify_token={(self.payment_profile_chargify_token if hasattr(self, "payment_profile_chargify_token") else None)!r}, ' - f'base={(self.base if hasattr(self, "base") else None)!r}, ' - f'payment_profile_expiration_month={(self.payment_profile_expiration_month if hasattr(self, "payment_profile_expiration_month") else None)!r}, ' - f'payment_profile_expiration_year={(self.payment_profile_expiration_year if hasattr(self, "payment_profile_expiration_year") else None)!r}, ' - f'payment_profile_full_number={(self.payment_profile_full_number if hasattr(self, "payment_profile_full_number") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product=( + self.product + if hasattr(self, "product") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _payment_profile=( + self.payment_profile + if hasattr(self, "payment_profile") + else None + ) + _payment_profile_chargify_token=( + self.payment_profile_chargify_token + if hasattr(self, "payment_profile_chargify_token") + else None + ) + _base=( + self.base + if hasattr(self, "base") + else None + ) + _payment_profile_expiration_month=( + self.payment_profile_expiration_month + if hasattr(self, "payment_profile_expiration_month") + else None + ) + _payment_profile_expiration_year=( + self.payment_profile_expiration_year + if hasattr(self, "payment_profile_expiration_year") + else None + ) + _payment_profile_full_number=( + self.payment_profile_full_number + if hasattr(self, "payment_profile_full_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product={_product!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"payment_profile={_payment_profile!r}, " + f"payment_profile_chargify_token={_payment_profile_chargify_token!r}, " + f"base={_base!r}, " + f"payment_profile_expiration_month={_payment_profile_expiration_month!r}, " + f"payment_profile_expiration_year={_payment_profile_expiration_year!r}, " + f"payment_profile_full_number={_payment_profile_full_number!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product={(self.product if hasattr(self, "product") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'payment_profile={(self.payment_profile if hasattr(self, "payment_profile") else None)!s}, ' - f'payment_profile_chargify_token={(self.payment_profile_chargify_token if hasattr(self, "payment_profile_chargify_token") else None)!s}, ' - f'base={(self.base if hasattr(self, "base") else None)!s}, ' - f'payment_profile_expiration_month={(self.payment_profile_expiration_month if hasattr(self, "payment_profile_expiration_month") else None)!s}, ' - f'payment_profile_expiration_year={(self.payment_profile_expiration_year if hasattr(self, "payment_profile_expiration_year") else None)!s}, ' - f'payment_profile_full_number={(self.payment_profile_full_number if hasattr(self, "payment_profile_full_number") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product=( + self.product + if hasattr(self, "product") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _payment_profile=( + self.payment_profile + if hasattr(self, "payment_profile") + else None + ) + _payment_profile_chargify_token=( + self.payment_profile_chargify_token + if hasattr(self, "payment_profile_chargify_token") + else None + ) + _base=( + self.base + if hasattr(self, "base") + else None + ) + _payment_profile_expiration_month=( + self.payment_profile_expiration_month + if hasattr(self, "payment_profile_expiration_month") + else None + ) + _payment_profile_expiration_year=( + self.payment_profile_expiration_year + if hasattr(self, "payment_profile_expiration_year") + else None + ) + _payment_profile_full_number=( + self.payment_profile_full_number + if hasattr(self, "payment_profile_full_number") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product={_product!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"payment_profile={_payment_profile!s}, " + f"payment_profile_chargify_token={_payment_profile_chargify_token!s}, " + f"base={_base!s}, " + f"payment_profile_expiration_month={_payment_profile_expiration_month!s}, " + f"payment_profile_expiration_year={_payment_profile_expiration_year!s}, " + f"payment_profile_full_number={_payment_profile_full_number!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_group_update_error.py b/advancedbilling/models/subscription_group_update_error.py index fd49b1a9..c6d30c41 100644 --- a/advancedbilling/models/subscription_group_update_error.py +++ b/advancedbilling/models/subscription_group_update_error.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionGroupUpdateError(object): - """Implementation of the 'Subscription Group Update Error' model. Attributes: members (List[str]): The model property of type List[str]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "members": 'members' + "members": "members", } _optionals = [ - 'members', + "members", ] - def __init__(self, - members=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionGroupUpdateError class""" - + def __init__( + self, + members=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionGroupUpdateError instance.""" # Initialize members of the class if members is not APIHelper.SKIP: - self.members = members + self.members = members # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - members = dictionary.get("members") if dictionary.get("members") else APIHelper.SKIP + members =\ + dictionary.get("members")\ + if dictionary.get("members")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(members, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'members={(self.members if hasattr(self, "members") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _members=( + self.members + if hasattr(self, "members") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"members={_members!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'members={(self.members if hasattr(self, "members") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _members=( + self.members + if hasattr(self, "members") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"members={_members!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_groups_list_include.py b/advancedbilling/models/subscription_groups_list_include.py index c2c94928..5abbea58 100644 --- a/advancedbilling/models/subscription_groups_list_include.py +++ b/advancedbilling/models/subscription_groups_list_include.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionGroupsListInclude(object): - """Implementation of the 'Subscription Groups List Include' enum. Attributes: ACCOUNT_BALANCES: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - ACCOUNT_BALANCES = 'account_balances' + + ACCOUNT_BALANCES = "account_balances" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_include.py b/advancedbilling/models/subscription_include.py index 3940e483..bdf93abd 100644 --- a/advancedbilling/models/subscription_include.py +++ b/advancedbilling/models/subscription_include.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionInclude(object): - """Implementation of the 'Subscription Include' enum. Attributes: COUPONS: The enum member of type str. SELF_SERVICE_PAGE_TOKEN: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - COUPONS = 'coupons' - SELF_SERVICE_PAGE_TOKEN = 'self_service_page_token' + COUPONS = "coupons" + + SELF_SERVICE_PAGE_TOKEN = "self_service_page_token" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_included_coupon.py b/advancedbilling/models/subscription_included_coupon.py index b8a86beb..724ce84c 100644 --- a/advancedbilling/models/subscription_included_coupon.py +++ b/advancedbilling/models/subscription_included_coupon.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionIncludedCoupon(object): - """Implementation of the 'Subscription Included Coupon' model. Attributes: @@ -21,64 +19,64 @@ class SubscriptionIncludedCoupon(object): recurring (bool): The model property of type bool. amount_in_cents (int): The model property of type int. percentage (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "code": 'code', - "use_count": 'use_count', - "uses_allowed": 'uses_allowed', - "expires_at": 'expires_at', - "recurring": 'recurring', - "amount_in_cents": 'amount_in_cents', - "percentage": 'percentage' + "code": "code", + "use_count": "use_count", + "uses_allowed": "uses_allowed", + "expires_at": "expires_at", + "recurring": "recurring", + "amount_in_cents": "amount_in_cents", + "percentage": "percentage", } _optionals = [ - 'code', - 'use_count', - 'uses_allowed', - 'expires_at', - 'recurring', - 'amount_in_cents', - 'percentage', + "code", + "use_count", + "uses_allowed", + "expires_at", + "recurring", + "amount_in_cents", + "percentage", ] _nullables = [ - 'expires_at', - 'amount_in_cents', - 'percentage', + "expires_at", + "amount_in_cents", + "percentage", ] - def __init__(self, - code=APIHelper.SKIP, - use_count=APIHelper.SKIP, - uses_allowed=APIHelper.SKIP, - expires_at=APIHelper.SKIP, - recurring=APIHelper.SKIP, - amount_in_cents=APIHelper.SKIP, - percentage=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionIncludedCoupon class""" - + def __init__( + self, + code=APIHelper.SKIP, + use_count=APIHelper.SKIP, + uses_allowed=APIHelper.SKIP, + expires_at=APIHelper.SKIP, + recurring=APIHelper.SKIP, + amount_in_cents=APIHelper.SKIP, + percentage=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionIncludedCoupon instance.""" # Initialize members of the class if code is not APIHelper.SKIP: - self.code = code + self.code = code if use_count is not APIHelper.SKIP: - self.use_count = use_count + self.use_count = use_count if uses_allowed is not APIHelper.SKIP: - self.uses_allowed = uses_allowed + self.uses_allowed = uses_allowed if expires_at is not APIHelper.SKIP: - self.expires_at = expires_at + self.expires_at = expires_at if recurring is not APIHelper.SKIP: - self.recurring = recurring + self.recurring = recurring if amount_in_cents is not APIHelper.SKIP: - self.amount_in_cents = amount_in_cents + self.amount_in_cents = amount_in_cents if percentage is not APIHelper.SKIP: - self.percentage = percentage + self.percentage = percentage # Add additional model properties to the instance if additional_properties is None: @@ -88,7 +86,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -99,20 +97,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - use_count = dictionary.get("use_count") if dictionary.get("use_count") else APIHelper.SKIP - uses_allowed = dictionary.get("uses_allowed") if dictionary.get("uses_allowed") else APIHelper.SKIP - expires_at = dictionary.get("expires_at") if "expires_at" in dictionary.keys() else APIHelper.SKIP - recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP - amount_in_cents = dictionary.get("amount_in_cents") if "amount_in_cents" in dictionary.keys() else APIHelper.SKIP - percentage = dictionary.get("percentage") if "percentage" in dictionary.keys() else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + use_count =\ + dictionary.get("use_count")\ + if dictionary.get("use_count")\ + else APIHelper.SKIP + uses_allowed =\ + dictionary.get("uses_allowed")\ + if dictionary.get("uses_allowed")\ + else APIHelper.SKIP + expires_at =\ + dictionary.get("expires_at")\ + if "expires_at" in dictionary.keys()\ + else APIHelper.SKIP + recurring =\ + dictionary.get("recurring")\ + if "recurring" in dictionary.keys()\ + else APIHelper.SKIP + amount_in_cents =\ + dictionary.get("amount_in_cents")\ + if "amount_in_cents" in dictionary.keys()\ + else APIHelper.SKIP + percentage =\ + dictionary.get("percentage")\ + if "percentage" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(code, use_count, @@ -125,7 +146,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -136,7 +157,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -146,23 +166,103 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'use_count={(self.use_count if hasattr(self, "use_count") else None)!r}, ' - f'uses_allowed={(self.uses_allowed if hasattr(self, "uses_allowed") else None)!r}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!r}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!r}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _code=( + self.code + if hasattr(self, "code") + else None + ) + _use_count=( + self.use_count + if hasattr(self, "use_count") + else None + ) + _uses_allowed=( + self.uses_allowed + if hasattr(self, "uses_allowed") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!r}, " + f"use_count={_use_count!r}, " + f"uses_allowed={_uses_allowed!r}, " + f"expires_at={_expires_at!r}, " + f"recurring={_recurring!r}, " + f"amount_in_cents={_amount_in_cents!r}, " + f"percentage={_percentage!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'use_count={(self.use_count if hasattr(self, "use_count") else None)!s}, ' - f'uses_allowed={(self.uses_allowed if hasattr(self, "uses_allowed") else None)!s}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'recurring={(self.recurring if hasattr(self, "recurring") else None)!s}, ' - f'amount_in_cents={(self.amount_in_cents if hasattr(self, "amount_in_cents") else None)!s}, ' - f'percentage={(self.percentage if hasattr(self, "percentage") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _code=( + self.code + if hasattr(self, "code") + else None + ) + _use_count=( + self.use_count + if hasattr(self, "use_count") + else None + ) + _uses_allowed=( + self.uses_allowed + if hasattr(self, "uses_allowed") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _recurring=( + self.recurring + if hasattr(self, "recurring") + else None + ) + _amount_in_cents=( + self.amount_in_cents + if hasattr(self, "amount_in_cents") + else None + ) + _percentage=( + self.percentage + if hasattr(self, "percentage") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!s}, " + f"use_count={_use_count!s}, " + f"uses_allowed={_uses_allowed!s}, " + f"expires_at={_expires_at!s}, " + f"recurring={_recurring!s}, " + f"amount_in_cents={_amount_in_cents!s}, " + f"percentage={_percentage!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_list_date_field.py b/advancedbilling/models/subscription_list_date_field.py index a1d4b9ce..8feb39e9 100644 --- a/advancedbilling/models/subscription_list_date_field.py +++ b/advancedbilling/models/subscription_list_date_field.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionListDateField(object): - """Implementation of the 'Subscription List Date Field' enum. Attributes: UPDATED_AT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - UPDATED_AT = 'updated_at' + + UPDATED_AT = "updated_at" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_list_include.py b/advancedbilling/models/subscription_list_include.py index a21de968..1bca832d 100644 --- a/advancedbilling/models/subscription_list_include.py +++ b/advancedbilling/models/subscription_list_include.py @@ -1,27 +1,26 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionListInclude(object): - """Implementation of the 'Subscription List Include' enum. Attributes: SELF_SERVICE_PAGE_TOKEN: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - SELF_SERVICE_PAGE_TOKEN = 'self_service_page_token' + + SELF_SERVICE_PAGE_TOKEN = "self_service_page_token" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_migration_preview.py b/advancedbilling/models/subscription_migration_preview.py index 483f21c6..3aa928c7 100644 --- a/advancedbilling/models/subscription_migration_preview.py +++ b/advancedbilling/models/subscription_migration_preview.py @@ -1,66 +1,63 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionMigrationPreview(object): - """Implementation of the 'Subscription Migration Preview' model. Attributes: - prorated_adjustment_in_cents (int): The amount of the prorated - adjustment that would be issued for the current subscription. - charge_in_cents (int): The amount of the charge that would be created - for the new product. - payment_due_in_cents (int): The amount of the payment due in the case - of an upgrade. - credit_applied_in_cents (int): Represents a credit in cents that is - applied to your subscription as part of a migration process for a - specific product, which reduces the amount owed for the - subscription. - additional_properties (Dict[str, object]): The additional properties - for the model. + prorated_adjustment_in_cents (int): The amount of the prorated adjustment + that would be issued for the current subscription. + charge_in_cents (int): The amount of the charge that would be created for the + new product. + payment_due_in_cents (int): The amount of the payment due in the case of an + upgrade. + credit_applied_in_cents (int): Represents a credit in cents that is applied + to your subscription as part of a migration process for a specific + product, which reduces the amount owed for the subscription. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prorated_adjustment_in_cents": 'prorated_adjustment_in_cents', - "charge_in_cents": 'charge_in_cents', - "payment_due_in_cents": 'payment_due_in_cents', - "credit_applied_in_cents": 'credit_applied_in_cents' + "prorated_adjustment_in_cents": "prorated_adjustment_in_cents", + "charge_in_cents": "charge_in_cents", + "payment_due_in_cents": "payment_due_in_cents", + "credit_applied_in_cents": "credit_applied_in_cents", } _optionals = [ - 'prorated_adjustment_in_cents', - 'charge_in_cents', - 'payment_due_in_cents', - 'credit_applied_in_cents', + "prorated_adjustment_in_cents", + "charge_in_cents", + "payment_due_in_cents", + "credit_applied_in_cents", ] - def __init__(self, - prorated_adjustment_in_cents=APIHelper.SKIP, - charge_in_cents=APIHelper.SKIP, - payment_due_in_cents=APIHelper.SKIP, - credit_applied_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionMigrationPreview class""" - + def __init__( + self, + prorated_adjustment_in_cents=APIHelper.SKIP, + charge_in_cents=APIHelper.SKIP, + payment_due_in_cents=APIHelper.SKIP, + credit_applied_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionMigrationPreview instance.""" # Initialize members of the class if prorated_adjustment_in_cents is not APIHelper.SKIP: - self.prorated_adjustment_in_cents = prorated_adjustment_in_cents + self.prorated_adjustment_in_cents = prorated_adjustment_in_cents if charge_in_cents is not APIHelper.SKIP: - self.charge_in_cents = charge_in_cents + self.charge_in_cents = charge_in_cents if payment_due_in_cents is not APIHelper.SKIP: - self.payment_due_in_cents = payment_due_in_cents + self.payment_due_in_cents = payment_due_in_cents if credit_applied_in_cents is not APIHelper.SKIP: - self.credit_applied_in_cents = credit_applied_in_cents + self.credit_applied_in_cents = credit_applied_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -70,7 +67,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -81,17 +78,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prorated_adjustment_in_cents = dictionary.get("prorated_adjustment_in_cents") if dictionary.get("prorated_adjustment_in_cents") else APIHelper.SKIP - charge_in_cents = dictionary.get("charge_in_cents") if dictionary.get("charge_in_cents") else APIHelper.SKIP - payment_due_in_cents = dictionary.get("payment_due_in_cents") if dictionary.get("payment_due_in_cents") else APIHelper.SKIP - credit_applied_in_cents = dictionary.get("credit_applied_in_cents") if dictionary.get("credit_applied_in_cents") else APIHelper.SKIP + prorated_adjustment_in_cents =\ + dictionary.get("prorated_adjustment_in_cents")\ + if dictionary.get("prorated_adjustment_in_cents")\ + else APIHelper.SKIP + charge_in_cents =\ + dictionary.get("charge_in_cents")\ + if dictionary.get("charge_in_cents")\ + else APIHelper.SKIP + payment_due_in_cents =\ + dictionary.get("payment_due_in_cents")\ + if dictionary.get("payment_due_in_cents")\ + else APIHelper.SKIP + credit_applied_in_cents =\ + dictionary.get("credit_applied_in_cents")\ + if dictionary.get("credit_applied_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prorated_adjustment_in_cents, charge_in_cents, @@ -100,17 +111,67 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prorated_adjustment_in_cents={(self.prorated_adjustment_in_cents if hasattr(self, "prorated_adjustment_in_cents") else None)!r}, ' - f'charge_in_cents={(self.charge_in_cents if hasattr(self, "charge_in_cents") else None)!r}, ' - f'payment_due_in_cents={(self.payment_due_in_cents if hasattr(self, "payment_due_in_cents") else None)!r}, ' - f'credit_applied_in_cents={(self.credit_applied_in_cents if hasattr(self, "credit_applied_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prorated_adjustment_in_cents=( + self.prorated_adjustment_in_cents + if hasattr(self, "prorated_adjustment_in_cents") + else None + ) + _charge_in_cents=( + self.charge_in_cents + if hasattr(self, "charge_in_cents") + else None + ) + _payment_due_in_cents=( + self.payment_due_in_cents + if hasattr(self, "payment_due_in_cents") + else None + ) + _credit_applied_in_cents=( + self.credit_applied_in_cents + if hasattr(self, "credit_applied_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prorated_adjustment_in_cents={_prorated_adjustment_in_cents!r}, " + f"charge_in_cents={_charge_in_cents!r}, " + f"payment_due_in_cents={_payment_due_in_cents!r}, " + f"credit_applied_in_cents={_credit_applied_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prorated_adjustment_in_cents={(self.prorated_adjustment_in_cents if hasattr(self, "prorated_adjustment_in_cents") else None)!s}, ' - f'charge_in_cents={(self.charge_in_cents if hasattr(self, "charge_in_cents") else None)!s}, ' - f'payment_due_in_cents={(self.payment_due_in_cents if hasattr(self, "payment_due_in_cents") else None)!s}, ' - f'credit_applied_in_cents={(self.credit_applied_in_cents if hasattr(self, "credit_applied_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prorated_adjustment_in_cents=( + self.prorated_adjustment_in_cents + if hasattr(self, "prorated_adjustment_in_cents") + else None + ) + _charge_in_cents=( + self.charge_in_cents + if hasattr(self, "charge_in_cents") + else None + ) + _payment_due_in_cents=( + self.payment_due_in_cents + if hasattr(self, "payment_due_in_cents") + else None + ) + _credit_applied_in_cents=( + self.credit_applied_in_cents + if hasattr(self, "credit_applied_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prorated_adjustment_in_cents={_prorated_adjustment_in_cents!s}, " + f"charge_in_cents={_charge_in_cents!s}, " + f"payment_due_in_cents={_payment_due_in_cents!s}, " + f"credit_applied_in_cents={_credit_applied_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_migration_preview_options.py b/advancedbilling/models/subscription_migration_preview_options.py index 6722d7db..431ebb0a 100644 --- a/advancedbilling/models/subscription_migration_preview_options.py +++ b/advancedbilling/models/subscription_migration_preview_options.py @@ -1,116 +1,116 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.proration import Proration +from advancedbilling.models.proration import ( + Proration, +) class SubscriptionMigrationPreviewOptions(object): - """Implementation of the 'Subscription Migration Preview Options' model. Attributes: product_id (int): The ID of the target Product. Either a product_id or - product_handle must be present. A Subscription can be migrated to - another product for both the current Product Family and another - Product Family. Note: Going to another Product Family, components - will not be migrated as well. - product_price_point_id (int): The ID of the specified product's price - point. This can be passed to migrate to a non-default price point. - include_trial (bool): Whether to include the trial period configured - for the product price point when starting a new billing period. - Note that if preserve_period is set, then include_trial will be - ignored. - include_initial_charge (bool): If `true` is sent initial charges will - be assessed. - include_coupons (bool): If `true` is sent, any coupons associated with - the subscription will be applied to the migration. If `false` is - sent, coupons will not be applied. Note: When migrating to a new - product family, the coupon cannot migrate. - preserve_period (bool): If `false` is sent, the subscription's billing - period will be reset to today and the full price of the new - product will be charged. If `true` is sent, the billing period - will not change and a prorated charge will be issued for the new - product. - product_handle (str): The handle of the target Product. Either a - product_id or product_handle must be present. A Subscription can - be migrated to another product for both the current Product Family - and another Product Family. Note: Going to another Product Family, - components will not be migrated as well. - product_price_point_handle (str): The ID or handle of the specified - product's price point. This can be passed to migrate to a - non-default price point. + product_handle must be present. A Subscription can be migrated to another + product for both the current Product Family and another Product Family. + Note: Going to another Product Family, components will not be migrated as + well. + product_price_point_id (int): The ID of the specified product's price point. + This can be passed to migrate to a non-default price point. + include_trial (bool): Whether to include the trial period configured for the + product price point when starting a new billing period. Note that if + preserve_period is set, then include_trial will be ignored. + include_initial_charge (bool): If `true` is sent initial charges will be + assessed. + include_coupons (bool): If `true` is sent, any coupons associated with the + subscription will be applied to the migration. If `false` is sent, + coupons will not be applied. Note: When migrating to a new product + family, the coupon cannot migrate. + preserve_period (bool): If `false` is sent, the subscription's billing period + will be reset to today and the full price of the new product will be + charged. If `true` is sent, the billing period will not change and a + prorated charge will be issued for the new product. + product_handle (str): The handle of the target Product. Either a product_id + or product_handle must be present. A Subscription can be migrated to + another product for both the current Product Family and another Product + Family. Note: Going to another Product Family, components will not be + migrated as well. + product_price_point_handle (str): The ID or handle of the specified product's + price point. This can be passed to migrate to a non-default price point. proration (Proration): The model property of type Proration. - proration_date (datetime): The date that the proration is calculated - from for the preview - additional_properties (Dict[str, object]): The additional properties - for the model. + proration_date (datetime): The date that the proration is calculated from for + the preview + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_id": 'product_id', - "product_price_point_id": 'product_price_point_id', - "include_trial": 'include_trial', - "include_initial_charge": 'include_initial_charge', - "include_coupons": 'include_coupons', - "preserve_period": 'preserve_period', - "product_handle": 'product_handle', - "product_price_point_handle": 'product_price_point_handle', - "proration": 'proration', - "proration_date": 'proration_date' + "product_id": "product_id", + "product_price_point_id": "product_price_point_id", + "include_trial": "include_trial", + "include_initial_charge": "include_initial_charge", + "include_coupons": "include_coupons", + "preserve_period": "preserve_period", + "product_handle": "product_handle", + "product_price_point_handle": "product_price_point_handle", + "proration": "proration", + "proration_date": "proration_date", } _optionals = [ - 'product_id', - 'product_price_point_id', - 'include_trial', - 'include_initial_charge', - 'include_coupons', - 'preserve_period', - 'product_handle', - 'product_price_point_handle', - 'proration', - 'proration_date', + "product_id", + "product_price_point_id", + "include_trial", + "include_initial_charge", + "include_coupons", + "preserve_period", + "product_handle", + "product_price_point_handle", + "proration", + "proration_date", ] - def __init__(self, - product_id=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - include_trial=False, - include_initial_charge=False, - include_coupons=True, - preserve_period=False, - product_handle=APIHelper.SKIP, - product_price_point_handle=APIHelper.SKIP, - proration=APIHelper.SKIP, - proration_date=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionMigrationPreviewOptions class""" - + def __init__( + self, + product_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + include_trial=False, + include_initial_charge=False, + include_coupons=True, + preserve_period=False, + product_handle=APIHelper.SKIP, + product_price_point_handle=APIHelper.SKIP, + proration=APIHelper.SKIP, + proration_date=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionMigrationPreviewOptions instance.""" # Initialize members of the class if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id - self.include_trial = include_trial - self.include_initial_charge = include_initial_charge - self.include_coupons = include_coupons - self.preserve_period = preserve_period + self.product_price_point_id = product_price_point_id + self.include_trial = include_trial + self.include_initial_charge = include_initial_charge + self.include_coupons = include_coupons + self.preserve_period = preserve_period if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if product_price_point_handle is not APIHelper.SKIP: - self.product_price_point_handle = product_price_point_handle + self.product_price_point_handle = product_price_point_handle if proration is not APIHelper.SKIP: - self.proration = proration + self.proration = proration if proration_date is not APIHelper.SKIP: - self.proration_date = APIHelper.apply_datetime_converter(proration_date, APIHelper.RFC3339DateTime) if proration_date else None + self.proration_date =\ + APIHelper.apply_datetime_converter( + proration_date, APIHelper.RFC3339DateTime)\ + if proration_date else None # Add additional model properties to the instance if additional_properties is None: @@ -120,7 +120,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -131,23 +131,55 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - include_trial = dictionary.get("include_trial") if dictionary.get("include_trial") else False - include_initial_charge = dictionary.get("include_initial_charge") if dictionary.get("include_initial_charge") else False - include_coupons = dictionary.get("include_coupons") if dictionary.get("include_coupons") else True - preserve_period = dictionary.get("preserve_period") if dictionary.get("preserve_period") else False - product_handle = dictionary.get("product_handle") if dictionary.get("product_handle") else APIHelper.SKIP - product_price_point_handle = dictionary.get("product_price_point_handle") if dictionary.get("product_price_point_handle") else APIHelper.SKIP - proration = Proration.from_dictionary(dictionary.get('proration')) if 'proration' in dictionary.keys() else APIHelper.SKIP - proration_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("proration_date")).datetime if dictionary.get("proration_date") else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + include_trial =\ + dictionary.get("include_trial")\ + if dictionary.get("include_trial")\ + else False + include_initial_charge =\ + dictionary.get("include_initial_charge")\ + if dictionary.get("include_initial_charge")\ + else False + include_coupons =\ + dictionary.get("include_coupons")\ + if dictionary.get("include_coupons")\ + else True + preserve_period =\ + dictionary.get("preserve_period")\ + if dictionary.get("preserve_period")\ + else False + product_handle =\ + dictionary.get("product_handle")\ + if dictionary.get("product_handle")\ + else APIHelper.SKIP + product_price_point_handle =\ + dictionary.get("product_price_point_handle")\ + if dictionary.get("product_price_point_handle")\ + else APIHelper.SKIP + proration =\ + Proration.from_dictionary( + dictionary.get("proration"))\ + if "proration" in dictionary.keys()\ + else APIHelper.SKIP + proration_date = APIHelper.RFC3339DateTime.from_value( + dictionary.get("proration_date")).datetime\ + if dictionary.get("proration_date") else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_id, product_price_point_id, @@ -162,29 +194,139 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'include_trial={(self.include_trial if hasattr(self, "include_trial") else None)!r}, ' - f'include_initial_charge={(self.include_initial_charge if hasattr(self, "include_initial_charge") else None)!r}, ' - f'include_coupons={(self.include_coupons if hasattr(self, "include_coupons") else None)!r}, ' - f'preserve_period={(self.preserve_period if hasattr(self, "preserve_period") else None)!r}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!r}, ' - f'proration={(self.proration if hasattr(self, "proration") else None)!r}, ' - f'proration_date={(self.proration_date if hasattr(self, "proration_date") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _include_trial=( + self.include_trial + if hasattr(self, "include_trial") + else None + ) + _include_initial_charge=( + self.include_initial_charge + if hasattr(self, "include_initial_charge") + else None + ) + _include_coupons=( + self.include_coupons + if hasattr(self, "include_coupons") + else None + ) + _preserve_period=( + self.preserve_period + if hasattr(self, "preserve_period") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _proration=( + self.proration + if hasattr(self, "proration") + else None + ) + _proration_date=( + self.proration_date + if hasattr(self, "proration_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"include_trial={_include_trial!r}, " + f"include_initial_charge={_include_initial_charge!r}, " + f"include_coupons={_include_coupons!r}, " + f"preserve_period={_preserve_period!r}, " + f"product_handle={_product_handle!r}, " + f"product_price_point_handle={_product_price_point_handle!r}, " + f"proration={_proration!r}, " + f"proration_date={_proration_date!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'include_trial={(self.include_trial if hasattr(self, "include_trial") else None)!s}, ' - f'include_initial_charge={(self.include_initial_charge if hasattr(self, "include_initial_charge") else None)!s}, ' - f'include_coupons={(self.include_coupons if hasattr(self, "include_coupons") else None)!s}, ' - f'preserve_period={(self.preserve_period if hasattr(self, "preserve_period") else None)!s}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!s}, ' - f'proration={(self.proration if hasattr(self, "proration") else None)!s}, ' - f'proration_date={(self.proration_date if hasattr(self, "proration_date") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _include_trial=( + self.include_trial + if hasattr(self, "include_trial") + else None + ) + _include_initial_charge=( + self.include_initial_charge + if hasattr(self, "include_initial_charge") + else None + ) + _include_coupons=( + self.include_coupons + if hasattr(self, "include_coupons") + else None + ) + _preserve_period=( + self.preserve_period + if hasattr(self, "preserve_period") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _proration=( + self.proration + if hasattr(self, "proration") + else None + ) + _proration_date=( + self.proration_date + if hasattr(self, "proration_date") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"include_trial={_include_trial!s}, " + f"include_initial_charge={_include_initial_charge!s}, " + f"include_coupons={_include_coupons!s}, " + f"preserve_period={_preserve_period!s}, " + f"product_handle={_product_handle!s}, " + f"product_price_point_handle={_product_price_point_handle!s}, " + f"proration={_proration!s}, " + f"proration_date={_proration_date!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_migration_preview_request.py b/advancedbilling/models/subscription_migration_preview_request.py index 520ef521..8481da0d 100644 --- a/advancedbilling/models/subscription_migration_preview_request.py +++ b/advancedbilling/models/subscription_migration_preview_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_migration_preview_options import SubscriptionMigrationPreviewOptions +# ruff: noqa: E501 +from advancedbilling.models.subscription_migration_preview_options import ( + SubscriptionMigrationPreviewOptions, +) -class SubscriptionMigrationPreviewRequest(object): +class SubscriptionMigrationPreviewRequest(object): """Implementation of the 'Subscription Migration Preview Request' model. Attributes: - migration (SubscriptionMigrationPreviewOptions): The model property of - type SubscriptionMigrationPreviewOptions. - additional_properties (Dict[str, object]): The additional properties - for the model. + migration (SubscriptionMigrationPreviewOptions): The model property of type + SubscriptionMigrationPreviewOptions. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "migration": 'migration' + "migration": "migration", } - def __init__(self, - migration=None, - additional_properties=None): - """Constructor for the SubscriptionMigrationPreviewRequest class""" - + def __init__( + self, + migration=None, + additional_properties=None): + """Initialize a SubscriptionMigrationPreviewRequest instance.""" # Initialize members of the class - self.migration = migration + self.migration = migration # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - migration = SubscriptionMigrationPreviewOptions.from_dictionary(dictionary.get('migration')) if dictionary.get('migration') else None + migration =\ + SubscriptionMigrationPreviewOptions.from_dictionary( + dictionary.get("migration"))\ + if dictionary.get("migration") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(migration, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'migration={self.migration!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _migration=self.migration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"migration={_migration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'migration={self.migration!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _migration=self.migration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"migration={_migration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_migration_preview_response.py b/advancedbilling/models/subscription_migration_preview_response.py index 1a8c16c6..6a1728fc 100644 --- a/advancedbilling/models/subscription_migration_preview_response.py +++ b/advancedbilling/models/subscription_migration_preview_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_migration_preview import SubscriptionMigrationPreview +# ruff: noqa: E501 +from advancedbilling.models.subscription_migration_preview import ( + SubscriptionMigrationPreview, +) -class SubscriptionMigrationPreviewResponse(object): +class SubscriptionMigrationPreviewResponse(object): """Implementation of the 'Subscription Migration Preview Response' model. Attributes: migration (SubscriptionMigrationPreview): The model property of type SubscriptionMigrationPreview. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "migration": 'migration' + "migration": "migration", } - def __init__(self, - migration=None, - additional_properties=None): - """Constructor for the SubscriptionMigrationPreviewResponse class""" - + def __init__( + self, + migration=None, + additional_properties=None): + """Initialize a SubscriptionMigrationPreviewResponse instance.""" # Initialize members of the class - self.migration = migration + self.migration = migration # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - migration = SubscriptionMigrationPreview.from_dictionary(dictionary.get('migration')) if dictionary.get('migration') else None + migration =\ + SubscriptionMigrationPreview.from_dictionary( + dictionary.get("migration"))\ + if dictionary.get("migration") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(migration, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'migration={self.migration!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _migration=self.migration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"migration={_migration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'migration={self.migration!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _migration=self.migration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"migration={_migration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_mrr.py b/advancedbilling/models/subscription_mrr.py index 2901449a..98bd90d0 100644 --- a/advancedbilling/models/subscription_mrr.py +++ b/advancedbilling/models/subscription_mrr.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_mrr_breakout import SubscriptionMRRBreakout +from advancedbilling.models.subscription_mrr_breakout import ( + SubscriptionMRRBreakout, +) class SubscriptionMRR(object): - """Implementation of the 'Subscription MRR' model. Attributes: @@ -19,34 +19,34 @@ class SubscriptionMRR(object): mrr_amount_in_cents (int): The model property of type int. breakouts (SubscriptionMRRBreakout): The model property of type SubscriptionMRRBreakout. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_id": 'subscription_id', - "mrr_amount_in_cents": 'mrr_amount_in_cents', - "breakouts": 'breakouts' + "subscription_id": "subscription_id", + "mrr_amount_in_cents": "mrr_amount_in_cents", + "breakouts": "breakouts", } _optionals = [ - 'breakouts', + "breakouts", ] - def __init__(self, - subscription_id=None, - mrr_amount_in_cents=None, - breakouts=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionMRR class""" - + def __init__( + self, + subscription_id=None, + mrr_amount_in_cents=None, + breakouts=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionMRR instance.""" # Initialize members of the class - self.subscription_id = subscription_id - self.mrr_amount_in_cents = mrr_amount_in_cents + self.subscription_id = subscription_id + self.mrr_amount_in_cents = mrr_amount_in_cents if breakouts is not APIHelper.SKIP: - self.breakouts = breakouts + self.breakouts = breakouts # Add additional model properties to the instance if additional_properties is None: @@ -56,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -67,16 +67,28 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else None - mrr_amount_in_cents = dictionary.get("mrr_amount_in_cents") if dictionary.get("mrr_amount_in_cents") else None - breakouts = SubscriptionMRRBreakout.from_dictionary(dictionary.get('breakouts')) if 'breakouts' in dictionary.keys() else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else None + mrr_amount_in_cents =\ + dictionary.get("mrr_amount_in_cents")\ + if dictionary.get("mrr_amount_in_cents")\ + else None + breakouts =\ + SubscriptionMRRBreakout.from_dictionary( + dictionary.get("breakouts"))\ + if "breakouts" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_id, mrr_amount_in_cents, @@ -84,15 +96,39 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_id={self.subscription_id!r}, ' - f'mrr_amount_in_cents={self.mrr_amount_in_cents!r}, ' - f'breakouts={(self.breakouts if hasattr(self, "breakouts") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_id=self.subscription_id + _mrr_amount_in_cents=self.mrr_amount_in_cents + _breakouts=( + self.breakouts + if hasattr(self, "breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_id={_subscription_id!r}, " + f"mrr_amount_in_cents={_mrr_amount_in_cents!r}, " + f"breakouts={_breakouts!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_id={self.subscription_id!s}, ' - f'mrr_amount_in_cents={self.mrr_amount_in_cents!s}, ' - f'breakouts={(self.breakouts if hasattr(self, "breakouts") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_id=self.subscription_id + _mrr_amount_in_cents=self.mrr_amount_in_cents + _breakouts=( + self.breakouts + if hasattr(self, "breakouts") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_id={_subscription_id!s}, " + f"mrr_amount_in_cents={_mrr_amount_in_cents!s}, " + f"breakouts={_breakouts!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_mrr_breakout.py b/advancedbilling/models/subscription_mrr_breakout.py index 8c7aad69..bbbac13b 100644 --- a/advancedbilling/models/subscription_mrr_breakout.py +++ b/advancedbilling/models/subscription_mrr_breakout.py @@ -1,40 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class SubscriptionMRRBreakout(object): - """Implementation of the 'Subscription MRR Breakout' model. Attributes: plan_amount_in_cents (int): The model property of type int. usage_amount_in_cents (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "plan_amount_in_cents": 'plan_amount_in_cents', - "usage_amount_in_cents": 'usage_amount_in_cents' + "plan_amount_in_cents": "plan_amount_in_cents", + "usage_amount_in_cents": "usage_amount_in_cents", } - def __init__(self, - plan_amount_in_cents=None, - usage_amount_in_cents=None, - additional_properties=None): - """Constructor for the SubscriptionMRRBreakout class""" - + def __init__( + self, + plan_amount_in_cents=None, + usage_amount_in_cents=None, + additional_properties=None): + """Initialize a SubscriptionMRRBreakout instance.""" # Initialize members of the class - self.plan_amount_in_cents = plan_amount_in_cents - self.usage_amount_in_cents = usage_amount_in_cents + self.plan_amount_in_cents = plan_amount_in_cents + self.usage_amount_in_cents = usage_amount_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -44,7 +40,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -55,28 +51,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - plan_amount_in_cents = dictionary.get("plan_amount_in_cents") if dictionary.get("plan_amount_in_cents") else None - usage_amount_in_cents = dictionary.get("usage_amount_in_cents") if dictionary.get("usage_amount_in_cents") else None + plan_amount_in_cents =\ + dictionary.get("plan_amount_in_cents")\ + if dictionary.get("plan_amount_in_cents")\ + else None + usage_amount_in_cents =\ + dictionary.get("usage_amount_in_cents")\ + if dictionary.get("usage_amount_in_cents")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(plan_amount_in_cents, usage_amount_in_cents, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'plan_amount_in_cents={self.plan_amount_in_cents!r}, ' - f'usage_amount_in_cents={self.usage_amount_in_cents!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _plan_amount_in_cents=self.plan_amount_in_cents + _usage_amount_in_cents=self.usage_amount_in_cents + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"plan_amount_in_cents={_plan_amount_in_cents!r}, " + f"usage_amount_in_cents={_usage_amount_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'plan_amount_in_cents={self.plan_amount_in_cents!s}, ' - f'usage_amount_in_cents={self.usage_amount_in_cents!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _plan_amount_in_cents=self.plan_amount_in_cents + _usage_amount_in_cents=self.usage_amount_in_cents + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"plan_amount_in_cents={_plan_amount_in_cents!s}, " + f"usage_amount_in_cents={_usage_amount_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_mrr_response.py b/advancedbilling/models/subscription_mrr_response.py index 30b0fd73..fbd94c34 100644 --- a/advancedbilling/models/subscription_mrr_response.py +++ b/advancedbilling/models/subscription_mrr_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_mrr import SubscriptionMRR +# ruff: noqa: E501 +from advancedbilling.models.subscription_mrr import ( + SubscriptionMRR, +) -class SubscriptionMRRResponse(object): +class SubscriptionMRRResponse(object): """Implementation of the 'Subscription MRR Response' model. Attributes: subscriptions_mrr (List[SubscriptionMRR]): The model property of type List[SubscriptionMRR]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscriptions_mrr": 'subscriptions_mrr' + "subscriptions_mrr": "subscriptions_mrr", } - def __init__(self, - subscriptions_mrr=None, - additional_properties=None): - """Constructor for the SubscriptionMRRResponse class""" - + def __init__( + self, + subscriptions_mrr=None, + additional_properties=None): + """Initialize a SubscriptionMRRResponse instance.""" # Initialize members of the class - self.subscriptions_mrr = subscriptions_mrr + self.subscriptions_mrr = subscriptions_mrr # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary subscriptions_mrr = None - if dictionary.get('subscriptions_mrr') is not None: - subscriptions_mrr = [SubscriptionMRR.from_dictionary(x) for x in dictionary.get('subscriptions_mrr')] + if dictionary.get("subscriptions_mrr") is not None: + subscriptions_mrr = [ + SubscriptionMRR.from_dictionary(x) + for x in dictionary.get("subscriptions_mrr") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscriptions_mrr, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscriptions_mrr={self.subscriptions_mrr!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscriptions_mrr=self.subscriptions_mrr + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscriptions_mrr={_subscriptions_mrr!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscriptions_mrr={self.subscriptions_mrr!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscriptions_mrr=self.subscriptions_mrr + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscriptions_mrr={_subscriptions_mrr!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_note.py b/advancedbilling/models/subscription_note.py index 9ea52536..3310e535 100644 --- a/advancedbilling/models/subscription_note.py +++ b/advancedbilling/models/subscription_note.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionNote(object): - """Implementation of the 'Subscription Note' model. Attributes: @@ -20,53 +18,59 @@ class SubscriptionNote(object): created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. sticky (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "body": 'body', - "subscription_id": 'subscription_id', - "created_at": 'created_at', - "updated_at": 'updated_at', - "sticky": 'sticky' + "id": "id", + "body": "body", + "subscription_id": "subscription_id", + "created_at": "created_at", + "updated_at": "updated_at", + "sticky": "sticky", } _optionals = [ - 'id', - 'body', - 'subscription_id', - 'created_at', - 'updated_at', - 'sticky', + "id", + "body", + "subscription_id", + "created_at", + "updated_at", + "sticky", ] - def __init__(self, - id=APIHelper.SKIP, - body=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - created_at=APIHelper.SKIP, - updated_at=APIHelper.SKIP, - sticky=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionNote class""" - + def __init__( + self, + id=APIHelper.SKIP, + body=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + created_at=APIHelper.SKIP, + updated_at=APIHelper.SKIP, + sticky=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionNote instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if body is not APIHelper.SKIP: - self.body = body + self.body = body if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if updated_at is not APIHelper.SKIP: - self.updated_at = APIHelper.apply_datetime_converter(updated_at, APIHelper.RFC3339DateTime) if updated_at else None + self.updated_at =\ + APIHelper.apply_datetime_converter( + updated_at, APIHelper.RFC3339DateTime)\ + if updated_at else None if sticky is not APIHelper.SKIP: - self.sticky = sticky + self.sticky = sticky # Add additional model properties to the instance if additional_properties is None: @@ -76,7 +80,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -87,19 +91,37 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - body = dictionary.get("body") if dictionary.get("body") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - updated_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("updated_at")).datetime if dictionary.get("updated_at") else APIHelper.SKIP - sticky = dictionary.get("sticky") if "sticky" in dictionary.keys() else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + body =\ + dictionary.get("body")\ + if dictionary.get("body")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + updated_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("updated_at")).datetime\ + if dictionary.get("updated_at") else APIHelper.SKIP + sticky =\ + dictionary.get("sticky")\ + if "sticky" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, body, @@ -110,21 +132,91 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'body={(self.body if hasattr(self, "body") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!r}, ' - f'sticky={(self.sticky if hasattr(self, "sticky") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _body=( + self.body + if hasattr(self, "body") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _sticky=( + self.sticky + if hasattr(self, "sticky") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"body={_body!r}, " + f"subscription_id={_subscription_id!r}, " + f"created_at={_created_at!r}, " + f"updated_at={_updated_at!r}, " + f"sticky={_sticky!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'body={(self.body if hasattr(self, "body") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'updated_at={(self.updated_at if hasattr(self, "updated_at") else None)!s}, ' - f'sticky={(self.sticky if hasattr(self, "sticky") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _body=( + self.body + if hasattr(self, "body") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _updated_at=( + self.updated_at + if hasattr(self, "updated_at") + else None + ) + _sticky=( + self.sticky + if hasattr(self, "sticky") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"body={_body!s}, " + f"subscription_id={_subscription_id!s}, " + f"created_at={_created_at!s}, " + f"updated_at={_updated_at!s}, " + f"sticky={_sticky!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_note_response.py b/advancedbilling/models/subscription_note_response.py index ae6d2670..f0a5dc84 100644 --- a/advancedbilling/models/subscription_note_response.py +++ b/advancedbilling/models/subscription_note_response.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_note import SubscriptionNote +# ruff: noqa: E501 +from advancedbilling.models.subscription_note import ( + SubscriptionNote, +) -class SubscriptionNoteResponse(object): +class SubscriptionNoteResponse(object): """Implementation of the 'Subscription Note Response' model. Attributes: note (SubscriptionNote): The model property of type SubscriptionNote. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "note": 'note' + "note": "note", } - def __init__(self, - note=None, - additional_properties=None): - """Constructor for the SubscriptionNoteResponse class""" - + def __init__( + self, + note=None, + additional_properties=None): + """Initialize a SubscriptionNoteResponse instance.""" # Initialize members of the class - self.note = note + self.note = note # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - note = SubscriptionNote.from_dictionary(dictionary.get('note')) if dictionary.get('note') else None + note =\ + SubscriptionNote.from_dictionary( + dictionary.get("note"))\ + if dictionary.get("note") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(note, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'note={self.note!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _note=self.note + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"note={_note!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'note={self.note!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _note=self.note + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"note={_note!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_preview.py b/advancedbilling/models/subscription_preview.py index ecb7dda5..77cdb604 100644 --- a/advancedbilling/models/subscription_preview.py +++ b/advancedbilling/models/subscription_preview.py @@ -1,17 +1,17 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.billing_manifest import BillingManifest +from advancedbilling.models.billing_manifest import ( + BillingManifest, +) class SubscriptionPreview(object): - """Implementation of the 'Subscription Preview' model. Attributes: @@ -19,33 +19,33 @@ class SubscriptionPreview(object): BillingManifest. next_billing_manifest (BillingManifest): The model property of type BillingManifest. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "current_billing_manifest": 'current_billing_manifest', - "next_billing_manifest": 'next_billing_manifest' + "current_billing_manifest": "current_billing_manifest", + "next_billing_manifest": "next_billing_manifest", } _optionals = [ - 'current_billing_manifest', - 'next_billing_manifest', + "current_billing_manifest", + "next_billing_manifest", ] - def __init__(self, - current_billing_manifest=APIHelper.SKIP, - next_billing_manifest=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionPreview class""" - + def __init__( + self, + current_billing_manifest=APIHelper.SKIP, + next_billing_manifest=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionPreview instance.""" # Initialize members of the class if current_billing_manifest is not APIHelper.SKIP: - self.current_billing_manifest = current_billing_manifest + self.current_billing_manifest = current_billing_manifest if next_billing_manifest is not APIHelper.SKIP: - self.next_billing_manifest = next_billing_manifest + self.next_billing_manifest = next_billing_manifest # Add additional model properties to the instance if additional_properties is None: @@ -55,7 +55,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -66,28 +66,68 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - current_billing_manifest = BillingManifest.from_dictionary(dictionary.get('current_billing_manifest')) if 'current_billing_manifest' in dictionary.keys() else APIHelper.SKIP - next_billing_manifest = BillingManifest.from_dictionary(dictionary.get('next_billing_manifest')) if 'next_billing_manifest' in dictionary.keys() else APIHelper.SKIP + current_billing_manifest =\ + BillingManifest.from_dictionary( + dictionary.get("current_billing_manifest"))\ + if "current_billing_manifest" in dictionary.keys()\ + else APIHelper.SKIP + next_billing_manifest =\ + BillingManifest.from_dictionary( + dictionary.get("next_billing_manifest"))\ + if "next_billing_manifest" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(current_billing_manifest, next_billing_manifest, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'current_billing_manifest={(self.current_billing_manifest if hasattr(self, "current_billing_manifest") else None)!r}, ' - f'next_billing_manifest={(self.next_billing_manifest if hasattr(self, "next_billing_manifest") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _current_billing_manifest=( + self.current_billing_manifest + if hasattr(self, "current_billing_manifest") + else None + ) + _next_billing_manifest=( + self.next_billing_manifest + if hasattr(self, "next_billing_manifest") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_billing_manifest={_current_billing_manifest!r}, " + f"next_billing_manifest={_next_billing_manifest!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'current_billing_manifest={(self.current_billing_manifest if hasattr(self, "current_billing_manifest") else None)!s}, ' - f'next_billing_manifest={(self.next_billing_manifest if hasattr(self, "next_billing_manifest") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _current_billing_manifest=( + self.current_billing_manifest + if hasattr(self, "current_billing_manifest") + else None + ) + _next_billing_manifest=( + self.next_billing_manifest + if hasattr(self, "next_billing_manifest") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_billing_manifest={_current_billing_manifest!s}, " + f"next_billing_manifest={_next_billing_manifest!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_preview_response.py b/advancedbilling/models/subscription_preview_response.py index 609a61ce..8acfc783 100644 --- a/advancedbilling/models/subscription_preview_response.py +++ b/advancedbilling/models/subscription_preview_response.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_preview import SubscriptionPreview +# ruff: noqa: E501 +from advancedbilling.models.subscription_preview import ( + SubscriptionPreview, +) -class SubscriptionPreviewResponse(object): +class SubscriptionPreviewResponse(object): """Implementation of the 'Subscription Preview Response' model. Attributes: subscription_preview (SubscriptionPreview): The model property of type SubscriptionPreview. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_preview": 'subscription_preview' + "subscription_preview": "subscription_preview", } - def __init__(self, - subscription_preview=None, - additional_properties=None): - """Constructor for the SubscriptionPreviewResponse class""" - + def __init__( + self, + subscription_preview=None, + additional_properties=None): + """Initialize a SubscriptionPreviewResponse instance.""" # Initialize members of the class - self.subscription_preview = subscription_preview + self.subscription_preview = subscription_preview # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_preview = SubscriptionPreview.from_dictionary(dictionary.get('subscription_preview')) if dictionary.get('subscription_preview') else None + subscription_preview =\ + SubscriptionPreview.from_dictionary( + dictionary.get("subscription_preview"))\ + if dictionary.get("subscription_preview") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_preview, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_preview={self.subscription_preview!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_preview=self.subscription_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_preview={_subscription_preview!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_preview={self.subscription_preview!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_preview=self.subscription_preview + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_preview={_subscription_preview!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_product_change.py b/advancedbilling/models/subscription_product_change.py index 845b7f8f..49821a4e 100644 --- a/advancedbilling/models/subscription_product_change.py +++ b/advancedbilling/models/subscription_product_change.py @@ -1,41 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionProductChange(object): - """Implementation of the 'Subscription Product Change' model. Attributes: previous_product_id (int): The model property of type int. new_product_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "previous_product_id": 'previous_product_id', - "new_product_id": 'new_product_id' + "previous_product_id": "previous_product_id", + "new_product_id": "new_product_id", } - def __init__(self, - previous_product_id=None, - new_product_id=None, - additional_properties=None): - """Constructor for the SubscriptionProductChange class""" - + def __init__( + self, + previous_product_id=None, + new_product_id=None, + additional_properties=None): + """Initialize a SubscriptionProductChange instance.""" # Initialize members of the class - self.previous_product_id = previous_product_id - self.new_product_id = new_product_id + self.previous_product_id = previous_product_id + self.new_product_id = new_product_id # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,15 +54,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - previous_product_id = dictionary.get("previous_product_id") if dictionary.get("previous_product_id") else None - new_product_id = dictionary.get("new_product_id") if dictionary.get("new_product_id") else None + previous_product_id =\ + dictionary.get("previous_product_id")\ + if dictionary.get("previous_product_id")\ + else None + new_product_id =\ + dictionary.get("new_product_id")\ + if dictionary.get("new_product_id")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(previous_product_id, new_product_id, @@ -72,7 +78,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -83,29 +89,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.previous_product_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.new_product_id, - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.previous_product_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.new_product_id, + type_callable=lambda value: + isinstance( + value, + int, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('previous_product_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('new_product_id'), - type_callable=lambda value: isinstance(value, int)) + return APIHelper.is_valid_type( + value=dictionary.get("previous_product_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_product_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'previous_product_id={self.previous_product_id!r}, ' - f'new_product_id={self.new_product_id!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _previous_product_id=self.previous_product_id + _new_product_id=self.new_product_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_product_id={_previous_product_id!r}, " + f"new_product_id={_new_product_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'previous_product_id={self.previous_product_id!s}, ' - f'new_product_id={self.new_product_id!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _previous_product_id=self.previous_product_id + _new_product_id=self.new_product_id + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_product_id={_previous_product_id!s}, " + f"new_product_id={_new_product_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_product_migration.py b/advancedbilling/models/subscription_product_migration.py index b3a8cf5d..3b6c2331 100644 --- a/advancedbilling/models/subscription_product_migration.py +++ b/advancedbilling/models/subscription_product_migration.py @@ -1,109 +1,106 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.proration import Proration +from advancedbilling.models.proration import ( + Proration, +) class SubscriptionProductMigration(object): - """Implementation of the 'Subscription Product Migration' model. Attributes: product_id (int): The ID of the target Product. Either a product_id or - product_handle must be present. A Subscription can be migrated to - another product for both the current Product Family and another - Product Family. Note: Going to another Product Family, components - will not be migrated as well. - product_price_point_id (int): The ID of the specified product's price - point. This can be passed to migrate to a non-default price point. - include_trial (bool): Whether to include the trial period configured - for the product price point when starting a new billing period. - Note that if preserve_period is set, then include_trial will be - ignored. - include_initial_charge (bool): If `true` is sent initial charges will - be assessed. - include_coupons (bool): If `true` is sent, any coupons associated with - the subscription will be applied to the migration. If `false` is - sent, coupons will not be applied. Note: When migrating to a new - product family, the coupon cannot migrate. - preserve_period (bool): If `false` is sent, the subscription's billing - period will be reset to today and the full price of the new - product will be charged. If `true` is sent, the billing period - will not change and a prorated charge will be issued for the new - product. - product_handle (str): The handle of the target Product. Either a - product_id or product_handle must be present. A Subscription can - be migrated to another product for both the current Product Family - and another Product Family. Note: Going to another Product Family, - components will not be migrated as well. - product_price_point_handle (str): The ID or handle of the specified - product's price point. This can be passed to migrate to a - non-default price point. + product_handle must be present. A Subscription can be migrated to another + product for both the current Product Family and another Product Family. + Note: Going to another Product Family, components will not be migrated as + well. + product_price_point_id (int): The ID of the specified product's price point. + This can be passed to migrate to a non-default price point. + include_trial (bool): Whether to include the trial period configured for the + product price point when starting a new billing period. Note that if + preserve_period is set, then include_trial will be ignored. + include_initial_charge (bool): If `true` is sent initial charges will be + assessed. + include_coupons (bool): If `true` is sent, any coupons associated with the + subscription will be applied to the migration. If `false` is sent, + coupons will not be applied. Note: When migrating to a new product + family, the coupon cannot migrate. + preserve_period (bool): If `false` is sent, the subscription's billing period + will be reset to today and the full price of the new product will be + charged. If `true` is sent, the billing period will not change and a + prorated charge will be issued for the new product. + product_handle (str): The handle of the target Product. Either a product_id + or product_handle must be present. A Subscription can be migrated to + another product for both the current Product Family and another Product + Family. Note: Going to another Product Family, components will not be + migrated as well. + product_price_point_handle (str): The ID or handle of the specified product's + price point. This can be passed to migrate to a non-default price point. proration (Proration): The model property of type Proration. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "product_id": 'product_id', - "product_price_point_id": 'product_price_point_id', - "include_trial": 'include_trial', - "include_initial_charge": 'include_initial_charge', - "include_coupons": 'include_coupons', - "preserve_period": 'preserve_period', - "product_handle": 'product_handle', - "product_price_point_handle": 'product_price_point_handle', - "proration": 'proration' + "product_id": "product_id", + "product_price_point_id": "product_price_point_id", + "include_trial": "include_trial", + "include_initial_charge": "include_initial_charge", + "include_coupons": "include_coupons", + "preserve_period": "preserve_period", + "product_handle": "product_handle", + "product_price_point_handle": "product_price_point_handle", + "proration": "proration", } _optionals = [ - 'product_id', - 'product_price_point_id', - 'include_trial', - 'include_initial_charge', - 'include_coupons', - 'preserve_period', - 'product_handle', - 'product_price_point_handle', - 'proration', + "product_id", + "product_price_point_id", + "include_trial", + "include_initial_charge", + "include_coupons", + "preserve_period", + "product_handle", + "product_price_point_handle", + "proration", ] - def __init__(self, - product_id=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - include_trial=False, - include_initial_charge=False, - include_coupons=True, - preserve_period=False, - product_handle=APIHelper.SKIP, - product_price_point_handle=APIHelper.SKIP, - proration=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionProductMigration class""" - + def __init__( + self, + product_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + include_trial=False, + include_initial_charge=False, + include_coupons=True, + preserve_period=False, + product_handle=APIHelper.SKIP, + product_price_point_handle=APIHelper.SKIP, + proration=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionProductMigration instance.""" # Initialize members of the class if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id - self.include_trial = include_trial - self.include_initial_charge = include_initial_charge - self.include_coupons = include_coupons - self.preserve_period = preserve_period + self.product_price_point_id = product_price_point_id + self.include_trial = include_trial + self.include_initial_charge = include_initial_charge + self.include_coupons = include_coupons + self.preserve_period = preserve_period if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if product_price_point_handle is not APIHelper.SKIP: - self.product_price_point_handle = product_price_point_handle + self.product_price_point_handle = product_price_point_handle if proration is not APIHelper.SKIP: - self.proration = proration + self.proration = proration # Add additional model properties to the instance if additional_properties is None: @@ -113,7 +110,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -124,22 +121,52 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - include_trial = dictionary.get("include_trial") if dictionary.get("include_trial") else False - include_initial_charge = dictionary.get("include_initial_charge") if dictionary.get("include_initial_charge") else False - include_coupons = dictionary.get("include_coupons") if dictionary.get("include_coupons") else True - preserve_period = dictionary.get("preserve_period") if dictionary.get("preserve_period") else False - product_handle = dictionary.get("product_handle") if dictionary.get("product_handle") else APIHelper.SKIP - product_price_point_handle = dictionary.get("product_price_point_handle") if dictionary.get("product_price_point_handle") else APIHelper.SKIP - proration = Proration.from_dictionary(dictionary.get('proration')) if 'proration' in dictionary.keys() else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + include_trial =\ + dictionary.get("include_trial")\ + if dictionary.get("include_trial")\ + else False + include_initial_charge =\ + dictionary.get("include_initial_charge")\ + if dictionary.get("include_initial_charge")\ + else False + include_coupons =\ + dictionary.get("include_coupons")\ + if dictionary.get("include_coupons")\ + else True + preserve_period =\ + dictionary.get("preserve_period")\ + if dictionary.get("preserve_period")\ + else False + product_handle =\ + dictionary.get("product_handle")\ + if dictionary.get("product_handle")\ + else APIHelper.SKIP + product_price_point_handle =\ + dictionary.get("product_price_point_handle")\ + if dictionary.get("product_price_point_handle")\ + else APIHelper.SKIP + proration =\ + Proration.from_dictionary( + dictionary.get("proration"))\ + if "proration" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(product_id, product_price_point_id, @@ -153,27 +180,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'include_trial={(self.include_trial if hasattr(self, "include_trial") else None)!r}, ' - f'include_initial_charge={(self.include_initial_charge if hasattr(self, "include_initial_charge") else None)!r}, ' - f'include_coupons={(self.include_coupons if hasattr(self, "include_coupons") else None)!r}, ' - f'preserve_period={(self.preserve_period if hasattr(self, "preserve_period") else None)!r}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!r}, ' - f'proration={(self.proration if hasattr(self, "proration") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _include_trial=( + self.include_trial + if hasattr(self, "include_trial") + else None + ) + _include_initial_charge=( + self.include_initial_charge + if hasattr(self, "include_initial_charge") + else None + ) + _include_coupons=( + self.include_coupons + if hasattr(self, "include_coupons") + else None + ) + _preserve_period=( + self.preserve_period + if hasattr(self, "preserve_period") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _proration=( + self.proration + if hasattr(self, "proration") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"include_trial={_include_trial!r}, " + f"include_initial_charge={_include_initial_charge!r}, " + f"include_coupons={_include_coupons!r}, " + f"preserve_period={_preserve_period!r}, " + f"product_handle={_product_handle!r}, " + f"product_price_point_handle={_product_price_point_handle!r}, " + f"proration={_proration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'include_trial={(self.include_trial if hasattr(self, "include_trial") else None)!s}, ' - f'include_initial_charge={(self.include_initial_charge if hasattr(self, "include_initial_charge") else None)!s}, ' - f'include_coupons={(self.include_coupons if hasattr(self, "include_coupons") else None)!s}, ' - f'preserve_period={(self.preserve_period if hasattr(self, "preserve_period") else None)!s}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!s}, ' - f'proration={(self.proration if hasattr(self, "proration") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _include_trial=( + self.include_trial + if hasattr(self, "include_trial") + else None + ) + _include_initial_charge=( + self.include_initial_charge + if hasattr(self, "include_initial_charge") + else None + ) + _include_coupons=( + self.include_coupons + if hasattr(self, "include_coupons") + else None + ) + _preserve_period=( + self.preserve_period + if hasattr(self, "preserve_period") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _proration=( + self.proration + if hasattr(self, "proration") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"product_id={_product_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"include_trial={_include_trial!s}, " + f"include_initial_charge={_include_initial_charge!s}, " + f"include_coupons={_include_coupons!s}, " + f"preserve_period={_preserve_period!s}, " + f"product_handle={_product_handle!s}, " + f"product_price_point_handle={_product_price_point_handle!s}, " + f"proration={_proration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_product_migration_request.py b/advancedbilling/models/subscription_product_migration_request.py index 0b1ca7c2..80a45266 100644 --- a/advancedbilling/models/subscription_product_migration_request.py +++ b/advancedbilling/models/subscription_product_migration_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.subscription_product_migration import SubscriptionProductMigration +# ruff: noqa: E501 +from advancedbilling.models.subscription_product_migration import ( + SubscriptionProductMigration, +) -class SubscriptionProductMigrationRequest(object): +class SubscriptionProductMigrationRequest(object): """Implementation of the 'Subscription Product Migration Request' model. Attributes: migration (SubscriptionProductMigration): The model property of type SubscriptionProductMigration. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "migration": 'migration' + "migration": "migration", } - def __init__(self, - migration=None, - additional_properties=None): - """Constructor for the SubscriptionProductMigrationRequest class""" - + def __init__( + self, + migration=None, + additional_properties=None): + """Initialize a SubscriptionProductMigrationRequest instance.""" # Initialize members of the class - self.migration = migration + self.migration = migration # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - migration = SubscriptionProductMigration.from_dictionary(dictionary.get('migration')) if dictionary.get('migration') else None + migration =\ + SubscriptionProductMigration.from_dictionary( + dictionary.get("migration"))\ + if dictionary.get("migration") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(migration, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'migration={self.migration!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _migration=self.migration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"migration={_migration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'migration={self.migration!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _migration=self.migration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"migration={_migration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_purge_type.py b/advancedbilling/models/subscription_purge_type.py index 6d08bae9..94a76aca 100644 --- a/advancedbilling/models/subscription_purge_type.py +++ b/advancedbilling/models/subscription_purge_type.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionPurgeType(object): - """Implementation of the 'Subscription Purge Type' enum. Attributes: CUSTOMER: The enum member of type str. PAYMENT_PROFILE: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CUSTOMER = 'customer' - PAYMENT_PROFILE = 'payment_profile' + CUSTOMER = "customer" + + PAYMENT_PROFILE = "payment_profile" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_response.py b/advancedbilling/models/subscription_response.py index 5ef9a3c7..980a9d26 100644 --- a/advancedbilling/models/subscription_response.py +++ b/advancedbilling/models/subscription_response.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription import Subscription +from advancedbilling.models.subscription import ( + Subscription, +) class SubscriptionResponse(object): - """Implementation of the 'Subscription Response' model. Attributes: subscription (Subscription): The model property of type Subscription. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription": 'subscription' + "subscription": "subscription", } _optionals = [ - 'subscription', + "subscription", ] - def __init__(self, - subscription=APIHelper.SKIP, - additional_properties=None): - """Constructor for the SubscriptionResponse class""" - + def __init__( + self, + subscription=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionResponse instance.""" # Initialize members of the class if subscription is not APIHelper.SKIP: - self.subscription = subscription + self.subscription = subscription # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription = Subscription.from_dictionary(dictionary.get('subscription')) if 'subscription' in dictionary.keys() else APIHelper.SKIP + subscription =\ + Subscription.from_dictionary( + dictionary.get("subscription"))\ + if "subscription" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription={(self.subscription if hasattr(self, "subscription") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription=( + self.subscription + if hasattr(self, "subscription") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_sort.py b/advancedbilling/models/subscription_sort.py index 83b9c941..661cc59f 100644 --- a/advancedbilling/models/subscription_sort.py +++ b/advancedbilling/models/subscription_sort.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionSort(object): - """Implementation of the 'Subscription Sort' enum. Attributes: @@ -19,24 +16,38 @@ class SubscriptionSort(object): NEXT_ASSESSMENT: The enum member of type str. UPDATED_AT: The enum member of type str. CREATED_AT: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + TOTAL_PAYMENTS: The enum member of type str. + ID: The enum member of type str. + OPEN_BALANCE: The enum member of type str. + EXPIRES_AT: The enum member of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - SIGNUP_DATE = 'signup_date' - PERIOD_START = 'period_start' + SIGNUP_DATE = "signup_date" + + PERIOD_START = "period_start" + + PERIOD_END = "period_end" + + NEXT_ASSESSMENT = "next_assessment" + + UPDATED_AT = "updated_at" + + CREATED_AT = "created_at" - PERIOD_END = 'period_end' + TOTAL_PAYMENTS = "total_payments" - NEXT_ASSESSMENT = 'next_assessment' + ID = "id" - UPDATED_AT = 'updated_at' + OPEN_BALANCE = "open_balance" - CREATED_AT = 'created_at' + EXPIRES_AT = "expires_at" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_state.py b/advancedbilling/models/subscription_state.py index dbfbb479..a69b618d 100644 --- a/advancedbilling/models/subscription_state.py +++ b/advancedbilling/models/subscription_state.py @@ -1,88 +1,78 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionState(object): - """Implementation of the 'Subscription State' enum. The state of a subscription. * **Live States** - * `active` - A normal, active subscription. It is not in a trial and - is paid and up to date. - * `assessing` - An internal (transient) state that indicates a - subscription is in the middle of periodic assessment. Do not base any - access decisions in your app on this state, as it may not always be - exposed. - * `pending` - An internal (transient) state that indicates a - subscription is in the creation process. Do not base any access decisions - in your app on this state, as it may not always be exposed. + * `active` - A normal, active subscription. It is not in a trial and is paid + and up to date. + * `assessing` - An internal (transient) state that indicates a subscription + is in the middle of periodic assessment. Do not base any access decisions in your + app on this state, as it may not always be exposed. + * `pending` - An internal (transient) state that indicates a subscription is + in the creation process. Do not base any access decisions in your app on this + state, as it may not always be exposed. * `trialing` - A subscription in trialing state has a valid trial - subscription. This type of subscription may transition to active once - payment is received when the trial has ended. Otherwise, it may go to a - Problem or End of Life state. - * `paused` - An internal state that indicates that your account with - Advanced Billing is in arrears. + subscription. This type of subscription may transition to active once payment is + received when the trial has ended. Otherwise, it may go to a Problem or End of + Life state. + * `paused` - An internal state that indicates that your account with Advanced + Billing is in arrears. * **Problem States** - * `past_due` - Indicates that the most recent payment has failed, and - payment is past due for this subscription. If you have enabled our - automated dunning, this subscription will be in the dunning process - (additional status and callbacks from the dunning process will be - available in the future). If you are handling dunning and payment updates - yourself, you will want to use this state to initiate a payment update - from your customers. + * `past_due` - Indicates that the most recent payment has failed, and payment + is past due for this subscription. If you have enabled our automated dunning, + this subscription will be in the dunning process (additional status and callbacks + from the dunning process will be available in the future). If you are handling + dunning and payment updates yourself, you will want to use this state to initiate + a payment update from your customers. * `soft_failure` - Indicates that normal assessment/processing of the - subscription has failed for a reason that cannot be fixed by the Customer. - For example, a Soft Fail may result from a timeout at the gateway or - incorrect credentials on your part. The subscriptions should be retried - automatically. An interface is being built for you to review problems - resulting from these events to take manual action when needed. - * `unpaid` - Indicates an unpaid subscription. A subscription is - marked unpaid if the retry period expires and you have configured your - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunnin - g-Overview) settings to have a Final Action of `mark the subscription - unpaid`. + subscription has failed for a reason that cannot be fixed by the Customer. For + example, a Soft Fail may result from a timeout at the gateway or incorrect + credentials on your part. The subscriptions should be retried automatically. An + interface is being built for you to review problems resulting from these events + to take manual action when needed. + * `unpaid` - Indicates an unpaid subscription. A subscription is marked + unpaid if the retry period expires and you have configured your + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overv + iew) settings to have a Final Action of `mark the subscription unpaid`. * **End of Life States** - * `canceled` - Indicates a canceled subscription. This may happen at - your request (via the API or the web interface) or due to the expiration - of the - [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunnin - g-Overview) process without payment. See the - [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-R - eactivating-and-Resuming) documentation for info on how to restart a - canceled subscription. - While a subscription is canceled, its period will not advance, it will - not accrue any new charges, and Advanced Billing will not attempt to - collect the overdue balance. - * `expired` - Indicates a subscription that has expired due to running - its normal life cycle. Some products may be configured to have an - expiration period. An expired subscription then is one that stayed active - until it fulfilled its full period. - * `failed_to_create` - Indicates that signup has failed. (You may see - this state in a signup_failure webhook.) - * `on_hold` - Indicates that a subscription’s billing has been - temporarily stopped. While it is expected that the subscription will - resume and return to active status, this is still treated as an “End of - Life” state because the customer is not paying for services during this - time. - * `suspended` - Indicates that a prepaid subscription has used up all - their prepayment balance. If a prepayment is applied, it will return to an - active state. - * `trial_ended` - A subscription in a trial_ended state is a - subscription that completed a no-obligation trial and did not have a card - on file at the expiration of the trial period. See [Product Pricing – No - Obligation - Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product- - Editing) for more details. + * `canceled` - Indicates a canceled subscription. This may happen at your + request (via the API or the web interface) or due to the expiration of the + [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overv + iew) process without payment. See the + [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactiva + ting-and-Resuming) documentation for info on how to restart a canceled + subscription. + While a subscription is canceled, its period will not advance, it will not + accrue any new charges, and Advanced Billing will not attempt to collect the + overdue balance. + * `expired` - Indicates a subscription that has expired due to running its + normal life cycle. Some products may be configured to have an expiration period. + An expired subscription then is one that stayed active until it fulfilled its + full period. + * `failed_to_create` - Indicates that signup has failed. (You may see this + state in a signup_failure webhook.) + * `on_hold` - Indicates that a subscription’s billing has been temporarily + stopped. While it is expected that the subscription will resume and return to + active status, this is still treated as an “End of Life” state because the + customer is not paying for services during this time. + * `suspended` - Indicates that a prepaid subscription has used up all their + prepayment balance. If a prepayment is applied, it will return to an active state. + * `trial_ended` - A subscription in a trial_ended state is a subscription + that completed a no-obligation trial and did not have a card on file at the + expiration of the trial period. See [Product Pricing – No Obligation + Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing + ) for more details. See [Subscription - States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscrip - tion-States) for more info about subscription states and state transitions. + States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-St + ates) for more info about subscription states and state transitions. Attributes: PENDING: The enum member of type str. @@ -100,44 +90,47 @@ class SubscriptionState(object): TRIAL_ENDED: The enum member of type str. ON_HOLD: The enum member of type str. AWAITING_SIGNUP: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['pending', 'failed_to_create', 'trialing', 'assessing', 'active', 'soft_failure', 'past_due', 'suspended', 'canceled', 'expired', 'paused', 'unpaid', 'trial_ended', 'on_hold', 'awaiting_signup'] - PENDING = 'pending' - FAILED_TO_CREATE = 'failed_to_create' + _all_values = ["pending", "failed_to_create", "trialing", "assessing", + "active", "soft_failure", "past_due", "suspended", "canceled", "expired", + "paused", "unpaid", "trial_ended", "on_hold", "awaiting_signup"] + PENDING = "pending" - TRIALING = 'trialing' + FAILED_TO_CREATE = "failed_to_create" - ASSESSING = 'assessing' + TRIALING = "trialing" - ACTIVE = 'active' + ASSESSING = "assessing" - SOFT_FAILURE = 'soft_failure' + ACTIVE = "active" - PAST_DUE = 'past_due' + SOFT_FAILURE = "soft_failure" - SUSPENDED = 'suspended' + PAST_DUE = "past_due" - CANCELED = 'canceled' + SUSPENDED = "suspended" - EXPIRED = 'expired' + CANCELED = "canceled" - PAUSED = 'paused' + EXPIRED = "expired" - UNPAID = 'unpaid' + PAUSED = "paused" - TRIAL_ENDED = 'trial_ended' + UNPAID = "unpaid" - ON_HOLD = 'on_hold' + TRIAL_ENDED = "trial_ended" - AWAITING_SIGNUP = 'awaiting_signup' + ON_HOLD = "on_hold" + + AWAITING_SIGNUP = "awaiting_signup" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -147,9 +140,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/subscription_state_change.py b/advancedbilling/models/subscription_state_change.py index e916ed93..af132d4c 100644 --- a/advancedbilling/models/subscription_state_change.py +++ b/advancedbilling/models/subscription_state_change.py @@ -1,41 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class SubscriptionStateChange(object): - """Implementation of the 'Subscription State Change' model. Attributes: previous_subscription_state (str): The model property of type str. new_subscription_state (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "previous_subscription_state": 'previous_subscription_state', - "new_subscription_state": 'new_subscription_state' + "previous_subscription_state": "previous_subscription_state", + "new_subscription_state": "new_subscription_state", } - def __init__(self, - previous_subscription_state=None, - new_subscription_state=None, - additional_properties=None): - """Constructor for the SubscriptionStateChange class""" - + def __init__( + self, + previous_subscription_state=None, + new_subscription_state=None, + additional_properties=None): + """Initialize a SubscriptionStateChange instance.""" # Initialize members of the class - self.previous_subscription_state = previous_subscription_state - self.new_subscription_state = new_subscription_state + self.previous_subscription_state = previous_subscription_state + self.new_subscription_state = new_subscription_state # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,15 +54,23 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - previous_subscription_state = dictionary.get("previous_subscription_state") if dictionary.get("previous_subscription_state") else None - new_subscription_state = dictionary.get("new_subscription_state") if dictionary.get("new_subscription_state") else None + previous_subscription_state =\ + dictionary.get("previous_subscription_state")\ + if dictionary.get("previous_subscription_state")\ + else None + new_subscription_state =\ + dictionary.get("new_subscription_state")\ + if dictionary.get("new_subscription_state")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(previous_subscription_state, new_subscription_state, @@ -72,7 +78,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -83,29 +89,62 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.previous_subscription_state, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.new_subscription_state, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.previous_subscription_state, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.new_subscription_state, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('previous_subscription_state'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('new_subscription_state'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("previous_subscription_state"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_subscription_state"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'previous_subscription_state={self.previous_subscription_state!r}, ' - f'new_subscription_state={self.new_subscription_state!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _previous_subscription_state=self.previous_subscription_state + _new_subscription_state=self.new_subscription_state + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_subscription_state={_previous_subscription_state!r}, " + f"new_subscription_state={_new_subscription_state!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'previous_subscription_state={self.previous_subscription_state!s}, ' - f'new_subscription_state={self.new_subscription_state!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _previous_subscription_state=self.previous_subscription_state + _new_subscription_state=self.new_subscription_state + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_subscription_state={_previous_subscription_state!s}, " + f"new_subscription_state={_new_subscription_state!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_state_filter.py b/advancedbilling/models/subscription_state_filter.py index aeaa25c0..ae922f80 100644 --- a/advancedbilling/models/subscription_state_filter.py +++ b/advancedbilling/models/subscription_state_filter.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class SubscriptionStateFilter(object): - """Implementation of the 'Subscription State Filter' enum. Allowed values for filtering by the current state of the subscription. @@ -27,36 +24,38 @@ class SubscriptionStateFilter(object): TRIAL_ENDED: The enum member of type str. TRIALING: The enum member of type str. UNPAID: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - ACTIVE = 'active' - CANCELED = 'canceled' + ACTIVE = "active" + + CANCELED = "canceled" - EXPIRED = 'expired' + EXPIRED = "expired" - EXPIRED_CARDS = 'expired_cards' + EXPIRED_CARDS = "expired_cards" - ON_HOLD = 'on_hold' + ON_HOLD = "on_hold" - PAST_DUE = 'past_due' + PAST_DUE = "past_due" - PENDING_CANCELLATION = 'pending_cancellation' + PENDING_CANCELLATION = "pending_cancellation" - PENDING_RENEWAL = 'pending_renewal' + PENDING_RENEWAL = "pending_renewal" - SUSPENDED = 'suspended' + SUSPENDED = "suspended" - TRIAL_ENDED = 'trial_ended' + TRIAL_ENDED = "trial_ended" - TRIALING = 'trialing' + TRIALING = "trialing" - UNPAID = 'unpaid' + UNPAID = "unpaid" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/tax_configuration.py b/advancedbilling/models/tax_configuration.py index 8d8e4694..977d9d43 100644 --- a/advancedbilling/models/tax_configuration.py +++ b/advancedbilling/models/tax_configuration.py @@ -1,58 +1,54 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class TaxConfiguration(object): - """Implementation of the 'Tax Configuration' model. Attributes: - kind (TaxConfigurationKind): The model property of type - TaxConfigurationKind. - destination_address (TaxDestinationAddress): The model property of - type TaxDestinationAddress. - fully_configured (bool): Returns `true` when Chargify has been - properly configured to charge tax using the specified tax system. - More details about taxes: - https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Ov - erview - additional_properties (Dict[str, object]): The additional properties - for the model. + kind (TaxConfigurationKind): The model property of type TaxConfigurationKind. + destination_address (TaxDestinationAddress): The model property of type + TaxDestinationAddress. + fully_configured (bool): Returns `true` when Chargify has been properly + configured to charge tax using the specified tax system. More details + about taxes: + https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "kind": 'kind', - "destination_address": 'destination_address', - "fully_configured": 'fully_configured' + "kind": "kind", + "destination_address": "destination_address", + "fully_configured": "fully_configured", } _optionals = [ - 'kind', - 'destination_address', - 'fully_configured', + "kind", + "destination_address", + "fully_configured", ] - def __init__(self, - kind='custom', - destination_address=APIHelper.SKIP, - fully_configured=False, - additional_properties=None): - """Constructor for the TaxConfiguration class""" - + def __init__( + self, + kind="custom", + destination_address=APIHelper.SKIP, + fully_configured=False, + additional_properties=None): + """Initialize a TaxConfiguration instance.""" # Initialize members of the class - self.kind = kind + self.kind = kind if destination_address is not APIHelper.SKIP: - self.destination_address = destination_address - self.fully_configured = fully_configured + self.destination_address = destination_address + self.fully_configured = fully_configured # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +58,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,16 +69,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - kind = dictionary.get("kind") if dictionary.get("kind") else 'custom' - destination_address = dictionary.get("destination_address") if dictionary.get("destination_address") else APIHelper.SKIP - fully_configured = dictionary.get("fully_configured") if dictionary.get("fully_configured") else False + kind =\ + dictionary.get("kind")\ + if dictionary.get("kind")\ + else "custom" + destination_address =\ + dictionary.get("destination_address")\ + if dictionary.get("destination_address")\ + else APIHelper.SKIP + fully_configured =\ + dictionary.get("fully_configured")\ + if dictionary.get("fully_configured")\ + else False + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(kind, destination_address, @@ -90,15 +97,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'kind={(self.kind if hasattr(self, "kind") else None)!r}, ' - f'destination_address={(self.destination_address if hasattr(self, "destination_address") else None)!r}, ' - f'fully_configured={(self.fully_configured if hasattr(self, "fully_configured") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _destination_address=( + self.destination_address + if hasattr(self, "destination_address") + else None + ) + _fully_configured=( + self.fully_configured + if hasattr(self, "fully_configured") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"kind={_kind!r}, " + f"destination_address={_destination_address!r}, " + f"fully_configured={_fully_configured!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'kind={(self.kind if hasattr(self, "kind") else None)!s}, ' - f'destination_address={(self.destination_address if hasattr(self, "destination_address") else None)!s}, ' - f'fully_configured={(self.fully_configured if hasattr(self, "fully_configured") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _kind=( + self.kind + if hasattr(self, "kind") + else None + ) + _destination_address=( + self.destination_address + if hasattr(self, "destination_address") + else None + ) + _fully_configured=( + self.fully_configured + if hasattr(self, "fully_configured") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"kind={_kind!s}, " + f"destination_address={_destination_address!s}, " + f"fully_configured={_fully_configured!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/tax_configuration_kind.py b/advancedbilling/models/tax_configuration_kind.py index 9d8eaded..7db7e563 100644 --- a/advancedbilling/models/tax_configuration_kind.py +++ b/advancedbilling/models/tax_configuration_kind.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class TaxConfigurationKind(object): - """Implementation of the 'Tax Configuration Kind' enum. Attributes: @@ -17,20 +14,22 @@ class TaxConfigurationKind(object): ENUM_MANAGED AVALARA: The enum member of type str. ENUM_LINKED AVALARA: The enum member of type str. ENUM_DIGITAL RIVER: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - CUSTOM = 'custom' - ENUM_MANAGED_AVALARA = 'managed avalara' + CUSTOM = "custom" + + ENUM_MANAGED_AVALARA = "managed avalara" - ENUM_LINKED_AVALARA = 'linked avalara' + ENUM_LINKED_AVALARA = "linked avalara" - ENUM_DIGITAL_RIVER = 'digital river' + ENUM_DIGITAL_RIVER = "digital river" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/tax_destination_address.py b/advancedbilling/models/tax_destination_address.py index 2777c6e1..b32043c1 100644 --- a/advancedbilling/models/tax_destination_address.py +++ b/advancedbilling/models/tax_destination_address.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class TaxDestinationAddress(object): - """Implementation of the 'Tax Destination Address' enum. Attributes: @@ -17,20 +14,22 @@ class TaxDestinationAddress(object): BILLING_THEN_SHIPPING: The enum member of type str. SHIPPING_ONLY: The enum member of type str. BILLING_ONLY: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - SHIPPING_THEN_BILLING = 'shipping_then_billing' - BILLING_THEN_SHIPPING = 'billing_then_shipping' + SHIPPING_THEN_BILLING = "shipping_then_billing" + + BILLING_THEN_SHIPPING = "billing_then_shipping" - SHIPPING_ONLY = 'shipping_only' + SHIPPING_ONLY = "shipping_only" - BILLING_ONLY = 'billing_only' + BILLING_ONLY = "billing_only" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/too_many_management_link_requests.py b/advancedbilling/models/too_many_management_link_requests.py index 0d4fdb3c..b085991e 100644 --- a/advancedbilling/models/too_many_management_link_requests.py +++ b/advancedbilling/models/too_many_management_link_requests.py @@ -1,41 +1,42 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class TooManyManagementLinkRequests(object): - """Implementation of the 'Too Many Management Link Requests' model. Attributes: error (str): The model property of type str. new_link_available_at (datetime): The model property of type datetime. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "error": 'error', - "new_link_available_at": 'new_link_available_at' + "error": "error", + "new_link_available_at": "new_link_available_at", } - def __init__(self, - error=None, - new_link_available_at=None, - additional_properties=None): - """Constructor for the TooManyManagementLinkRequests class""" - + def __init__( + self, + error=None, + new_link_available_at=None, + additional_properties=None): + """Initialize a TooManyManagementLinkRequests instance.""" # Initialize members of the class - self.error = error - self.new_link_available_at = APIHelper.apply_datetime_converter(new_link_available_at, APIHelper.RFC3339DateTime) if new_link_available_at else None + self.error = error + self.new_link_available_at =\ + APIHelper.apply_datetime_converter( + new_link_available_at, APIHelper.RFC3339DateTime)\ + if new_link_available_at else None # Add additional model properties to the instance if additional_properties is None: @@ -45,7 +46,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -56,28 +57,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - error = dictionary.get("error") if dictionary.get("error") else None - new_link_available_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("new_link_available_at")).datetime if dictionary.get("new_link_available_at") else None + error =\ + dictionary.get("error")\ + if dictionary.get("error")\ + else None + new_link_available_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("new_link_available_at")).datetime\ + if dictionary.get("new_link_available_at") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(error, new_link_available_at, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'error={self.error!r}, ' - f'new_link_available_at={self.new_link_available_at!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _error=self.error + _new_link_available_at=self.new_link_available_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"error={_error!r}, " + f"new_link_available_at={_new_link_available_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'error={self.error!s}, ' - f'new_link_available_at={self.new_link_available_at!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _error=self.error + _new_link_available_at=self.new_link_available_at + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"error={_error!s}, " + f"new_link_available_at={_new_link_available_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/trial_type.py b/advancedbilling/models/trial_type.py index 728b6605..7363ac85 100644 --- a/advancedbilling/models/trial_type.py +++ b/advancedbilling/models/trial_type.py @@ -1,39 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class TrialType(object): - """Implementation of the 'Trial Type' enum. - Indicates how a trial is handled when the trail period ends and there is - no credit card on file. For `no_obligation`, the subscription transitions - to a Trial Ended state. Maxio will not send any emails or statements. For - `payment_expected`, the subscription transitions to a Past Due state. - Maxio will send normal dunning emails and statements according to your - other settings. + Indicates how a trial is handled when the trail period ends and there is no + credit card on file. For `no_obligation`, the subscription transitions to a Trial + Ended state. Maxio will not send any emails or statements. For + `payment_expected`, the subscription transitions to a Past Due state. Maxio will + send normal dunning emails and statements according to your other settings. Attributes: NO_OBLIGATION: The enum member of type str. PAYMENT_EXPECTED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - _all_values = ['no_obligation', 'payment_expected'] - NO_OBLIGATION = 'no_obligation' - PAYMENT_EXPECTED = 'payment_expected' + _all_values = ["no_obligation", "payment_expected"] + NO_OBLIGATION = "no_obligation" + + PAYMENT_EXPECTED = "payment_expected" @classmethod def validate(cls, value): - """Validates value contains in enum + """Validate value contains in enum Args: value: the value to be validated @@ -43,9 +40,10 @@ def validate(cls, value): """ return value in cls._all_values - + @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/update_allocation_expiration_date.py b/advancedbilling/models/update_allocation_expiration_date.py index a6eac6c5..cd80a5f0 100644 --- a/advancedbilling/models/update_allocation_expiration_date.py +++ b/advancedbilling/models/update_allocation_expiration_date.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.allocation_expiration_date import AllocationExpirationDate +from advancedbilling.models.allocation_expiration_date import ( + AllocationExpirationDate, +) class UpdateAllocationExpirationDate(object): - """Implementation of the 'Update Allocation Expiration Date' model. Attributes: allocation (AllocationExpirationDate): The model property of type AllocationExpirationDate. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "allocation": 'allocation' + "allocation": "allocation", } _optionals = [ - 'allocation', + "allocation", ] - def __init__(self, - allocation=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateAllocationExpirationDate class""" - + def __init__( + self, + allocation=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateAllocationExpirationDate instance.""" # Initialize members of the class if allocation is not APIHelper.SKIP: - self.allocation = allocation + self.allocation = allocation # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,24 +59,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - allocation = AllocationExpirationDate.from_dictionary(dictionary.get('allocation')) if 'allocation' in dictionary.keys() else APIHelper.SKIP + allocation =\ + AllocationExpirationDate.from_dictionary( + dictionary.get("allocation"))\ + if "allocation" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(allocation, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'allocation={(self.allocation if hasattr(self, "allocation") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _allocation=( + self.allocation + if hasattr(self, "allocation") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation={_allocation!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'allocation={(self.allocation if hasattr(self, "allocation") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _allocation=( + self.allocation + if hasattr(self, "allocation") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"allocation={_allocation!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_component.py b/advancedbilling/models/update_component.py index 799d6a2c..f645f685 100644 --- a/advancedbilling/models/update_component.py +++ b/advancedbilling/models/update_component.py @@ -1,107 +1,102 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdateComponent(object): - """Implementation of the 'Update Component' model. Attributes: handle (str): The model property of type str. - name (str): The name of the Component, suitable for display on - statements. i.e. Text Messages. + name (str): The name of the Component, suitable for display on statements. + i.e. Text Messages. description (str): The description of the component. accounting_code (str): The model property of type str. - taxable (bool): Boolean flag describing whether a component is taxable - or not. - tax_code (str): A string representing the tax code related to the - component type. This is especially important when using AvaTax to - tax based on locale. This attribute has a max length of 25 - characters. + taxable (bool): Boolean flag describing whether a component is taxable or not. + tax_code (str): A string representing the tax code related to the component + type. This is especially important when using AvaTax to tax based on + locale. This attribute has a max length of 25 characters. item_category (ItemCategory): One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other display_on_hosted_page (bool): The model property of type bool. upgrade_charge (CreditType): The type of credit to be created when - upgrading/downgrading. Defaults to the component and then site - setting if one is not provided. Available values: `full`, - `prorated`, `none`. - additional_properties (Dict[str, object]): The additional properties - for the model. + upgrading/downgrading. Defaults to the component and then site setting if + one is not provided. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "handle": 'handle', - "name": 'name', - "description": 'description', - "accounting_code": 'accounting_code', - "taxable": 'taxable', - "tax_code": 'tax_code', - "item_category": 'item_category', - "display_on_hosted_page": 'display_on_hosted_page', - "upgrade_charge": 'upgrade_charge' + "handle": "handle", + "name": "name", + "description": "description", + "accounting_code": "accounting_code", + "taxable": "taxable", + "tax_code": "tax_code", + "item_category": "item_category", + "display_on_hosted_page": "display_on_hosted_page", + "upgrade_charge": "upgrade_charge", } _optionals = [ - 'handle', - 'name', - 'description', - 'accounting_code', - 'taxable', - 'tax_code', - 'item_category', - 'display_on_hosted_page', - 'upgrade_charge', + "handle", + "name", + "description", + "accounting_code", + "taxable", + "tax_code", + "item_category", + "display_on_hosted_page", + "upgrade_charge", ] _nullables = [ - 'description', - 'accounting_code', - 'tax_code', - 'item_category', - 'upgrade_charge', + "description", + "accounting_code", + "tax_code", + "item_category", + "upgrade_charge", ] - def __init__(self, - handle=APIHelper.SKIP, - name=APIHelper.SKIP, - description=APIHelper.SKIP, - accounting_code=APIHelper.SKIP, - taxable=APIHelper.SKIP, - tax_code=APIHelper.SKIP, - item_category=APIHelper.SKIP, - display_on_hosted_page=APIHelper.SKIP, - upgrade_charge=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateComponent class""" - + def __init__( + self, + handle=APIHelper.SKIP, + name=APIHelper.SKIP, + description=APIHelper.SKIP, + accounting_code=APIHelper.SKIP, + taxable=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + item_category=APIHelper.SKIP, + display_on_hosted_page=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateComponent instance.""" # Initialize members of the class if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if name is not APIHelper.SKIP: - self.name = name + self.name = name if description is not APIHelper.SKIP: - self.description = description + self.description = description if accounting_code is not APIHelper.SKIP: - self.accounting_code = accounting_code + self.accounting_code = accounting_code if taxable is not APIHelper.SKIP: - self.taxable = taxable + self.taxable = taxable if tax_code is not APIHelper.SKIP: - self.tax_code = tax_code + self.tax_code = tax_code if item_category is not APIHelper.SKIP: - self.item_category = item_category + self.item_category = item_category if display_on_hosted_page is not APIHelper.SKIP: - self.display_on_hosted_page = display_on_hosted_page + self.display_on_hosted_page = display_on_hosted_page if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge + self.upgrade_charge = upgrade_charge # Add additional model properties to the instance if additional_properties is None: @@ -111,7 +106,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -122,22 +117,51 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - description = dictionary.get("description") if "description" in dictionary.keys() else APIHelper.SKIP - accounting_code = dictionary.get("accounting_code") if "accounting_code" in dictionary.keys() else APIHelper.SKIP - taxable = dictionary.get("taxable") if "taxable" in dictionary.keys() else APIHelper.SKIP - tax_code = dictionary.get("tax_code") if "tax_code" in dictionary.keys() else APIHelper.SKIP - item_category = dictionary.get("item_category") if "item_category" in dictionary.keys() else APIHelper.SKIP - display_on_hosted_page = dictionary.get("display_on_hosted_page") if "display_on_hosted_page" in dictionary.keys() else APIHelper.SKIP - upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if "description" in dictionary.keys()\ + else APIHelper.SKIP + accounting_code =\ + dictionary.get("accounting_code")\ + if "accounting_code" in dictionary.keys()\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if "tax_code" in dictionary.keys()\ + else APIHelper.SKIP + item_category =\ + dictionary.get("item_category")\ + if "item_category" in dictionary.keys()\ + else APIHelper.SKIP + display_on_hosted_page =\ + dictionary.get("display_on_hosted_page")\ + if "display_on_hosted_page" in dictionary.keys()\ + else APIHelper.SKIP + upgrade_charge =\ + dictionary.get("upgrade_charge")\ + if "upgrade_charge" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(handle, name, @@ -151,27 +175,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!r}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!r}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!r}, ' - f'item_category={(self.item_category if hasattr(self, "item_category") else None)!r}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!r}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _item_category=( + self.item_category + if hasattr(self, "item_category") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"handle={_handle!r}, " + f"name={_name!r}, " + f"description={_description!r}, " + f"accounting_code={_accounting_code!r}, " + f"taxable={_taxable!r}, " + f"tax_code={_tax_code!r}, " + f"item_category={_item_category!r}, " + f"display_on_hosted_page={_display_on_hosted_page!r}, " + f"upgrade_charge={_upgrade_charge!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'accounting_code={(self.accounting_code if hasattr(self, "accounting_code") else None)!s}, ' - f'taxable={(self.taxable if hasattr(self, "taxable") else None)!s}, ' - f'tax_code={(self.tax_code if hasattr(self, "tax_code") else None)!s}, ' - f'item_category={(self.item_category if hasattr(self, "item_category") else None)!s}, ' - f'display_on_hosted_page={(self.display_on_hosted_page if hasattr(self, "display_on_hosted_page") else None)!s}, ' - f'upgrade_charge={(self.upgrade_charge if hasattr(self, "upgrade_charge") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _accounting_code=( + self.accounting_code + if hasattr(self, "accounting_code") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _item_category=( + self.item_category + if hasattr(self, "item_category") + else None + ) + _display_on_hosted_page=( + self.display_on_hosted_page + if hasattr(self, "display_on_hosted_page") + else None + ) + _upgrade_charge=( + self.upgrade_charge + if hasattr(self, "upgrade_charge") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"handle={_handle!s}, " + f"name={_name!s}, " + f"description={_description!s}, " + f"accounting_code={_accounting_code!s}, " + f"taxable={_taxable!s}, " + f"tax_code={_tax_code!s}, " + f"item_category={_item_category!s}, " + f"display_on_hosted_page={_display_on_hosted_page!s}, " + f"upgrade_charge={_upgrade_charge!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_component_price_point.py b/advancedbilling/models/update_component_price_point.py index 166a9f4a..da68c973 100644 --- a/advancedbilling/models/update_component_price_point.py +++ b/advancedbilling/models/update_component_price_point.py @@ -1,100 +1,99 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.update_price import UpdatePrice +from advancedbilling.models.update_price import ( + UpdatePrice, +) class UpdateComponentPricePoint(object): - """Implementation of the 'Update Component Price Point' model. Attributes: name (str): The model property of type str. handle (str): The model property of type str. - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. - use_site_exchange_rate (bool): Whether to use the site level exchange - rate or define your own prices for each currency if you have - multiple currencies defined on the site. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. + use_site_exchange_rate (bool): Whether to use the site level exchange rate or + define your own prices for each currency if you have multiple currencies + defined on the site. tax_included (bool): Whether or not the price point includes tax - interval (int): The numerical interval. i.e. an interval of ‘30’ - coupled with an interval_unit of day would mean this component - price point would renew every 30 days. This property is only + interval (int): The numerical interval. i.e. an interval of ‘30’ coupled with + an interval_unit of day would mean this component price point would renew + every 30 days. This property is only available for sites with + Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit for + this component price point, either month or day. This property is only available for sites with Multifrequency enabled. - interval_unit (IntervalUnit): A string representing the interval unit - for this component price point, either month or day. This property - is only available for sites with Multifrequency enabled. - prices (List[UpdatePrice]): The model property of type - List[UpdatePrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + prices (List[UpdatePrice]): The model property of type List[UpdatePrice]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "name": 'name', - "handle": 'handle', - "pricing_scheme": 'pricing_scheme', - "use_site_exchange_rate": 'use_site_exchange_rate', - "tax_included": 'tax_included', - "interval": 'interval', - "interval_unit": 'interval_unit', - "prices": 'prices' + "name": "name", + "handle": "handle", + "pricing_scheme": "pricing_scheme", + "use_site_exchange_rate": "use_site_exchange_rate", + "tax_included": "tax_included", + "interval": "interval", + "interval_unit": "interval_unit", + "prices": "prices", } _optionals = [ - 'name', - 'handle', - 'pricing_scheme', - 'use_site_exchange_rate', - 'tax_included', - 'interval', - 'interval_unit', - 'prices', + "name", + "handle", + "pricing_scheme", + "use_site_exchange_rate", + "tax_included", + "interval", + "interval_unit", + "prices", ] _nullables = [ - 'interval_unit', + "interval_unit", ] - def __init__(self, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - use_site_exchange_rate=APIHelper.SKIP, - tax_included=APIHelper.SKIP, - interval=APIHelper.SKIP, - interval_unit=APIHelper.SKIP, - prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateComponentPricePoint class""" - + def __init__( + self, + name=APIHelper.SKIP, + handle=APIHelper.SKIP, + pricing_scheme=APIHelper.SKIP, + use_site_exchange_rate=APIHelper.SKIP, + tax_included=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP, + prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateComponentPricePoint instance.""" # Initialize members of the class if name is not APIHelper.SKIP: - self.name = name + self.name = name if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if use_site_exchange_rate is not APIHelper.SKIP: - self.use_site_exchange_rate = use_site_exchange_rate + self.use_site_exchange_rate = use_site_exchange_rate if tax_included is not APIHelper.SKIP: - self.tax_included = tax_included + self.tax_included = tax_included if interval is not APIHelper.SKIP: - self.interval = interval + self.interval = interval if interval_unit is not APIHelper.SKIP: - self.interval_unit = interval_unit + self.interval_unit = interval_unit if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices # Add additional model properties to the instance if additional_properties is None: @@ -104,7 +103,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -115,25 +114,51 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else APIHelper.SKIP - use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP - tax_included = dictionary.get("tax_included") if "tax_included" in dictionary.keys() else APIHelper.SKIP - interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP - interval_unit = dictionary.get("interval_unit") if "interval_unit" in dictionary.keys() else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else APIHelper.SKIP + use_site_exchange_rate =\ + dictionary.get("use_site_exchange_rate")\ + if "use_site_exchange_rate" in dictionary.keys()\ + else APIHelper.SKIP + tax_included =\ + dictionary.get("tax_included")\ + if "tax_included" in dictionary.keys()\ + else APIHelper.SKIP + interval =\ + dictionary.get("interval")\ + if dictionary.get("interval")\ + else APIHelper.SKIP + interval_unit =\ + dictionary.get("interval_unit")\ + if "interval_unit" in dictionary.keys()\ + else APIHelper.SKIP prices = None - if dictionary.get('prices') is not None: - prices = [UpdatePrice.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + UpdatePrice.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(name, handle, @@ -146,25 +171,115 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!r}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!r}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!r}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!r}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!r}, " + f"handle={_handle!r}, " + f"pricing_scheme={_pricing_scheme!r}, " + f"use_site_exchange_rate={_use_site_exchange_rate!r}, " + f"tax_included={_tax_included!r}, " + f"interval={_interval!r}, " + f"interval_unit={_interval_unit!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'pricing_scheme={(self.pricing_scheme if hasattr(self, "pricing_scheme") else None)!s}, ' - f'use_site_exchange_rate={(self.use_site_exchange_rate if hasattr(self, "use_site_exchange_rate") else None)!s}, ' - f'tax_included={(self.tax_included if hasattr(self, "tax_included") else None)!s}, ' - f'interval={(self.interval if hasattr(self, "interval") else None)!s}, ' - f'interval_unit={(self.interval_unit if hasattr(self, "interval_unit") else None)!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _name=( + self.name + if hasattr(self, "name") + else None + ) + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _pricing_scheme=( + self.pricing_scheme + if hasattr(self, "pricing_scheme") + else None + ) + _use_site_exchange_rate=( + self.use_site_exchange_rate + if hasattr(self, "use_site_exchange_rate") + else None + ) + _tax_included=( + self.tax_included + if hasattr(self, "tax_included") + else None + ) + _interval=( + self.interval + if hasattr(self, "interval") + else None + ) + _interval_unit=( + self.interval_unit + if hasattr(self, "interval_unit") + else None + ) + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"name={_name!s}, " + f"handle={_handle!s}, " + f"pricing_scheme={_pricing_scheme!s}, " + f"use_site_exchange_rate={_use_site_exchange_rate!s}, " + f"tax_included={_tax_included!s}, " + f"interval={_interval!s}, " + f"interval_unit={_interval_unit!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_component_price_point_request.py b/advancedbilling/models/update_component_price_point_request.py index 4efc9e6e..171c6135 100644 --- a/advancedbilling/models/update_component_price_point_request.py +++ b/advancedbilling/models/update_component_price_point_request.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.update_component_price_point import UpdateComponentPricePoint +from advancedbilling.models.update_component_price_point import ( + UpdateComponentPricePoint, +) class UpdateComponentPricePointRequest(object): - """Implementation of the 'Update Component Price Point Request' model. Attributes: price_point (UpdateComponentPricePoint): The model property of type UpdateComponentPricePoint. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point": 'price_point' + "price_point": "price_point", } _optionals = [ - 'price_point', + "price_point", ] - def __init__(self, - price_point=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateComponentPricePointRequest class""" - + def __init__( + self, + price_point=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateComponentPricePointRequest instance.""" # Initialize members of the class if price_point is not APIHelper.SKIP: - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -48,7 +48,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -59,24 +59,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point = UpdateComponentPricePoint.from_dictionary(dictionary.get('price_point')) if 'price_point' in dictionary.keys() else APIHelper.SKIP + price_point =\ + UpdateComponentPricePoint.from_dictionary( + dictionary.get("price_point"))\ + if "price_point" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point={(self.price_point if hasattr(self, "price_point") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point=( + self.price_point + if hasattr(self, "price_point") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_component_request.py b/advancedbilling/models/update_component_request.py index d01404f4..ac6f9a52 100644 --- a/advancedbilling/models/update_component_request.py +++ b/advancedbilling/models/update_component_request.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_component import UpdateComponent +# ruff: noqa: E501 +from advancedbilling.models.update_component import ( + UpdateComponent, +) -class UpdateComponentRequest(object): +class UpdateComponentRequest(object): """Implementation of the 'Update Component Request' model. Attributes: - component (UpdateComponent): The model property of type - UpdateComponent. - additional_properties (Dict[str, object]): The additional properties - for the model. + component (UpdateComponent): The model property of type UpdateComponent. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component": 'component' + "component": "component", } - def __init__(self, - component=None, - additional_properties=None): - """Constructor for the UpdateComponentRequest class""" - + def __init__( + self, + component=None, + additional_properties=None): + """Initialize a UpdateComponentRequest instance.""" # Initialize members of the class - self.component = component + self.component = component # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component = UpdateComponent.from_dictionary(dictionary.get('component')) if dictionary.get('component') else None + component =\ + UpdateComponent.from_dictionary( + dictionary.get("component"))\ + if dictionary.get("component") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component={self.component!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component=self.component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component={_component!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component={self.component!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component=self.component + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component={_component!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_coupon_currency.py b/advancedbilling/models/update_coupon_currency.py index 33dfdec9..42c678b4 100644 --- a/advancedbilling/models/update_coupon_currency.py +++ b/advancedbilling/models/update_coupon_currency.py @@ -1,40 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class UpdateCouponCurrency(object): - """Implementation of the 'Update Coupon Currency' model. Attributes: currency (str): ISO code for the site defined currency. price (int): Price for the given currency. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency": 'currency', - "price": 'price' + "currency": "currency", + "price": "price", } - def __init__(self, - currency=None, - price=None, - additional_properties=None): - """Constructor for the UpdateCouponCurrency class""" - + def __init__( + self, + currency=None, + price=None, + additional_properties=None): + """Initialize a UpdateCouponCurrency instance.""" # Initialize members of the class - self.currency = currency - self.price = price + self.currency = currency + self.price = price # Add additional model properties to the instance if additional_properties is None: @@ -44,7 +40,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -55,28 +51,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - currency = dictionary.get("currency") if dictionary.get("currency") else None - price = dictionary.get("price") if dictionary.get("price") else None + currency =\ + dictionary.get("currency")\ + if dictionary.get("currency")\ + else None + price =\ + dictionary.get("price")\ + if dictionary.get("price")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency, price, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency={self.currency!r}, ' - f'price={self.price!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency=self.currency + _price=self.price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency={_currency!r}, " + f"price={_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency={self.currency!s}, ' - f'price={self.price!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency=self.currency + _price=self.price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency={_currency!s}, " + f"price={_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_currency_price.py b/advancedbilling/models/update_currency_price.py index a8f29973..b1b92775 100644 --- a/advancedbilling/models/update_currency_price.py +++ b/advancedbilling/models/update_currency_price.py @@ -1,40 +1,36 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class UpdateCurrencyPrice(object): - """Implementation of the 'Update Currency Price' model. Attributes: id (int): ID of the currency price record being updated price (float): New price for the given currency - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "price": 'price' + "id": "id", + "price": "price", } - def __init__(self, - id=None, - price=None, - additional_properties=None): - """Constructor for the UpdateCurrencyPrice class""" - + def __init__( + self, + id=None, + price=None, + additional_properties=None): + """Initialize a UpdateCurrencyPrice instance.""" # Initialize members of the class - self.id = id - self.price = price + self.id = id + self.price = price # Add additional model properties to the instance if additional_properties is None: @@ -44,7 +40,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -55,28 +51,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - price = dictionary.get("price") if dictionary.get("price") else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + price =\ + dictionary.get("price")\ + if dictionary.get("price")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, price, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'price={self.price!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _price=self.price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"price={_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'price={self.price!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _price=self.price + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"price={_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_currency_prices_request.py b/advancedbilling/models/update_currency_prices_request.py index 27473b1f..b09782ab 100644 --- a/advancedbilling/models/update_currency_prices_request.py +++ b/advancedbilling/models/update_currency_prices_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_currency_price import UpdateCurrencyPrice +# ruff: noqa: E501 +from advancedbilling.models.update_currency_price import ( + UpdateCurrencyPrice, +) -class UpdateCurrencyPricesRequest(object): +class UpdateCurrencyPricesRequest(object): """Implementation of the 'Update Currency Prices Request' model. Attributes: - currency_prices (List[UpdateCurrencyPrice]): The model property of - type List[UpdateCurrencyPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + currency_prices (List[UpdateCurrencyPrice]): The model property of type + List[UpdateCurrencyPrice]. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "currency_prices": 'currency_prices' + "currency_prices": "currency_prices", } - def __init__(self, - currency_prices=None, - additional_properties=None): - """Constructor for the UpdateCurrencyPricesRequest class""" - + def __init__( + self, + currency_prices=None, + additional_properties=None): + """Initialize a UpdateCurrencyPricesRequest instance.""" # Initialize members of the class - self.currency_prices = currency_prices + self.currency_prices = currency_prices # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,26 +53,43 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary currency_prices = None - if dictionary.get('currency_prices') is not None: - currency_prices = [UpdateCurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] + if dictionary.get("currency_prices") is not None: + currency_prices = [ + UpdateCurrencyPrice.from_dictionary(x) + for x in dictionary.get("currency_prices") + ] + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(currency_prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'currency_prices={self.currency_prices!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _currency_prices=self.currency_prices + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"currency_prices={_currency_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_customer.py b/advancedbilling/models/update_customer.py index 8c8b99d6..ce79e402 100644 --- a/advancedbilling/models/update_customer.py +++ b/advancedbilling/models/update_customer.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdateCustomer(object): - """Implementation of the 'Update Customer' model. Attributes: @@ -32,132 +30,132 @@ class UpdateCustomer(object): tax_exempt (bool): The model property of type bool. tax_exempt_reason (str): The model property of type str. parent_id (int): The model property of type int. - verified (bool): Is the customer verified to use ACH as a payment - method. Available only on Authorize.Net gateway + verified (bool): Is the customer verified to use ACH as a payment method. + Available only on Authorize.Net gateway salesforce_id (str): The Salesforce ID of the customer - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "email": 'email', - "cc_emails": 'cc_emails', - "organization": 'organization', - "reference": 'reference', - "address": 'address', - "address_2": 'address_2', - "city": 'city', - "state": 'state', - "zip": 'zip', - "country": 'country', - "phone": 'phone', - "locale": 'locale', - "vat_number": 'vat_number', - "tax_exempt": 'tax_exempt', - "tax_exempt_reason": 'tax_exempt_reason', - "parent_id": 'parent_id', - "verified": 'verified', - "salesforce_id": 'salesforce_id' + "first_name": "first_name", + "last_name": "last_name", + "email": "email", + "cc_emails": "cc_emails", + "organization": "organization", + "reference": "reference", + "address": "address", + "address_2": "address_2", + "city": "city", + "state": "state", + "zip": "zip", + "country": "country", + "phone": "phone", + "locale": "locale", + "vat_number": "vat_number", + "tax_exempt": "tax_exempt", + "tax_exempt_reason": "tax_exempt_reason", + "parent_id": "parent_id", + "verified": "verified", + "salesforce_id": "salesforce_id", } _optionals = [ - 'first_name', - 'last_name', - 'email', - 'cc_emails', - 'organization', - 'reference', - 'address', - 'address_2', - 'city', - 'state', - 'zip', - 'country', - 'phone', - 'locale', - 'vat_number', - 'tax_exempt', - 'tax_exempt_reason', - 'parent_id', - 'verified', - 'salesforce_id', + "first_name", + "last_name", + "email", + "cc_emails", + "organization", + "reference", + "address", + "address_2", + "city", + "state", + "zip", + "country", + "phone", + "locale", + "vat_number", + "tax_exempt", + "tax_exempt_reason", + "parent_id", + "verified", + "salesforce_id", ] _nullables = [ - 'parent_id', - 'verified', - 'salesforce_id', + "parent_id", + "verified", + "salesforce_id", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - email=APIHelper.SKIP, - cc_emails=APIHelper.SKIP, - organization=APIHelper.SKIP, - reference=APIHelper.SKIP, - address=APIHelper.SKIP, - address_2=APIHelper.SKIP, - city=APIHelper.SKIP, - state=APIHelper.SKIP, - zip=APIHelper.SKIP, - country=APIHelper.SKIP, - phone=APIHelper.SKIP, - locale=APIHelper.SKIP, - vat_number=APIHelper.SKIP, - tax_exempt=APIHelper.SKIP, - tax_exempt_reason=APIHelper.SKIP, - parent_id=APIHelper.SKIP, - verified=APIHelper.SKIP, - salesforce_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateCustomer class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + email=APIHelper.SKIP, + cc_emails=APIHelper.SKIP, + organization=APIHelper.SKIP, + reference=APIHelper.SKIP, + address=APIHelper.SKIP, + address_2=APIHelper.SKIP, + city=APIHelper.SKIP, + state=APIHelper.SKIP, + zip=APIHelper.SKIP, + country=APIHelper.SKIP, + phone=APIHelper.SKIP, + locale=APIHelper.SKIP, + vat_number=APIHelper.SKIP, + tax_exempt=APIHelper.SKIP, + tax_exempt_reason=APIHelper.SKIP, + parent_id=APIHelper.SKIP, + verified=APIHelper.SKIP, + salesforce_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateCustomer instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if email is not APIHelper.SKIP: - self.email = email + self.email = email if cc_emails is not APIHelper.SKIP: - self.cc_emails = cc_emails + self.cc_emails = cc_emails if organization is not APIHelper.SKIP: - self.organization = organization + self.organization = organization if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if address is not APIHelper.SKIP: - self.address = address + self.address = address if address_2 is not APIHelper.SKIP: - self.address_2 = address_2 + self.address_2 = address_2 if city is not APIHelper.SKIP: - self.city = city + self.city = city if state is not APIHelper.SKIP: - self.state = state + self.state = state if zip is not APIHelper.SKIP: - self.zip = zip + self.zip = zip if country is not APIHelper.SKIP: - self.country = country + self.country = country if phone is not APIHelper.SKIP: - self.phone = phone + self.phone = phone if locale is not APIHelper.SKIP: - self.locale = locale + self.locale = locale if vat_number is not APIHelper.SKIP: - self.vat_number = vat_number + self.vat_number = vat_number if tax_exempt is not APIHelper.SKIP: - self.tax_exempt = tax_exempt + self.tax_exempt = tax_exempt if tax_exempt_reason is not APIHelper.SKIP: - self.tax_exempt_reason = tax_exempt_reason + self.tax_exempt_reason = tax_exempt_reason if parent_id is not APIHelper.SKIP: - self.parent_id = parent_id + self.parent_id = parent_id if verified is not APIHelper.SKIP: - self.verified = verified + self.verified = verified if salesforce_id is not APIHelper.SKIP: - self.salesforce_id = salesforce_id + self.salesforce_id = salesforce_id # Add additional model properties to the instance if additional_properties is None: @@ -167,7 +165,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -178,33 +176,95 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP - cc_emails = dictionary.get("cc_emails") if dictionary.get("cc_emails") else APIHelper.SKIP - organization = dictionary.get("organization") if dictionary.get("organization") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP - address = dictionary.get("address") if dictionary.get("address") else APIHelper.SKIP - address_2 = dictionary.get("address_2") if dictionary.get("address_2") else APIHelper.SKIP - city = dictionary.get("city") if dictionary.get("city") else APIHelper.SKIP - state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP - zip = dictionary.get("zip") if dictionary.get("zip") else APIHelper.SKIP - country = dictionary.get("country") if dictionary.get("country") else APIHelper.SKIP - phone = dictionary.get("phone") if dictionary.get("phone") else APIHelper.SKIP - locale = dictionary.get("locale") if dictionary.get("locale") else APIHelper.SKIP - vat_number = dictionary.get("vat_number") if dictionary.get("vat_number") else APIHelper.SKIP - tax_exempt = dictionary.get("tax_exempt") if "tax_exempt" in dictionary.keys() else APIHelper.SKIP - tax_exempt_reason = dictionary.get("tax_exempt_reason") if dictionary.get("tax_exempt_reason") else APIHelper.SKIP - parent_id = dictionary.get("parent_id") if "parent_id" in dictionary.keys() else APIHelper.SKIP - verified = dictionary.get("verified") if "verified" in dictionary.keys() else APIHelper.SKIP - salesforce_id = dictionary.get("salesforce_id") if "salesforce_id" in dictionary.keys() else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + email =\ + dictionary.get("email")\ + if dictionary.get("email")\ + else APIHelper.SKIP + cc_emails =\ + dictionary.get("cc_emails")\ + if dictionary.get("cc_emails")\ + else APIHelper.SKIP + organization =\ + dictionary.get("organization")\ + if dictionary.get("organization")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + address =\ + dictionary.get("address")\ + if dictionary.get("address")\ + else APIHelper.SKIP + address_2 =\ + dictionary.get("address_2")\ + if dictionary.get("address_2")\ + else APIHelper.SKIP + city =\ + dictionary.get("city")\ + if dictionary.get("city")\ + else APIHelper.SKIP + state =\ + dictionary.get("state")\ + if dictionary.get("state")\ + else APIHelper.SKIP + zip =\ + dictionary.get("zip")\ + if dictionary.get("zip")\ + else APIHelper.SKIP + country =\ + dictionary.get("country")\ + if dictionary.get("country")\ + else APIHelper.SKIP + phone =\ + dictionary.get("phone")\ + if dictionary.get("phone")\ + else APIHelper.SKIP + locale =\ + dictionary.get("locale")\ + if dictionary.get("locale")\ + else APIHelper.SKIP + vat_number =\ + dictionary.get("vat_number")\ + if dictionary.get("vat_number")\ + else APIHelper.SKIP + tax_exempt =\ + dictionary.get("tax_exempt")\ + if "tax_exempt" in dictionary.keys()\ + else APIHelper.SKIP + tax_exempt_reason =\ + dictionary.get("tax_exempt_reason")\ + if dictionary.get("tax_exempt_reason")\ + else APIHelper.SKIP + parent_id =\ + dictionary.get("parent_id")\ + if "parent_id" in dictionary.keys()\ + else APIHelper.SKIP + verified =\ + dictionary.get("verified")\ + if "verified" in dictionary.keys()\ + else APIHelper.SKIP + salesforce_id =\ + dictionary.get("salesforce_id")\ + if "salesforce_id" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -229,49 +289,259 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'email={(self.email if hasattr(self, "email") else None)!r}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!r}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'address={(self.address if hasattr(self, "address") else None)!r}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!r}, ' - f'city={(self.city if hasattr(self, "city") else None)!r}, ' - f'state={(self.state if hasattr(self, "state") else None)!r}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!r}, ' - f'country={(self.country if hasattr(self, "country") else None)!r}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!r}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!r}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!r}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!r}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!r}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!r}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!r}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"email={_email!r}, " + f"cc_emails={_cc_emails!r}, " + f"organization={_organization!r}, " + f"reference={_reference!r}, " + f"address={_address!r}, " + f"address_2={_address_2!r}, " + f"city={_city!r}, " + f"state={_state!r}, " + f"zip={_zip!r}, " + f"country={_country!r}, " + f"phone={_phone!r}, " + f"locale={_locale!r}, " + f"vat_number={_vat_number!r}, " + f"tax_exempt={_tax_exempt!r}, " + f"tax_exempt_reason={_tax_exempt_reason!r}, " + f"parent_id={_parent_id!r}, " + f"verified={_verified!r}, " + f"salesforce_id={_salesforce_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'email={(self.email if hasattr(self, "email") else None)!s}, ' - f'cc_emails={(self.cc_emails if hasattr(self, "cc_emails") else None)!s}, ' - f'organization={(self.organization if hasattr(self, "organization") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'address={(self.address if hasattr(self, "address") else None)!s}, ' - f'address_2={(self.address_2 if hasattr(self, "address_2") else None)!s}, ' - f'city={(self.city if hasattr(self, "city") else None)!s}, ' - f'state={(self.state if hasattr(self, "state") else None)!s}, ' - f'zip={(self.zip if hasattr(self, "zip") else None)!s}, ' - f'country={(self.country if hasattr(self, "country") else None)!s}, ' - f'phone={(self.phone if hasattr(self, "phone") else None)!s}, ' - f'locale={(self.locale if hasattr(self, "locale") else None)!s}, ' - f'vat_number={(self.vat_number if hasattr(self, "vat_number") else None)!s}, ' - f'tax_exempt={(self.tax_exempt if hasattr(self, "tax_exempt") else None)!s}, ' - f'tax_exempt_reason={(self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") else None)!s}, ' - f'parent_id={(self.parent_id if hasattr(self, "parent_id") else None)!s}, ' - f'verified={(self.verified if hasattr(self, "verified") else None)!s}, ' - f'salesforce_id={(self.salesforce_id if hasattr(self, "salesforce_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _email=( + self.email + if hasattr(self, "email") + else None + ) + _cc_emails=( + self.cc_emails + if hasattr(self, "cc_emails") + else None + ) + _organization=( + self.organization + if hasattr(self, "organization") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _address=( + self.address + if hasattr(self, "address") + else None + ) + _address_2=( + self.address_2 + if hasattr(self, "address_2") + else None + ) + _city=( + self.city + if hasattr(self, "city") + else None + ) + _state=( + self.state + if hasattr(self, "state") + else None + ) + _zip=( + self.zip + if hasattr(self, "zip") + else None + ) + _country=( + self.country + if hasattr(self, "country") + else None + ) + _phone=( + self.phone + if hasattr(self, "phone") + else None + ) + _locale=( + self.locale + if hasattr(self, "locale") + else None + ) + _vat_number=( + self.vat_number + if hasattr(self, "vat_number") + else None + ) + _tax_exempt=( + self.tax_exempt + if hasattr(self, "tax_exempt") + else None + ) + _tax_exempt_reason=( + self.tax_exempt_reason + if hasattr(self, "tax_exempt_reason") + else None + ) + _parent_id=( + self.parent_id + if hasattr(self, "parent_id") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _salesforce_id=( + self.salesforce_id + if hasattr(self, "salesforce_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"email={_email!s}, " + f"cc_emails={_cc_emails!s}, " + f"organization={_organization!s}, " + f"reference={_reference!s}, " + f"address={_address!s}, " + f"address_2={_address_2!s}, " + f"city={_city!s}, " + f"state={_state!s}, " + f"zip={_zip!s}, " + f"country={_country!s}, " + f"phone={_phone!s}, " + f"locale={_locale!s}, " + f"vat_number={_vat_number!s}, " + f"tax_exempt={_tax_exempt!s}, " + f"tax_exempt_reason={_tax_exempt_reason!s}, " + f"parent_id={_parent_id!s}, " + f"verified={_verified!s}, " + f"salesforce_id={_salesforce_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_customer_request.py b/advancedbilling/models/update_customer_request.py index 28836ef7..36b5fc9a 100644 --- a/advancedbilling/models/update_customer_request.py +++ b/advancedbilling/models/update_customer_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_customer import UpdateCustomer +# ruff: noqa: E501 +from advancedbilling.models.update_customer import ( + UpdateCustomer, +) -class UpdateCustomerRequest(object): +class UpdateCustomerRequest(object): """Implementation of the 'Update Customer Request' model. Attributes: customer (UpdateCustomer): The model property of type UpdateCustomer. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "customer": 'customer' + "customer": "customer", } - def __init__(self, - customer=None, - additional_properties=None): - """Constructor for the UpdateCustomerRequest class""" - + def __init__( + self, + customer=None, + additional_properties=None): + """Initialize a UpdateCustomerRequest instance.""" # Initialize members of the class - self.customer = customer + self.customer = customer # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - customer = UpdateCustomer.from_dictionary(dictionary.get('customer')) if dictionary.get('customer') else None + customer =\ + UpdateCustomer.from_dictionary( + dictionary.get("customer"))\ + if dictionary.get("customer") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(customer, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'customer={self.customer!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'customer={self.customer!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _customer=self.customer + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"customer={_customer!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_metadata.py b/advancedbilling/models/update_metadata.py index aba9583b..c2da022a 100644 --- a/advancedbilling/models/update_metadata.py +++ b/advancedbilling/models/update_metadata.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdateMetadata(object): - """Implementation of the 'Update Metadata' model. Attributes: current_name (str): The model property of type str. name (str): The model property of type str. value (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "current_name": 'current_name', - "name": 'name', - "value": 'value' + "current_name": "current_name", + "name": "name", + "value": "value", } _optionals = [ - 'current_name', - 'name', - 'value', + "current_name", + "name", + "value", ] - def __init__(self, - current_name=APIHelper.SKIP, - name=APIHelper.SKIP, - value=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateMetadata class""" - + def __init__( + self, + current_name=APIHelper.SKIP, + name=APIHelper.SKIP, + value=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateMetadata instance.""" # Initialize members of the class if current_name is not APIHelper.SKIP: - self.current_name = current_name + self.current_name = current_name if name is not APIHelper.SKIP: - self.name = name + self.name = name if value is not APIHelper.SKIP: - self.value = value + self.value = value # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - current_name = dictionary.get("current_name") if dictionary.get("current_name") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - value = dictionary.get("value") if dictionary.get("value") else APIHelper.SKIP + current_name =\ + dictionary.get("current_name")\ + if dictionary.get("current_name")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + value =\ + dictionary.get("value")\ + if dictionary.get("value")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(current_name, name, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'current_name={(self.current_name if hasattr(self, "current_name") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'value={(self.value if hasattr(self, "value") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _current_name=( + self.current_name + if hasattr(self, "current_name") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_name={_current_name!r}, " + f"name={_name!r}, " + f"value={_value!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'current_name={(self.current_name if hasattr(self, "current_name") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'value={(self.value if hasattr(self, "value") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _current_name=( + self.current_name + if hasattr(self, "current_name") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _value=( + self.value + if hasattr(self, "value") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_name={_current_name!s}, " + f"name={_name!s}, " + f"value={_value!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_metadata_request.py b/advancedbilling/models/update_metadata_request.py index c256748e..634560fa 100644 --- a/advancedbilling/models/update_metadata_request.py +++ b/advancedbilling/models/update_metadata_request.py @@ -1,43 +1,43 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.update_metadata import UpdateMetadata +from advancedbilling.models.update_metadata import ( + UpdateMetadata, +) class UpdateMetadataRequest(object): - """Implementation of the 'Update Metadata Request' model. Attributes: metadata (UpdateMetadata): The model property of type UpdateMetadata. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "metadata": 'metadata' + "metadata": "metadata", } _optionals = [ - 'metadata', + "metadata", ] - def __init__(self, - metadata=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateMetadataRequest class""" - + def __init__( + self, + metadata=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateMetadataRequest instance.""" # Initialize members of the class if metadata is not APIHelper.SKIP: - self.metadata = metadata + self.metadata = metadata # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +47,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +58,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - metadata = UpdateMetadata.from_dictionary(dictionary.get('metadata')) if 'metadata' in dictionary.keys() else APIHelper.SKIP + metadata =\ + UpdateMetadata.from_dictionary( + dictionary.get("metadata"))\ + if "metadata" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(metadata, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'metadata={(self.metadata if hasattr(self, "metadata") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _metadata=( + self.metadata + if hasattr(self, "metadata") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metadata={_metadata!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'metadata={(self.metadata if hasattr(self, "metadata") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _metadata=( + self.metadata + if hasattr(self, "metadata") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metadata={_metadata!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_metafield.py b/advancedbilling/models/update_metafield.py index 51d4a8f8..81bb1a35 100644 --- a/advancedbilling/models/update_metafield.py +++ b/advancedbilling/models/update_metafield.py @@ -1,71 +1,71 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.metafield_scope import MetafieldScope +from advancedbilling.models.metafield_scope import ( + MetafieldScope, +) class UpdateMetafield(object): - """Implementation of the 'Update Metafield' model. Attributes: current_name (str): The model property of type str. name (str): The model property of type str. - scope (MetafieldScope): Warning: When updating a metafield's scope - attribute, all scope attributes must be passed. Partially complete - scope attributes will override the existing settings. + scope (MetafieldScope): Warning: When updating a metafield's scope attribute, + all scope attributes must be passed. Partially complete scope attributes + will override the existing settings. input_type (MetafieldInput): Indicates the type of metafield. A text - metafield allows any string value. Dropdown and radio metafields - have a set of values that can be selected. Defaults to 'text'. + metafield allows any string value. Dropdown and radio metafields have a + set of values that can be selected. Defaults to 'text'. enum (List[str]): Only applicable when input_type is radio or dropdown. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "current_name": 'current_name', - "name": 'name', - "scope": 'scope', - "input_type": 'input_type', - "enum": 'enum' + "current_name": "current_name", + "name": "name", + "scope": "scope", + "input_type": "input_type", + "enum": "enum", } _optionals = [ - 'current_name', - 'name', - 'scope', - 'input_type', - 'enum', + "current_name", + "name", + "scope", + "input_type", + "enum", ] - def __init__(self, - current_name=APIHelper.SKIP, - name=APIHelper.SKIP, - scope=APIHelper.SKIP, - input_type=APIHelper.SKIP, - enum=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateMetafield class""" - + def __init__( + self, + current_name=APIHelper.SKIP, + name=APIHelper.SKIP, + scope=APIHelper.SKIP, + input_type=APIHelper.SKIP, + enum=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateMetafield instance.""" # Initialize members of the class if current_name is not APIHelper.SKIP: - self.current_name = current_name + self.current_name = current_name if name is not APIHelper.SKIP: - self.name = name + self.name = name if scope is not APIHelper.SKIP: - self.scope = scope + self.scope = scope if input_type is not APIHelper.SKIP: - self.input_type = input_type + self.input_type = input_type if enum is not APIHelper.SKIP: - self.enum = enum + self.enum = enum # Add additional model properties to the instance if additional_properties is None: @@ -75,7 +75,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -86,18 +86,36 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - current_name = dictionary.get("current_name") if dictionary.get("current_name") else APIHelper.SKIP - name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP - scope = MetafieldScope.from_dictionary(dictionary.get('scope')) if 'scope' in dictionary.keys() else APIHelper.SKIP - input_type = dictionary.get("input_type") if dictionary.get("input_type") else APIHelper.SKIP - enum = dictionary.get("enum") if dictionary.get("enum") else APIHelper.SKIP + current_name =\ + dictionary.get("current_name")\ + if dictionary.get("current_name")\ + else APIHelper.SKIP + name =\ + dictionary.get("name")\ + if dictionary.get("name")\ + else APIHelper.SKIP + scope =\ + MetafieldScope.from_dictionary( + dictionary.get("scope"))\ + if "scope" in dictionary.keys()\ + else APIHelper.SKIP + input_type =\ + dictionary.get("input_type")\ + if dictionary.get("input_type")\ + else APIHelper.SKIP + enum =\ + dictionary.get("enum")\ + if dictionary.get("enum")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(current_name, name, @@ -108,7 +126,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -119,7 +137,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -129,19 +146,79 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'current_name={(self.current_name if hasattr(self, "current_name") else None)!r}, ' - f'name={(self.name if hasattr(self, "name") else None)!r}, ' - f'scope={(self.scope if hasattr(self, "scope") else None)!r}, ' - f'input_type={(self.input_type if hasattr(self, "input_type") else None)!r}, ' - f'enum={(self.enum if hasattr(self, "enum") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _current_name=( + self.current_name + if hasattr(self, "current_name") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _scope=( + self.scope + if hasattr(self, "scope") + else None + ) + _input_type=( + self.input_type + if hasattr(self, "input_type") + else None + ) + _enum=( + self.enum + if hasattr(self, "enum") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_name={_current_name!r}, " + f"name={_name!r}, " + f"scope={_scope!r}, " + f"input_type={_input_type!r}, " + f"enum={_enum!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'current_name={(self.current_name if hasattr(self, "current_name") else None)!s}, ' - f'name={(self.name if hasattr(self, "name") else None)!s}, ' - f'scope={(self.scope if hasattr(self, "scope") else None)!s}, ' - f'input_type={(self.input_type if hasattr(self, "input_type") else None)!s}, ' - f'enum={(self.enum if hasattr(self, "enum") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _current_name=( + self.current_name + if hasattr(self, "current_name") + else None + ) + _name=( + self.name + if hasattr(self, "name") + else None + ) + _scope=( + self.scope + if hasattr(self, "scope") + else None + ) + _input_type=( + self.input_type + if hasattr(self, "input_type") + else None + ) + _enum=( + self.enum + if hasattr(self, "enum") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"current_name={_current_name!s}, " + f"name={_name!s}, " + f"scope={_scope!s}, " + f"input_type={_input_type!s}, " + f"enum={_enum!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_metafields_request.py b/advancedbilling/models/update_metafields_request.py index ebe1dfbe..7c981f89 100644 --- a/advancedbilling/models/update_metafields_request.py +++ b/advancedbilling/models/update_metafields_request.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdateMetafieldsRequest(object): - """Implementation of the 'Update Metafields Request' model. Attributes: metafields (UpdateMetafield | List[UpdateMetafield] | None): The model property of type UpdateMetafield | List[UpdateMetafield] | None. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "metafields": 'metafields' + "metafields": "metafields", } _optionals = [ - 'metafields', + "metafields", ] - def __init__(self, - metafields=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateMetafieldsRequest class""" - + def __init__( + self, + metafields=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateMetafieldsRequest instance.""" # Initialize members of the class if metafields is not APIHelper.SKIP: - self.metafields = metafields + self.metafields = metafields # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,25 +56,55 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - metafields = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UpdateMetafieldsRequestMetafields'), dictionary.get('metafields'), False) if dictionary.get('metafields') is not None else APIHelper.SKIP + metafields = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateMetafieldsRequestMetafields"), + dictionary.get("metafields"), + False)\ + if dictionary.get("metafields") is not None\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(metafields, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metafields={_metafields!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'metafields={(self.metafields if hasattr(self, "metafields") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _metafields=( + self.metafields + if hasattr(self, "metafields") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"metafields={_metafields!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_payment_profile.py b/advancedbilling/models/update_payment_profile.py index ff8fdb34..55a3679d 100644 --- a/advancedbilling/models/update_payment_profile.py +++ b/advancedbilling/models/update_payment_profile.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdatePaymentProfile(object): - """Implementation of the 'Update Payment Profile' model. Attributes: @@ -18,123 +16,122 @@ class UpdatePaymentProfile(object): last_name (str): The last name of the card holder. full_number (str): The full credit card number card_type (CardType): The type of card used. - expiration_month (str): (Optional when performing an Import via - vault_token, required otherwise) The 1- or 2-digit credit card - expiration month, as an integer or string, i.e. 5 - expiration_year (str): (Optional when performing a Import via - vault_token, required otherwise) The 4-digit credit card - expiration year, as an integer or string, i.e. 2012 - current_vault (AllVaults): The vault that stores the payment profile - with the provided `vault_token`. Use `bogus` for testing. - billing_address (str): The credit card or bank account billing street - address (i.e. 123 Main St.). This value is merely passed through - to the payment gateway. - billing_city (str): The credit card or bank account billing address - city (i.e. “Boston”). This value is merely passed through to the - payment gateway. - billing_state (str): The credit card or bank account billing address - state (i.e. MA). This value is merely passed through to the - payment gateway. This must conform to the - [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes - ) in order to be valid for tax locale purposes. - billing_zip (str): The credit card or bank account billing address zip - code (i.e. 12345). This value is merely passed through to the - payment gateway. + expiration_month (str): (Optional when performing an Import via vault_token, + required otherwise) The 1- or 2-digit credit card expiration month, as an + integer or string, i.e. 5 + expiration_year (str): (Optional when performing a Import via vault_token, + required otherwise) The 4-digit credit card expiration year, as an + integer or string, i.e. 2012 + current_vault (AllVaults): The vault that stores the payment profile with the + provided `vault_token`. Use `bogus` for testing. + billing_address (str): The credit card or bank account billing street address + (i.e. 123 Main St.). This value is merely passed through to the payment + gateway. + billing_city (str): The credit card or bank account billing address city + (i.e. “Boston”). This value is merely passed through to the payment + gateway. + billing_state (str): The credit card or bank account billing address state + (i.e. MA). This value is merely passed through to the payment gateway. + This must conform to the + [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in + order to be valid for tax locale purposes. + billing_zip (str): The credit card or bank account billing address zip code + (i.e. 12345). This value is merely passed through to the payment gateway. billing_country (str): The credit card or bank account billing address country, required in [ISO_3166-1 - alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format - (i.e. “US”). This value is merely passed through to the payment - gateway. Some gateways require country codes in a specific format. - Check your gateway’s documentation. If creating an ACH - subscription, only US is supported at this time. - billing_address_2 (str): Second line of the customer’s billing address - i.e. Apt. 100 - additional_properties (Dict[str, object]): The additional properties - for the model. + alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. + “US”). This value is merely passed through to the payment gateway. Some + gateways require country codes in a specific format. Check your gateway’s + documentation. If creating an ACH subscription, only US is supported at + this time. + billing_address_2 (str): Second line of the customer’s billing address i.e. + Apt. 100 + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "first_name": 'first_name', - "last_name": 'last_name', - "full_number": 'full_number', - "card_type": 'card_type', - "expiration_month": 'expiration_month', - "expiration_year": 'expiration_year', - "current_vault": 'current_vault', - "billing_address": 'billing_address', - "billing_city": 'billing_city', - "billing_state": 'billing_state', - "billing_zip": 'billing_zip', - "billing_country": 'billing_country', - "billing_address_2": 'billing_address_2' + "first_name": "first_name", + "last_name": "last_name", + "full_number": "full_number", + "card_type": "card_type", + "expiration_month": "expiration_month", + "expiration_year": "expiration_year", + "current_vault": "current_vault", + "billing_address": "billing_address", + "billing_city": "billing_city", + "billing_state": "billing_state", + "billing_zip": "billing_zip", + "billing_country": "billing_country", + "billing_address_2": "billing_address_2", } _optionals = [ - 'first_name', - 'last_name', - 'full_number', - 'card_type', - 'expiration_month', - 'expiration_year', - 'current_vault', - 'billing_address', - 'billing_city', - 'billing_state', - 'billing_zip', - 'billing_country', - 'billing_address_2', + "first_name", + "last_name", + "full_number", + "card_type", + "expiration_month", + "expiration_year", + "current_vault", + "billing_address", + "billing_city", + "billing_state", + "billing_zip", + "billing_country", + "billing_address_2", ] _nullables = [ - 'billing_address_2', + "billing_address_2", ] - def __init__(self, - first_name=APIHelper.SKIP, - last_name=APIHelper.SKIP, - full_number=APIHelper.SKIP, - card_type=APIHelper.SKIP, - expiration_month=APIHelper.SKIP, - expiration_year=APIHelper.SKIP, - current_vault=APIHelper.SKIP, - billing_address=APIHelper.SKIP, - billing_city=APIHelper.SKIP, - billing_state=APIHelper.SKIP, - billing_zip=APIHelper.SKIP, - billing_country=APIHelper.SKIP, - billing_address_2=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdatePaymentProfile class""" - + def __init__( + self, + first_name=APIHelper.SKIP, + last_name=APIHelper.SKIP, + full_number=APIHelper.SKIP, + card_type=APIHelper.SKIP, + expiration_month=APIHelper.SKIP, + expiration_year=APIHelper.SKIP, + current_vault=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + billing_city=APIHelper.SKIP, + billing_state=APIHelper.SKIP, + billing_zip=APIHelper.SKIP, + billing_country=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdatePaymentProfile instance.""" # Initialize members of the class if first_name is not APIHelper.SKIP: - self.first_name = first_name + self.first_name = first_name if last_name is not APIHelper.SKIP: - self.last_name = last_name + self.last_name = last_name if full_number is not APIHelper.SKIP: - self.full_number = full_number + self.full_number = full_number if card_type is not APIHelper.SKIP: - self.card_type = card_type + self.card_type = card_type if expiration_month is not APIHelper.SKIP: - self.expiration_month = expiration_month + self.expiration_month = expiration_month if expiration_year is not APIHelper.SKIP: - self.expiration_year = expiration_year + self.expiration_year = expiration_year if current_vault is not APIHelper.SKIP: - self.current_vault = current_vault + self.current_vault = current_vault if billing_address is not APIHelper.SKIP: - self.billing_address = billing_address + self.billing_address = billing_address if billing_city is not APIHelper.SKIP: - self.billing_city = billing_city + self.billing_city = billing_city if billing_state is not APIHelper.SKIP: - self.billing_state = billing_state + self.billing_state = billing_state if billing_zip is not APIHelper.SKIP: - self.billing_zip = billing_zip + self.billing_zip = billing_zip if billing_country is not APIHelper.SKIP: - self.billing_country = billing_country + self.billing_country = billing_country if billing_address_2 is not APIHelper.SKIP: - self.billing_address_2 = billing_address_2 + self.billing_address_2 = billing_address_2 # Add additional model properties to the instance if additional_properties is None: @@ -144,7 +141,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -155,26 +152,67 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP - last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP - full_number = dictionary.get("full_number") if dictionary.get("full_number") else APIHelper.SKIP - card_type = dictionary.get("card_type") if dictionary.get("card_type") else APIHelper.SKIP - expiration_month = dictionary.get("expiration_month") if dictionary.get("expiration_month") else APIHelper.SKIP - expiration_year = dictionary.get("expiration_year") if dictionary.get("expiration_year") else APIHelper.SKIP - current_vault = dictionary.get("current_vault") if dictionary.get("current_vault") else APIHelper.SKIP - billing_address = dictionary.get("billing_address") if dictionary.get("billing_address") else APIHelper.SKIP - billing_city = dictionary.get("billing_city") if dictionary.get("billing_city") else APIHelper.SKIP - billing_state = dictionary.get("billing_state") if dictionary.get("billing_state") else APIHelper.SKIP - billing_zip = dictionary.get("billing_zip") if dictionary.get("billing_zip") else APIHelper.SKIP - billing_country = dictionary.get("billing_country") if dictionary.get("billing_country") else APIHelper.SKIP - billing_address_2 = dictionary.get("billing_address_2") if "billing_address_2" in dictionary.keys() else APIHelper.SKIP + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else APIHelper.SKIP + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else APIHelper.SKIP + full_number =\ + dictionary.get("full_number")\ + if dictionary.get("full_number")\ + else APIHelper.SKIP + card_type =\ + dictionary.get("card_type")\ + if dictionary.get("card_type")\ + else APIHelper.SKIP + expiration_month =\ + dictionary.get("expiration_month")\ + if dictionary.get("expiration_month")\ + else APIHelper.SKIP + expiration_year =\ + dictionary.get("expiration_year")\ + if dictionary.get("expiration_year")\ + else APIHelper.SKIP + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else APIHelper.SKIP + billing_address =\ + dictionary.get("billing_address")\ + if dictionary.get("billing_address")\ + else APIHelper.SKIP + billing_city =\ + dictionary.get("billing_city")\ + if dictionary.get("billing_city")\ + else APIHelper.SKIP + billing_state =\ + dictionary.get("billing_state")\ + if dictionary.get("billing_state")\ + else APIHelper.SKIP + billing_zip =\ + dictionary.get("billing_zip")\ + if dictionary.get("billing_zip")\ + else APIHelper.SKIP + billing_country =\ + dictionary.get("billing_country")\ + if dictionary.get("billing_country")\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if "billing_address_2" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(first_name, last_name, @@ -192,35 +230,175 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!r}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!r}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!r}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!r}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!r}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!r}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!r}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!r}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!r}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!r}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!r}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!r}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"full_number={_full_number!r}, " + f"card_type={_card_type!r}, " + f"expiration_month={_expiration_month!r}, " + f"expiration_year={_expiration_year!r}, " + f"current_vault={_current_vault!r}, " + f"billing_address={_billing_address!r}, " + f"billing_city={_billing_city!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"billing_country={_billing_country!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'first_name={(self.first_name if hasattr(self, "first_name") else None)!s}, ' - f'last_name={(self.last_name if hasattr(self, "last_name") else None)!s}, ' - f'full_number={(self.full_number if hasattr(self, "full_number") else None)!s}, ' - f'card_type={(self.card_type if hasattr(self, "card_type") else None)!s}, ' - f'expiration_month={(self.expiration_month if hasattr(self, "expiration_month") else None)!s}, ' - f'expiration_year={(self.expiration_year if hasattr(self, "expiration_year") else None)!s}, ' - f'current_vault={(self.current_vault if hasattr(self, "current_vault") else None)!s}, ' - f'billing_address={(self.billing_address if hasattr(self, "billing_address") else None)!s}, ' - f'billing_city={(self.billing_city if hasattr(self, "billing_city") else None)!s}, ' - f'billing_state={(self.billing_state if hasattr(self, "billing_state") else None)!s}, ' - f'billing_zip={(self.billing_zip if hasattr(self, "billing_zip") else None)!s}, ' - f'billing_country={(self.billing_country if hasattr(self, "billing_country") else None)!s}, ' - f'billing_address_2={(self.billing_address_2 if hasattr(self, "billing_address_2") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _first_name=( + self.first_name + if hasattr(self, "first_name") + else None + ) + _last_name=( + self.last_name + if hasattr(self, "last_name") + else None + ) + _full_number=( + self.full_number + if hasattr(self, "full_number") + else None + ) + _card_type=( + self.card_type + if hasattr(self, "card_type") + else None + ) + _expiration_month=( + self.expiration_month + if hasattr(self, "expiration_month") + else None + ) + _expiration_year=( + self.expiration_year + if hasattr(self, "expiration_year") + else None + ) + _current_vault=( + self.current_vault + if hasattr(self, "current_vault") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _billing_city=( + self.billing_city + if hasattr(self, "billing_city") + else None + ) + _billing_state=( + self.billing_state + if hasattr(self, "billing_state") + else None + ) + _billing_zip=( + self.billing_zip + if hasattr(self, "billing_zip") + else None + ) + _billing_country=( + self.billing_country + if hasattr(self, "billing_country") + else None + ) + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"full_number={_full_number!s}, " + f"card_type={_card_type!s}, " + f"expiration_month={_expiration_month!s}, " + f"expiration_year={_expiration_year!s}, " + f"current_vault={_current_vault!s}, " + f"billing_address={_billing_address!s}, " + f"billing_city={_billing_city!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"billing_country={_billing_country!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_payment_profile_request.py b/advancedbilling/models/update_payment_profile_request.py index ac8ba88e..76b61440 100644 --- a/advancedbilling/models/update_payment_profile_request.py +++ b/advancedbilling/models/update_payment_profile_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_payment_profile import UpdatePaymentProfile +# ruff: noqa: E501 +from advancedbilling.models.update_payment_profile import ( + UpdatePaymentProfile, +) -class UpdatePaymentProfileRequest(object): +class UpdatePaymentProfileRequest(object): """Implementation of the 'Update Payment Profile Request' model. Attributes: payment_profile (UpdatePaymentProfile): The model property of type UpdatePaymentProfile. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "payment_profile": 'payment_profile' + "payment_profile": "payment_profile", } - def __init__(self, - payment_profile=None, - additional_properties=None): - """Constructor for the UpdatePaymentProfileRequest class""" - + def __init__( + self, + payment_profile=None, + additional_properties=None): + """Initialize a UpdatePaymentProfileRequest instance.""" # Initialize members of the class - self.payment_profile = payment_profile + self.payment_profile = payment_profile # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_profile = UpdatePaymentProfile.from_dictionary(dictionary.get('payment_profile')) if dictionary.get('payment_profile') else None + payment_profile =\ + UpdatePaymentProfile.from_dictionary( + dictionary.get("payment_profile"))\ + if dictionary.get("payment_profile") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(payment_profile, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'payment_profile={self.payment_profile!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _payment_profile=self.payment_profile + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"payment_profile={_payment_profile!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_price.py b/advancedbilling/models/update_price.py index bcecbb71..f5ed51f9 100644 --- a/advancedbilling/models/update_price.py +++ b/advancedbilling/models/update_price.py @@ -1,69 +1,67 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdatePrice(object): - """Implementation of the 'Update Price' model. Attributes: id (int): The model property of type int. - ending_quantity (int | str | None): The model property of type int | - str | None. + ending_quantity (int | str | None): The model property of type int | str | + None. unit_price (float | str | None): The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 destroy (bool): The model property of type bool. - starting_quantity (int | str | None): The model property of type int | - str | None. - additional_properties (Dict[str, object]): The additional properties - for the model. + starting_quantity (int | str | None): The model property of type int | str | + None. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "ending_quantity": 'ending_quantity', - "unit_price": 'unit_price', - "destroy": '_destroy', - "starting_quantity": 'starting_quantity' + "id": "id", + "ending_quantity": "ending_quantity", + "unit_price": "unit_price", + "destroy": "_destroy", + "starting_quantity": "starting_quantity", } _optionals = [ - 'id', - 'ending_quantity', - 'unit_price', - 'destroy', - 'starting_quantity', + "id", + "ending_quantity", + "unit_price", + "destroy", + "starting_quantity", ] - def __init__(self, - id=APIHelper.SKIP, - ending_quantity=APIHelper.SKIP, - unit_price=APIHelper.SKIP, - destroy=APIHelper.SKIP, - starting_quantity=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdatePrice class""" - + def __init__( + self, + id=APIHelper.SKIP, + ending_quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + destroy=APIHelper.SKIP, + starting_quantity=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdatePrice instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if ending_quantity is not APIHelper.SKIP: - self.ending_quantity = ending_quantity + self.ending_quantity = ending_quantity if unit_price is not APIHelper.SKIP: - self.unit_price = unit_price + self.unit_price = unit_price if destroy is not APIHelper.SKIP: - self.destroy = destroy + self.destroy = destroy if starting_quantity is not APIHelper.SKIP: - self.starting_quantity = starting_quantity + self.starting_quantity = starting_quantity # Add additional model properties to the instance if additional_properties is None: @@ -73,7 +71,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -84,19 +82,45 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - ending_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UpdatePriceEndingQuantity'), dictionary.get('ending_quantity'), False) if dictionary.get('ending_quantity') is not None else APIHelper.SKIP - unit_price = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UpdatePriceUnitPrice'), dictionary.get('unit_price'), False) if dictionary.get('unit_price') is not None else APIHelper.SKIP - destroy = dictionary.get("_destroy") if "_destroy" in dictionary.keys() else APIHelper.SKIP - starting_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UpdatePriceStartingQuantity'), dictionary.get('starting_quantity'), False) if dictionary.get('starting_quantity') is not None else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + ending_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdatePriceEndingQuantity"), + dictionary.get("ending_quantity"), + False)\ + if dictionary.get("ending_quantity") is not None\ + else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdatePriceUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else APIHelper.SKIP + destroy =\ + dictionary.get("_destroy")\ + if "_destroy" in dictionary.keys()\ + else APIHelper.SKIP + starting_quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdatePriceStartingQuantity"), + dictionary.get("starting_quantity"), + False)\ + if dictionary.get("starting_quantity") is not None\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, ending_quantity, @@ -106,19 +130,79 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!r}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!r}, ' - f'destroy={(self.destroy if hasattr(self, "destroy") else None)!r}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _destroy=( + self.destroy + if hasattr(self, "destroy") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"ending_quantity={_ending_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"destroy={_destroy!r}, " + f"starting_quantity={_starting_quantity!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'ending_quantity={(self.ending_quantity if hasattr(self, "ending_quantity") else None)!s}, ' - f'unit_price={(self.unit_price if hasattr(self, "unit_price") else None)!s}, ' - f'destroy={(self.destroy if hasattr(self, "destroy") else None)!s}, ' - f'starting_quantity={(self.starting_quantity if hasattr(self, "starting_quantity") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _ending_quantity=( + self.ending_quantity + if hasattr(self, "ending_quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _destroy=( + self.destroy + if hasattr(self, "destroy") + else None + ) + _starting_quantity=( + self.starting_quantity + if hasattr(self, "starting_quantity") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"ending_quantity={_ending_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"destroy={_destroy!s}, " + f"starting_quantity={_starting_quantity!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_product_price_point.py b/advancedbilling/models/update_product_price_point.py index 34b38277..67ea28ea 100644 --- a/advancedbilling/models/update_product_price_point.py +++ b/advancedbilling/models/update_product_price_point.py @@ -1,48 +1,46 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdateProductPricePoint(object): - """Implementation of the 'Update Product Price Point' model. Attributes: handle (str): The model property of type str. price_in_cents (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "handle": 'handle', - "price_in_cents": 'price_in_cents' + "handle": "handle", + "price_in_cents": "price_in_cents", } _optionals = [ - 'handle', - 'price_in_cents', + "handle", + "price_in_cents", ] - def __init__(self, - handle=APIHelper.SKIP, - price_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateProductPricePoint class""" - + def __init__( + self, + handle=APIHelper.SKIP, + price_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateProductPricePoint instance.""" # Initialize members of the class if handle is not APIHelper.SKIP: - self.handle = handle + self.handle = handle if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents + self.price_in_cents = price_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -52,7 +50,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -63,28 +61,66 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - handle = dictionary.get("handle") if dictionary.get("handle") else APIHelper.SKIP - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") else APIHelper.SKIP + handle =\ + dictionary.get("handle")\ + if dictionary.get("handle")\ + else APIHelper.SKIP + price_in_cents =\ + dictionary.get("price_in_cents")\ + if dictionary.get("price_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(handle, price_in_cents, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'handle={(self.handle if hasattr(self, "handle") else None)!r}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"handle={_handle!r}, " + f"price_in_cents={_price_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'handle={(self.handle if hasattr(self, "handle") else None)!s}, ' - f'price_in_cents={(self.price_in_cents if hasattr(self, "price_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _handle=( + self.handle + if hasattr(self, "handle") + else None + ) + _price_in_cents=( + self.price_in_cents + if hasattr(self, "price_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"handle={_handle!s}, " + f"price_in_cents={_price_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_product_price_point_request.py b/advancedbilling/models/update_product_price_point_request.py index ada580c2..9e31e152 100644 --- a/advancedbilling/models/update_product_price_point_request.py +++ b/advancedbilling/models/update_product_price_point_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_product_price_point import UpdateProductPricePoint +# ruff: noqa: E501 +from advancedbilling.models.update_product_price_point import ( + UpdateProductPricePoint, +) -class UpdateProductPricePointRequest(object): +class UpdateProductPricePointRequest(object): """Implementation of the 'Update Product Price Point Request' model. Attributes: price_point (UpdateProductPricePoint): The model property of type UpdateProductPricePoint. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "price_point": 'price_point' + "price_point": "price_point", } - def __init__(self, - price_point=None, - additional_properties=None): - """Constructor for the UpdateProductPricePointRequest class""" - + def __init__( + self, + price_point=None, + additional_properties=None): + """Initialize a UpdateProductPricePointRequest instance.""" # Initialize members of the class - self.price_point = price_point + self.price_point = price_point # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - price_point = UpdateProductPricePoint.from_dictionary(dictionary.get('price_point')) if dictionary.get('price_point') else None + price_point =\ + UpdateProductPricePoint.from_dictionary( + dictionary.get("price_point"))\ + if dictionary.get("price_point") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(price_point, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'price_point={self.price_point!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _price_point=self.price_point + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"price_point={_price_point!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_reason_code.py b/advancedbilling/models/update_reason_code.py index 9983df4f..ba43dfcc 100644 --- a/advancedbilling/models/update_reason_code.py +++ b/advancedbilling/models/update_reason_code.py @@ -1,54 +1,52 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdateReasonCode(object): - """Implementation of the 'Update Reason Code' model. Attributes: code (str): The unique identifier for the ReasonCode description (str): The friendly summary of what the code signifies position (int): The order that code appears in lists - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "code": 'code', - "description": 'description', - "position": 'position' + "code": "code", + "description": "description", + "position": "position", } _optionals = [ - 'code', - 'description', - 'position', + "code", + "description", + "position", ] - def __init__(self, - code=APIHelper.SKIP, - description=APIHelper.SKIP, - position=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateReasonCode class""" - + def __init__( + self, + code=APIHelper.SKIP, + description=APIHelper.SKIP, + position=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateReasonCode instance.""" # Initialize members of the class if code is not APIHelper.SKIP: - self.code = code + self.code = code if description is not APIHelper.SKIP: - self.description = description + self.description = description if position is not APIHelper.SKIP: - self.position = position + self.position = position # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +56,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,16 +67,27 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP - description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - position = dictionary.get("position") if dictionary.get("position") else APIHelper.SKIP + code =\ + dictionary.get("code")\ + if dictionary.get("code")\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + position =\ + dictionary.get("position")\ + if dictionary.get("position")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(code, description, @@ -86,15 +95,55 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'code={(self.code if hasattr(self, "code") else None)!r}, ' - f'description={(self.description if hasattr(self, "description") else None)!r}, ' - f'position={(self.position if hasattr(self, "position") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _position=( + self.position + if hasattr(self, "position") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!r}, " + f"description={_description!r}, " + f"position={_position!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'code={(self.code if hasattr(self, "code") else None)!s}, ' - f'description={(self.description if hasattr(self, "description") else None)!s}, ' - f'position={(self.position if hasattr(self, "position") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _code=( + self.code + if hasattr(self, "code") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _position=( + self.position + if hasattr(self, "position") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"code={_code!s}, " + f"description={_description!s}, " + f"position={_position!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_reason_code_request.py b/advancedbilling/models/update_reason_code_request.py index 0f81cdbc..9848dc17 100644 --- a/advancedbilling/models/update_reason_code_request.py +++ b/advancedbilling/models/update_reason_code_request.py @@ -1,38 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_reason_code import UpdateReasonCode +# ruff: noqa: E501 +from advancedbilling.models.update_reason_code import ( + UpdateReasonCode, +) -class UpdateReasonCodeRequest(object): +class UpdateReasonCodeRequest(object): """Implementation of the 'Update Reason Code Request' model. Attributes: - reason_code (UpdateReasonCode): The model property of type - UpdateReasonCode. - additional_properties (Dict[str, object]): The additional properties - for the model. + reason_code (UpdateReasonCode): The model property of type UpdateReasonCode. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reason_code": 'reason_code' + "reason_code": "reason_code", } - def __init__(self, - reason_code=None, - additional_properties=None): - """Constructor for the UpdateReasonCodeRequest class""" - + def __init__( + self, + reason_code=None, + additional_properties=None): + """Initialize a UpdateReasonCodeRequest instance.""" # Initialize members of the class - self.reason_code = reason_code + self.reason_code = reason_code # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reason_code = UpdateReasonCode.from_dictionary(dictionary.get('reason_code')) if dictionary.get('reason_code') else None + reason_code =\ + UpdateReasonCode.from_dictionary( + dictionary.get("reason_code"))\ + if dictionary.get("reason_code") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reason_code, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reason_code={self.reason_code!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reason_code=self.reason_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason_code={_reason_code!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reason_code={self.reason_code!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reason_code=self.reason_code + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason_code={_reason_code!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_segment.py b/advancedbilling/models/update_segment.py index fe610347..7ee143b8 100644 --- a/advancedbilling/models/update_segment.py +++ b/advancedbilling/models/update_segment.py @@ -1,51 +1,51 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.create_or_update_segment_price import ( + CreateOrUpdateSegmentPrice, +) class UpdateSegment(object): - """Implementation of the 'Update Segment' model. Attributes: - pricing_scheme (PricingScheme): The identifier for the pricing scheme. - See [Product - Components](https://help.chargify.com/products/product-components.h - tml) for an overview of pricing schemes. + pricing_scheme (PricingScheme): The identifier for the pricing scheme. See + [Product + Components](https://help.chargify.com/products/product-components.html) + for an overview of pricing schemes. prices (List[CreateOrUpdateSegmentPrice]): The model property of type List[CreateOrUpdateSegmentPrice]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "pricing_scheme": 'pricing_scheme', - "prices": 'prices' + "pricing_scheme": "pricing_scheme", + "prices": "prices", } _optionals = [ - 'prices', + "prices", ] - def __init__(self, - pricing_scheme=None, - prices=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateSegment class""" - + def __init__( + self, + pricing_scheme=None, + prices=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateSegment instance.""" # Initialize members of the class - self.pricing_scheme = pricing_scheme + self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: - self.prices = prices + self.prices = prices # Add additional model properties to the instance if additional_properties is None: @@ -55,7 +55,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -66,32 +66,62 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - pricing_scheme = dictionary.get("pricing_scheme") if dictionary.get("pricing_scheme") else None + pricing_scheme =\ + dictionary.get("pricing_scheme")\ + if dictionary.get("pricing_scheme")\ + else None prices = None - if dictionary.get('prices') is not None: - prices = [CreateOrUpdateSegmentPrice.from_dictionary(x) for x in dictionary.get('prices')] + if dictionary.get("prices") is not None: + prices = [ + CreateOrUpdateSegmentPrice.from_dictionary(x) + for x in dictionary.get("prices") + ] else: prices = APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(pricing_scheme, prices, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'pricing_scheme={self.pricing_scheme!r}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"pricing_scheme={_pricing_scheme!r}, " + f"prices={_prices!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'pricing_scheme={self.pricing_scheme!s}, ' - f'prices={(self.prices if hasattr(self, "prices") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _pricing_scheme=self.pricing_scheme + _prices=( + self.prices + if hasattr(self, "prices") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"pricing_scheme={_pricing_scheme!s}, " + f"prices={_prices!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_segment_request.py b/advancedbilling/models/update_segment_request.py index ea733ba2..55979a49 100644 --- a/advancedbilling/models/update_segment_request.py +++ b/advancedbilling/models/update_segment_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_segment import UpdateSegment +# ruff: noqa: E501 +from advancedbilling.models.update_segment import ( + UpdateSegment, +) -class UpdateSegmentRequest(object): +class UpdateSegmentRequest(object): """Implementation of the 'Update Segment Request' model. Attributes: segment (UpdateSegment): The model property of type UpdateSegment. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "segment": 'segment' + "segment": "segment", } - def __init__(self, - segment=None, - additional_properties=None): - """Constructor for the UpdateSegmentRequest class""" - + def __init__( + self, + segment=None, + additional_properties=None): + """Initialize a UpdateSegmentRequest instance.""" # Initialize members of the class - self.segment = segment + self.segment = segment # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - segment = UpdateSegment.from_dictionary(dictionary.get('segment')) if dictionary.get('segment') else None + segment =\ + UpdateSegment.from_dictionary( + dictionary.get("segment"))\ + if dictionary.get("segment") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(segment, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'segment={self.segment!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _segment=self.segment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment={_segment!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'segment={self.segment!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _segment=self.segment + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"segment={_segment!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_subscription.py b/advancedbilling/models/update_subscription.py index df3ab622..b7ff722e 100644 --- a/advancedbilling/models/update_subscription.py +++ b/advancedbilling/models/update_subscription.py @@ -1,216 +1,230 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.credit_card_attributes import CreditCardAttributes -from advancedbilling.models.subscription_custom_price import SubscriptionCustomPrice -from advancedbilling.models.update_subscription_component import UpdateSubscriptionComponent +from advancedbilling.models.credit_card_attributes import ( + CreditCardAttributes, +) +from advancedbilling.models.subscription_custom_price import ( + SubscriptionCustomPrice, +) +from advancedbilling.models.update_subscription_component import ( + UpdateSubscriptionComponent, +) class UpdateSubscription(object): - """Implementation of the 'Update Subscription' model. Attributes: - credit_card_attributes (CreditCardAttributes): The model property of - type CreditCardAttributes. - product_handle (str): Set to the handle of a different product to - change the subscription's product + credit_card_attributes (CreditCardAttributes): The model property of type + CreditCardAttributes. + product_handle (str): Set to the handle of a different product to change the + subscription's product product_id (int): Set to the id of a different product to change the subscription's product product_change_delayed (bool): The model property of type bool. - next_product_id (str): Set to an empty string to cancel a delayed - product change. + next_product_id (str): Set to an empty string to cancel a delayed product + change. next_product_price_point_id (str): The model property of type str. - snap_day (int | SnapDay | None): Use for subscriptions with product - eligible for calendar billing only. Value can be 1-28 or 'end'. - initial_billing_at (datetime): (Optional) Set this attribute to a - future date/time to update a subscription in the Awaiting Signup - Date state, to Awaiting Signup. In the Awaiting Signup state, a - subscription behaves like any other. It can be canceled, allocated - to, or have its billing date changed. etc. When the - `initial_billing_at` date hits, the subscription will transition - to the expected state. If the product has a trial, the - subscription will enter a trial, otherwise it will go active. + snap_day (int | SnapDay | None): Use for subscriptions with product eligible + for calendar billing only. Value can be 1-28 or 'end'. + initial_billing_at (datetime): (Optional) Set this attribute to a future + date/time to update a subscription in the Awaiting Signup Date state, to + Awaiting Signup. In the Awaiting Signup state, a subscription behaves + like any other. It can be canceled, allocated to, or have its billing + date changed. etc. When the `initial_billing_at` date hits, the + subscription will transition to the expected state. If the product has a + trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the - initial_billing_at and it fails the subscription will be - immediately canceled. You can omit the initial_billing_at date to - activate the subscription immediately. See the [subscription - import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213- - Advanced-Billing-Subscription-Imports#date-format) documentation - for more information about Date/Time formats. + initial_billing_at and it fails the subscription will be immediately + canceled. You can omit the initial_billing_at date to activate the + subscription immediately. See the [subscription + import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advance + d-Billing-Subscription-Imports#date-format) documentation for more + information about Date/Time formats. defer_signup (bool): (Optional) Set this attribute to true to move the - subscription from Awaiting Signup, to Awaiting Signup Date. Use - this when you want to update a subscription that has an unknown - initial billing date. When the first billing date is known, update - a subscription to set the `initial_billing_at` date. The - subscription moves to the awaiting signup with a scheduled initial - billing date. You can omit the initial_billing_at date to activate - the subscription immediately. See [Subscription - States](https://maxio-chargify.zendesk.com/hc/en-us/articles/540422 - 2005773-Subscription-States) for more information. + subscription from Awaiting Signup, to Awaiting Signup Date. Use this when + you want to update a subscription that has an unknown initial billing + date. When the first billing date is known, update a subscription to set + the `initial_billing_at` date. The subscription moves to the awaiting + signup with a scheduled initial billing date. You can omit the + initial_billing_at date to activate the subscription immediately. See + [Subscription + States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773 + -Subscription-States) for more information. next_billing_at (datetime): The model property of type datetime. expires_at (datetime): Timestamp giving the expiration date of this - subscription (if any). You may manually change the expiration date - at any point during a subscription period. + subscription (if any). You may manually change the expiration date at any + point during a subscription period. payment_collection_method (str): The model property of type str. receives_invoice_emails (bool): The model property of type bool. - net_terms (str | int | None): The model property of type str | int | - None. + net_terms (str | int | None): The model property of type str | int | None. stored_credential_transaction_id (int): The model property of type int. reference (str): The model property of type str. custom_price (SubscriptionCustomPrice): (Optional) Used in place of - `product_price_point_id` to define a custom price point unique to - the subscription + `product_price_point_id` to define a custom price point unique to the + subscription. A subscription can have up to 30 custom price points. + Exceeding this limit will result in an API error. components (List[UpdateSubscriptionComponent]): (Optional) An array of component ids and custom prices to be added to the subscription. dunning_communication_delay_enabled (bool): Enable Communication Delay - feature, making sure no communication (email or SMS) is sent to - the Customer between 9PM and 8AM in time zone set by the + feature, making sure no communication (email or SMS) is sent to the + Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. dunning_communication_delay_time_zone (str): Time zone for the Dunning Communication Delay feature. - product_price_point_id (int): Set to change the current product's - price point. - product_price_point_handle (str): Set to change the current product's - price point. - additional_properties (Dict[str, object]): The additional properties - for the model. + product_price_point_id (int): Set to change the current product's price point. + product_price_point_handle (str): Set to change the current product's price + point. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "credit_card_attributes": 'credit_card_attributes', - "product_handle": 'product_handle', - "product_id": 'product_id', - "product_change_delayed": 'product_change_delayed', - "next_product_id": 'next_product_id', - "next_product_price_point_id": 'next_product_price_point_id', - "snap_day": 'snap_day', - "initial_billing_at": 'initial_billing_at', - "defer_signup": 'defer_signup', - "next_billing_at": 'next_billing_at', - "expires_at": 'expires_at', - "payment_collection_method": 'payment_collection_method', - "receives_invoice_emails": 'receives_invoice_emails', - "net_terms": 'net_terms', - "stored_credential_transaction_id": 'stored_credential_transaction_id', - "reference": 'reference', - "custom_price": 'custom_price', - "components": 'components', - "dunning_communication_delay_enabled": 'dunning_communication_delay_enabled', - "dunning_communication_delay_time_zone": 'dunning_communication_delay_time_zone', - "product_price_point_id": 'product_price_point_id', - "product_price_point_handle": 'product_price_point_handle' + "credit_card_attributes": "credit_card_attributes", + "product_handle": "product_handle", + "product_id": "product_id", + "product_change_delayed": "product_change_delayed", + "next_product_id": "next_product_id", + "next_product_price_point_id": "next_product_price_point_id", + "snap_day": "snap_day", + "initial_billing_at": "initial_billing_at", + "defer_signup": "defer_signup", + "next_billing_at": "next_billing_at", + "expires_at": "expires_at", + "payment_collection_method": "payment_collection_method", + "receives_invoice_emails": "receives_invoice_emails", + "net_terms": "net_terms", + "stored_credential_transaction_id": "stored_credential_transaction_id", + "reference": "reference", + "custom_price": "custom_price", + "components": "components", + "dunning_communication_delay_enabled": "dunning_communication_delay_enabled", + "dunning_communication_delay_time_zone": + "dunning_communication_delay_time_zone", + "product_price_point_id": "product_price_point_id", + "product_price_point_handle": "product_price_point_handle", } _optionals = [ - 'credit_card_attributes', - 'product_handle', - 'product_id', - 'product_change_delayed', - 'next_product_id', - 'next_product_price_point_id', - 'snap_day', - 'initial_billing_at', - 'defer_signup', - 'next_billing_at', - 'expires_at', - 'payment_collection_method', - 'receives_invoice_emails', - 'net_terms', - 'stored_credential_transaction_id', - 'reference', - 'custom_price', - 'components', - 'dunning_communication_delay_enabled', - 'dunning_communication_delay_time_zone', - 'product_price_point_id', - 'product_price_point_handle', + "credit_card_attributes", + "product_handle", + "product_id", + "product_change_delayed", + "next_product_id", + "next_product_price_point_id", + "snap_day", + "initial_billing_at", + "defer_signup", + "next_billing_at", + "expires_at", + "payment_collection_method", + "receives_invoice_emails", + "net_terms", + "stored_credential_transaction_id", + "reference", + "custom_price", + "components", + "dunning_communication_delay_enabled", + "dunning_communication_delay_time_zone", + "product_price_point_id", + "product_price_point_handle", ] _nullables = [ - 'snap_day', - 'dunning_communication_delay_time_zone', + "snap_day", + "dunning_communication_delay_time_zone", ] - def __init__(self, - credit_card_attributes=APIHelper.SKIP, - product_handle=APIHelper.SKIP, - product_id=APIHelper.SKIP, - product_change_delayed=APIHelper.SKIP, - next_product_id=APIHelper.SKIP, - next_product_price_point_id=APIHelper.SKIP, - snap_day=APIHelper.SKIP, - initial_billing_at=APIHelper.SKIP, - defer_signup=False, - next_billing_at=APIHelper.SKIP, - expires_at=APIHelper.SKIP, - payment_collection_method=APIHelper.SKIP, - receives_invoice_emails=APIHelper.SKIP, - net_terms=APIHelper.SKIP, - stored_credential_transaction_id=APIHelper.SKIP, - reference=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - components=APIHelper.SKIP, - dunning_communication_delay_enabled=APIHelper.SKIP, - dunning_communication_delay_time_zone=APIHelper.SKIP, - product_price_point_id=APIHelper.SKIP, - product_price_point_handle=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateSubscription class""" - + def __init__( + self, + credit_card_attributes=APIHelper.SKIP, + product_handle=APIHelper.SKIP, + product_id=APIHelper.SKIP, + product_change_delayed=APIHelper.SKIP, + next_product_id=APIHelper.SKIP, + next_product_price_point_id=APIHelper.SKIP, + snap_day=APIHelper.SKIP, + initial_billing_at=APIHelper.SKIP, + defer_signup=False, + next_billing_at=APIHelper.SKIP, + expires_at=APIHelper.SKIP, + payment_collection_method=APIHelper.SKIP, + receives_invoice_emails=APIHelper.SKIP, + net_terms=APIHelper.SKIP, + stored_credential_transaction_id=APIHelper.SKIP, + reference=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + components=APIHelper.SKIP, + dunning_communication_delay_enabled=APIHelper.SKIP, + dunning_communication_delay_time_zone=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + product_price_point_handle=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateSubscription instance.""" # Initialize members of the class if credit_card_attributes is not APIHelper.SKIP: - self.credit_card_attributes = credit_card_attributes + self.credit_card_attributes = credit_card_attributes if product_handle is not APIHelper.SKIP: - self.product_handle = product_handle + self.product_handle = product_handle if product_id is not APIHelper.SKIP: - self.product_id = product_id + self.product_id = product_id if product_change_delayed is not APIHelper.SKIP: - self.product_change_delayed = product_change_delayed + self.product_change_delayed = product_change_delayed if next_product_id is not APIHelper.SKIP: - self.next_product_id = next_product_id + self.next_product_id = next_product_id if next_product_price_point_id is not APIHelper.SKIP: - self.next_product_price_point_id = next_product_price_point_id + self.next_product_price_point_id = next_product_price_point_id if snap_day is not APIHelper.SKIP: - self.snap_day = snap_day + self.snap_day = snap_day if initial_billing_at is not APIHelper.SKIP: - self.initial_billing_at = APIHelper.apply_datetime_converter(initial_billing_at, APIHelper.RFC3339DateTime) if initial_billing_at else None - self.defer_signup = defer_signup + self.initial_billing_at =\ + APIHelper.apply_datetime_converter( + initial_billing_at, APIHelper.RFC3339DateTime)\ + if initial_billing_at else None + self.defer_signup = defer_signup if next_billing_at is not APIHelper.SKIP: - self.next_billing_at = APIHelper.apply_datetime_converter(next_billing_at, APIHelper.RFC3339DateTime) if next_billing_at else None + self.next_billing_at =\ + APIHelper.apply_datetime_converter( + next_billing_at, APIHelper.RFC3339DateTime)\ + if next_billing_at else None if expires_at is not APIHelper.SKIP: - self.expires_at = APIHelper.apply_datetime_converter(expires_at, APIHelper.RFC3339DateTime) if expires_at else None + self.expires_at =\ + APIHelper.apply_datetime_converter( + expires_at, APIHelper.RFC3339DateTime)\ + if expires_at else None if payment_collection_method is not APIHelper.SKIP: - self.payment_collection_method = payment_collection_method + self.payment_collection_method = payment_collection_method if receives_invoice_emails is not APIHelper.SKIP: - self.receives_invoice_emails = receives_invoice_emails + self.receives_invoice_emails = receives_invoice_emails if net_terms is not APIHelper.SKIP: - self.net_terms = net_terms + self.net_terms = net_terms if stored_credential_transaction_id is not APIHelper.SKIP: - self.stored_credential_transaction_id = stored_credential_transaction_id + self.stored_credential_transaction_id = stored_credential_transaction_id if reference is not APIHelper.SKIP: - self.reference = reference + self.reference = reference if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price if components is not APIHelper.SKIP: - self.components = components + self.components = components if dunning_communication_delay_enabled is not APIHelper.SKIP: - self.dunning_communication_delay_enabled = dunning_communication_delay_enabled + self.dunning_communication_delay_enabled =\ + dunning_communication_delay_enabled if dunning_communication_delay_time_zone is not APIHelper.SKIP: - self.dunning_communication_delay_time_zone = dunning_communication_delay_time_zone + self.dunning_communication_delay_time_zone =\ + dunning_communication_delay_time_zone if product_price_point_id is not APIHelper.SKIP: - self.product_price_point_id = product_price_point_id + self.product_price_point_id = product_price_point_id if product_price_point_handle is not APIHelper.SKIP: - self.product_price_point_handle = product_price_point_handle + self.product_price_point_handle = product_price_point_handle # Add additional model properties to the instance if additional_properties is None: @@ -220,7 +234,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -231,43 +245,117 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - credit_card_attributes = CreditCardAttributes.from_dictionary(dictionary.get('credit_card_attributes')) if 'credit_card_attributes' in dictionary.keys() else APIHelper.SKIP - product_handle = dictionary.get("product_handle") if dictionary.get("product_handle") else APIHelper.SKIP - product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_change_delayed = dictionary.get("product_change_delayed") if "product_change_delayed" in dictionary.keys() else APIHelper.SKIP - next_product_id = dictionary.get("next_product_id") if dictionary.get("next_product_id") else APIHelper.SKIP - next_product_price_point_id = dictionary.get("next_product_price_point_id") if dictionary.get("next_product_price_point_id") else APIHelper.SKIP - if 'snap_day' in dictionary.keys(): - snap_day = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UpdateSubscriptionSnapDay'), dictionary.get('snap_day'), False) if dictionary.get('snap_day') is not None else None + credit_card_attributes =\ + CreditCardAttributes.from_dictionary( + dictionary.get("credit_card_attributes"))\ + if "credit_card_attributes" in dictionary.keys()\ + else APIHelper.SKIP + product_handle =\ + dictionary.get("product_handle")\ + if dictionary.get("product_handle")\ + else APIHelper.SKIP + product_id =\ + dictionary.get("product_id")\ + if dictionary.get("product_id")\ + else APIHelper.SKIP + product_change_delayed =\ + dictionary.get("product_change_delayed")\ + if "product_change_delayed" in dictionary.keys()\ + else APIHelper.SKIP + next_product_id =\ + dictionary.get("next_product_id")\ + if dictionary.get("next_product_id")\ + else APIHelper.SKIP + next_product_price_point_id =\ + dictionary.get("next_product_price_point_id")\ + if dictionary.get("next_product_price_point_id")\ + else APIHelper.SKIP + if "snap_day" in dictionary.keys(): + snap_day = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateSubscriptionSnapDay"), + dictionary.get("snap_day"), + False)\ + if dictionary.get("snap_day") is not None\ + else None else: snap_day = APIHelper.SKIP - initial_billing_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("initial_billing_at")).datetime if dictionary.get("initial_billing_at") else APIHelper.SKIP - defer_signup = dictionary.get("defer_signup") if dictionary.get("defer_signup") else False - next_billing_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_billing_at")).datetime if dictionary.get("next_billing_at") else APIHelper.SKIP - expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else APIHelper.SKIP - payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else APIHelper.SKIP - receives_invoice_emails = dictionary.get("receives_invoice_emails") if "receives_invoice_emails" in dictionary.keys() else APIHelper.SKIP - net_terms = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UpdateSubscriptionNetTerms'), dictionary.get('net_terms'), False) if dictionary.get('net_terms') is not None else APIHelper.SKIP - stored_credential_transaction_id = dictionary.get("stored_credential_transaction_id") if dictionary.get("stored_credential_transaction_id") else APIHelper.SKIP - reference = dictionary.get("reference") if dictionary.get("reference") else APIHelper.SKIP - custom_price = SubscriptionCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP + initial_billing_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("initial_billing_at")).datetime\ + if dictionary.get("initial_billing_at") else APIHelper.SKIP + defer_signup =\ + dictionary.get("defer_signup")\ + if dictionary.get("defer_signup")\ + else False + next_billing_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("next_billing_at")).datetime\ + if dictionary.get("next_billing_at") else APIHelper.SKIP + expires_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("expires_at")).datetime\ + if dictionary.get("expires_at") else APIHelper.SKIP + payment_collection_method =\ + dictionary.get("payment_collection_method")\ + if dictionary.get("payment_collection_method")\ + else APIHelper.SKIP + receives_invoice_emails =\ + dictionary.get("receives_invoice_emails")\ + if "receives_invoice_emails" in dictionary.keys()\ + else APIHelper.SKIP + net_terms = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateSubscriptionNetTerms"), + dictionary.get("net_terms"), + False)\ + if dictionary.get("net_terms") is not None\ + else APIHelper.SKIP + stored_credential_transaction_id =\ + dictionary.get("stored_credential_transaction_id")\ + if dictionary.get("stored_credential_transaction_id")\ + else APIHelper.SKIP + reference =\ + dictionary.get("reference")\ + if dictionary.get("reference")\ + else APIHelper.SKIP + custom_price =\ + SubscriptionCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP components = None - if dictionary.get('components') is not None: - components = [UpdateSubscriptionComponent.from_dictionary(x) for x in dictionary.get('components')] + if dictionary.get("components") is not None: + components = [ + UpdateSubscriptionComponent.from_dictionary(x) + for x in dictionary.get("components") + ] else: components = APIHelper.SKIP - dunning_communication_delay_enabled = dictionary.get("dunning_communication_delay_enabled") if "dunning_communication_delay_enabled" in dictionary.keys() else APIHelper.SKIP - dunning_communication_delay_time_zone = dictionary.get("dunning_communication_delay_time_zone") if "dunning_communication_delay_time_zone" in dictionary.keys() else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP - product_price_point_handle = dictionary.get("product_price_point_handle") if dictionary.get("product_price_point_handle") else APIHelper.SKIP + dunning_communication_delay_enabled =\ + dictionary.get("dunning_communication_delay_enabled")\ + if "dunning_communication_delay_enabled" in dictionary.keys()\ + else APIHelper.SKIP + dunning_communication_delay_time_zone =\ + dictionary.get("dunning_communication_delay_time_zone")\ + if "dunning_communication_delay_time_zone" in dictionary.keys()\ + else APIHelper.SKIP + product_price_point_id =\ + dictionary.get("product_price_point_id")\ + if dictionary.get("product_price_point_id")\ + else APIHelper.SKIP + product_price_point_handle =\ + dictionary.get("product_price_point_handle")\ + if dictionary.get("product_price_point_handle")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(credit_card_attributes, product_handle, @@ -294,53 +382,283 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!r}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!r}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!r}, ' - f'product_change_delayed={(self.product_change_delayed if hasattr(self, "product_change_delayed") else None)!r}, ' - f'next_product_id={(self.next_product_id if hasattr(self, "next_product_id") else None)!r}, ' - f'next_product_price_point_id={(self.next_product_price_point_id if hasattr(self, "next_product_price_point_id") else None)!r}, ' - f'snap_day={(self.snap_day if hasattr(self, "snap_day") else None)!r}, ' - f'initial_billing_at={(self.initial_billing_at if hasattr(self, "initial_billing_at") else None)!r}, ' - f'defer_signup={(self.defer_signup if hasattr(self, "defer_signup") else None)!r}, ' - f'next_billing_at={(self.next_billing_at if hasattr(self, "next_billing_at") else None)!r}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!r}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!r}, ' - f'receives_invoice_emails={(self.receives_invoice_emails if hasattr(self, "receives_invoice_emails") else None)!r}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!r}, ' - f'stored_credential_transaction_id={(self.stored_credential_transaction_id if hasattr(self, "stored_credential_transaction_id") else None)!r}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'components={(self.components if hasattr(self, "components") else None)!r}, ' - f'dunning_communication_delay_enabled={(self.dunning_communication_delay_enabled if hasattr(self, "dunning_communication_delay_enabled") else None)!r}, ' - f'dunning_communication_delay_time_zone={(self.dunning_communication_delay_time_zone if hasattr(self, "dunning_communication_delay_time_zone") else None)!r}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!r}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_change_delayed=( + self.product_change_delayed + if hasattr(self, "product_change_delayed") + else None + ) + _next_product_id=( + self.next_product_id + if hasattr(self, "next_product_id") + else None + ) + _next_product_price_point_id=( + self.next_product_price_point_id + if hasattr(self, "next_product_price_point_id") + else None + ) + _snap_day=( + self.snap_day + if hasattr(self, "snap_day") + else None + ) + _initial_billing_at=( + self.initial_billing_at + if hasattr(self, "initial_billing_at") + else None + ) + _defer_signup=( + self.defer_signup + if hasattr(self, "defer_signup") + else None + ) + _next_billing_at=( + self.next_billing_at + if hasattr(self, "next_billing_at") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _receives_invoice_emails=( + self.receives_invoice_emails + if hasattr(self, "receives_invoice_emails") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _stored_credential_transaction_id=( + self.stored_credential_transaction_id + if hasattr(self, "stored_credential_transaction_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _dunning_communication_delay_enabled=( + self.dunning_communication_delay_enabled + if hasattr(self, "dunning_communication_delay_enabled") + else None + ) + _dunning_communication_delay_time_zone=( + self.dunning_communication_delay_time_zone + if hasattr(self, "dunning_communication_delay_time_zone") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_card_attributes={_credit_card_attributes!r}, " + f"product_handle={_product_handle!r}, " + f"product_id={_product_id!r}, " + f"product_change_delayed={_product_change_delayed!r}, " + f"next_product_id={_next_product_id!r}, " + f"next_product_price_point_id={_next_product_price_point_id!r}, " + f"snap_day={_snap_day!r}, " + f"initial_billing_at={_initial_billing_at!r}, " + f"defer_signup={_defer_signup!r}, " + f"next_billing_at={_next_billing_at!r}, " + f"expires_at={_expires_at!r}, " + f"payment_collection_method={_payment_collection_method!r}, " + f"receives_invoice_emails={_receives_invoice_emails!r}, " + f"net_terms={_net_terms!r}, " + f"stored_credential_transaction_id={_stored_credential_transaction_id!r}, " + f"reference={_reference!r}, " + f"custom_price={_custom_price!r}, " + f"components={_components!r}, " + f"dunning_communication_delay_enabled={_dunning_communication_delay_enabled!r}, " + f"dunning_communication_delay_time_zone={_dunning_communication_delay_time_zone!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"product_price_point_handle={_product_price_point_handle!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'credit_card_attributes={(self.credit_card_attributes if hasattr(self, "credit_card_attributes") else None)!s}, ' - f'product_handle={(self.product_handle if hasattr(self, "product_handle") else None)!s}, ' - f'product_id={(self.product_id if hasattr(self, "product_id") else None)!s}, ' - f'product_change_delayed={(self.product_change_delayed if hasattr(self, "product_change_delayed") else None)!s}, ' - f'next_product_id={(self.next_product_id if hasattr(self, "next_product_id") else None)!s}, ' - f'next_product_price_point_id={(self.next_product_price_point_id if hasattr(self, "next_product_price_point_id") else None)!s}, ' - f'snap_day={(self.snap_day if hasattr(self, "snap_day") else None)!s}, ' - f'initial_billing_at={(self.initial_billing_at if hasattr(self, "initial_billing_at") else None)!s}, ' - f'defer_signup={(self.defer_signup if hasattr(self, "defer_signup") else None)!s}, ' - f'next_billing_at={(self.next_billing_at if hasattr(self, "next_billing_at") else None)!s}, ' - f'expires_at={(self.expires_at if hasattr(self, "expires_at") else None)!s}, ' - f'payment_collection_method={(self.payment_collection_method if hasattr(self, "payment_collection_method") else None)!s}, ' - f'receives_invoice_emails={(self.receives_invoice_emails if hasattr(self, "receives_invoice_emails") else None)!s}, ' - f'net_terms={(self.net_terms if hasattr(self, "net_terms") else None)!s}, ' - f'stored_credential_transaction_id={(self.stored_credential_transaction_id if hasattr(self, "stored_credential_transaction_id") else None)!s}, ' - f'reference={(self.reference if hasattr(self, "reference") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'components={(self.components if hasattr(self, "components") else None)!s}, ' - f'dunning_communication_delay_enabled={(self.dunning_communication_delay_enabled if hasattr(self, "dunning_communication_delay_enabled") else None)!s}, ' - f'dunning_communication_delay_time_zone={(self.dunning_communication_delay_time_zone if hasattr(self, "dunning_communication_delay_time_zone") else None)!s}, ' - f'product_price_point_id={(self.product_price_point_id if hasattr(self, "product_price_point_id") else None)!s}, ' - f'product_price_point_handle={(self.product_price_point_handle if hasattr(self, "product_price_point_handle") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _credit_card_attributes=( + self.credit_card_attributes + if hasattr(self, "credit_card_attributes") + else None + ) + _product_handle=( + self.product_handle + if hasattr(self, "product_handle") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _product_change_delayed=( + self.product_change_delayed + if hasattr(self, "product_change_delayed") + else None + ) + _next_product_id=( + self.next_product_id + if hasattr(self, "next_product_id") + else None + ) + _next_product_price_point_id=( + self.next_product_price_point_id + if hasattr(self, "next_product_price_point_id") + else None + ) + _snap_day=( + self.snap_day + if hasattr(self, "snap_day") + else None + ) + _initial_billing_at=( + self.initial_billing_at + if hasattr(self, "initial_billing_at") + else None + ) + _defer_signup=( + self.defer_signup + if hasattr(self, "defer_signup") + else None + ) + _next_billing_at=( + self.next_billing_at + if hasattr(self, "next_billing_at") + else None + ) + _expires_at=( + self.expires_at + if hasattr(self, "expires_at") + else None + ) + _payment_collection_method=( + self.payment_collection_method + if hasattr(self, "payment_collection_method") + else None + ) + _receives_invoice_emails=( + self.receives_invoice_emails + if hasattr(self, "receives_invoice_emails") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _stored_credential_transaction_id=( + self.stored_credential_transaction_id + if hasattr(self, "stored_credential_transaction_id") + else None + ) + _reference=( + self.reference + if hasattr(self, "reference") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _components=( + self.components + if hasattr(self, "components") + else None + ) + _dunning_communication_delay_enabled=( + self.dunning_communication_delay_enabled + if hasattr(self, "dunning_communication_delay_enabled") + else None + ) + _dunning_communication_delay_time_zone=( + self.dunning_communication_delay_time_zone + if hasattr(self, "dunning_communication_delay_time_zone") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _product_price_point_handle=( + self.product_price_point_handle + if hasattr(self, "product_price_point_handle") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_card_attributes={_credit_card_attributes!s}, " + f"product_handle={_product_handle!s}, " + f"product_id={_product_id!s}, " + f"product_change_delayed={_product_change_delayed!s}, " + f"next_product_id={_next_product_id!s}, " + f"next_product_price_point_id={_next_product_price_point_id!s}, " + f"snap_day={_snap_day!s}, " + f"initial_billing_at={_initial_billing_at!s}, " + f"defer_signup={_defer_signup!s}, " + f"next_billing_at={_next_billing_at!s}, " + f"expires_at={_expires_at!s}, " + f"payment_collection_method={_payment_collection_method!s}, " + f"receives_invoice_emails={_receives_invoice_emails!s}, " + f"net_terms={_net_terms!s}, " + f"stored_credential_transaction_id={_stored_credential_transaction_id!s}, " + f"reference={_reference!s}, " + f"custom_price={_custom_price!s}, " + f"components={_components!s}, " + f"dunning_communication_delay_enabled={_dunning_communication_delay_enabled!s}, " + f"dunning_communication_delay_time_zone={_dunning_communication_delay_time_zone!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"product_price_point_handle={_product_price_point_handle!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_subscription_component.py b/advancedbilling/models/update_subscription_component.py index db6ee9c0..74e86e97 100644 --- a/advancedbilling/models/update_subscription_component.py +++ b/advancedbilling/models/update_subscription_component.py @@ -1,50 +1,50 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.component_custom_price import ( + ComponentCustomPrice, +) class UpdateSubscriptionComponent(object): - """Implementation of the 'Update Subscription Component' model. Attributes: component_id (int): The model property of type int. - custom_price (ComponentCustomPrice): Create or update custom pricing - unique to the subscription. Used in place of `price_point_id`. - additional_properties (Dict[str, object]): The additional properties - for the model. + custom_price (ComponentCustomPrice): Create or update custom pricing unique + to the subscription. Used in place of `price_point_id`. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "component_id": 'component_id', - "custom_price": 'custom_price' + "component_id": "component_id", + "custom_price": "custom_price", } _optionals = [ - 'component_id', - 'custom_price', + "component_id", + "custom_price", ] - def __init__(self, - component_id=APIHelper.SKIP, - custom_price=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateSubscriptionComponent class""" - + def __init__( + self, + component_id=APIHelper.SKIP, + custom_price=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateSubscriptionComponent instance.""" # Initialize members of the class if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if custom_price is not APIHelper.SKIP: - self.custom_price = custom_price + self.custom_price = custom_price # Add additional model properties to the instance if additional_properties is None: @@ -54,7 +54,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -65,15 +65,24 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - custom_price = ComponentCustomPrice.from_dictionary(dictionary.get('custom_price')) if 'custom_price' in dictionary.keys() else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + custom_price =\ + ComponentCustomPrice.from_dictionary( + dictionary.get("custom_price"))\ + if "custom_price" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(component_id, custom_price, @@ -81,7 +90,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -92,7 +101,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -102,13 +110,43 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!r}, " + f"custom_price={_custom_price!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'custom_price={(self.custom_price if hasattr(self, "custom_price") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _custom_price=( + self.custom_price + if hasattr(self, "custom_price") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"component_id={_component_id!s}, " + f"custom_price={_custom_price!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_subscription_group.py b/advancedbilling/models/update_subscription_group.py index 8926bd84..06629976 100644 --- a/advancedbilling/models/update_subscription_group.py +++ b/advancedbilling/models/update_subscription_group.py @@ -1,42 +1,40 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpdateSubscriptionGroup(object): - """Implementation of the 'Update Subscription Group' model. Attributes: member_ids (List[int]): The model property of type List[int]. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "member_ids": 'member_ids' + "member_ids": "member_ids", } _optionals = [ - 'member_ids', + "member_ids", ] - def __init__(self, - member_ids=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpdateSubscriptionGroup class""" - + def __init__( + self, + member_ids=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateSubscriptionGroup instance.""" # Initialize members of the class if member_ids is not APIHelper.SKIP: - self.member_ids = member_ids + self.member_ids = member_ids # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +44,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,24 +55,49 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - member_ids = dictionary.get("member_ids") if dictionary.get("member_ids") else APIHelper.SKIP + member_ids =\ + dictionary.get("member_ids")\ + if dictionary.get("member_ids")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(member_ids, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'member_ids={(self.member_ids if hasattr(self, "member_ids") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _member_ids=( + self.member_ids + if hasattr(self, "member_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"member_ids={_member_ids!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'member_ids={(self.member_ids if hasattr(self, "member_ids") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _member_ids=( + self.member_ids + if hasattr(self, "member_ids") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"member_ids={_member_ids!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_subscription_group_request.py b/advancedbilling/models/update_subscription_group_request.py index fe00640f..21756c3c 100644 --- a/advancedbilling/models/update_subscription_group_request.py +++ b/advancedbilling/models/update_subscription_group_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_subscription_group import UpdateSubscriptionGroup +# ruff: noqa: E501 +from advancedbilling.models.update_subscription_group import ( + UpdateSubscriptionGroup, +) -class UpdateSubscriptionGroupRequest(object): +class UpdateSubscriptionGroupRequest(object): """Implementation of the 'Update Subscription Group Request' model. Attributes: - subscription_group (UpdateSubscriptionGroup): The model property of - type UpdateSubscriptionGroup. - additional_properties (Dict[str, object]): The additional properties - for the model. + subscription_group (UpdateSubscriptionGroup): The model property of type + UpdateSubscriptionGroup. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription_group": 'subscription_group' + "subscription_group": "subscription_group", } - def __init__(self, - subscription_group=None, - additional_properties=None): - """Constructor for the UpdateSubscriptionGroupRequest class""" - + def __init__( + self, + subscription_group=None, + additional_properties=None): + """Initialize a UpdateSubscriptionGroupRequest instance.""" # Initialize members of the class - self.subscription_group = subscription_group + self.subscription_group = subscription_group # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription_group = UpdateSubscriptionGroup.from_dictionary(dictionary.get('subscription_group')) if dictionary.get('subscription_group') else None + subscription_group =\ + UpdateSubscriptionGroup.from_dictionary( + dictionary.get("subscription_group"))\ + if dictionary.get("subscription_group") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription_group, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription_group={self.subscription_group!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription_group=self.subscription_group + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription_group={_subscription_group!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_subscription_note.py b/advancedbilling/models/update_subscription_note.py index 8fc515c0..3d2b8e0d 100644 --- a/advancedbilling/models/update_subscription_note.py +++ b/advancedbilling/models/update_subscription_note.py @@ -1,15 +1,11 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class UpdateSubscriptionNote(object): - """Implementation of the 'Update Subscription Note' model. Updatable fields for Subscription Note @@ -17,26 +13,26 @@ class UpdateSubscriptionNote(object): Attributes: body (str): The model property of type str. sticky (bool): The model property of type bool. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "body": 'body', - "sticky": 'sticky' + "body": "body", + "sticky": "sticky", } - def __init__(self, - body=None, - sticky=None, - additional_properties=None): - """Constructor for the UpdateSubscriptionNote class""" - + def __init__( + self, + body=None, + sticky=None, + additional_properties=None): + """Initialize a UpdateSubscriptionNote instance.""" # Initialize members of the class - self.body = body - self.sticky = sticky + self.body = body + self.sticky = sticky # Add additional model properties to the instance if additional_properties is None: @@ -46,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -57,28 +53,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - body = dictionary.get("body") if dictionary.get("body") else None - sticky = dictionary.get("sticky") if "sticky" in dictionary.keys() else None + body =\ + dictionary.get("body")\ + if dictionary.get("body")\ + else None + sticky =\ + dictionary.get("sticky")\ + if "sticky" in dictionary.keys()\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(body, sticky, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'body={self.body!r}, ' - f'sticky={self.sticky!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _body=self.body + _sticky=self.sticky + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"body={_body!r}, " + f"sticky={_sticky!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'body={self.body!s}, ' - f'sticky={self.sticky!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _body=self.body + _sticky=self.sticky + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"body={_body!s}, " + f"sticky={_sticky!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_subscription_note_request.py b/advancedbilling/models/update_subscription_note_request.py index c7e0ea31..97e009f8 100644 --- a/advancedbilling/models/update_subscription_note_request.py +++ b/advancedbilling/models/update_subscription_note_request.py @@ -1,39 +1,39 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_subscription_note import UpdateSubscriptionNote +# ruff: noqa: E501 +from advancedbilling.models.update_subscription_note import ( + UpdateSubscriptionNote, +) -class UpdateSubscriptionNoteRequest(object): +class UpdateSubscriptionNoteRequest(object): """Implementation of the 'Update Subscription Note Request' model. Updatable fields for Subscription Note Attributes: note (UpdateSubscriptionNote): Updatable fields for Subscription Note - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "note": 'note' + "note": "note", } - def __init__(self, - note=None, - additional_properties=None): - """Constructor for the UpdateSubscriptionNoteRequest class""" - + def __init__( + self, + note=None, + additional_properties=None): + """Initialize a UpdateSubscriptionNoteRequest instance.""" # Initialize members of the class - self.note = note + self.note = note # Add additional model properties to the instance if additional_properties is None: @@ -43,7 +43,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -54,24 +54,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - note = UpdateSubscriptionNote.from_dictionary(dictionary.get('note')) if dictionary.get('note') else None + note =\ + UpdateSubscriptionNote.from_dictionary( + dictionary.get("note"))\ + if dictionary.get("note") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(note, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'note={self.note!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _note=self.note + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"note={_note!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'note={self.note!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _note=self.note + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"note={_note!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_subscription_request.py b/advancedbilling/models/update_subscription_request.py index 02fb45bc..b09ef3c9 100644 --- a/advancedbilling/models/update_subscription_request.py +++ b/advancedbilling/models/update_subscription_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.update_subscription import UpdateSubscription +# ruff: noqa: E501 +from advancedbilling.models.update_subscription import ( + UpdateSubscription, +) -class UpdateSubscriptionRequest(object): +class UpdateSubscriptionRequest(object): """Implementation of the 'Update Subscription Request' model. Attributes: subscription (UpdateSubscription): The model property of type UpdateSubscription. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "subscription": 'subscription' + "subscription": "subscription", } - def __init__(self, - subscription=None, - additional_properties=None): - """Constructor for the UpdateSubscriptionRequest class""" - + def __init__( + self, + subscription=None, + additional_properties=None): + """Initialize a UpdateSubscriptionRequest instance.""" # Initialize members of the class - self.subscription = subscription + self.subscription = subscription # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - subscription = UpdateSubscription.from_dictionary(dictionary.get('subscription')) if dictionary.get('subscription') else None + subscription =\ + UpdateSubscription.from_dictionary( + dictionary.get("subscription"))\ + if dictionary.get("subscription") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(subscription, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'subscription={self.subscription!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _subscription=self.subscription + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"subscription={_subscription!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/upgrade_charge_credit_type.py b/advancedbilling/models/upgrade_charge_credit_type.py new file mode 100644 index 00000000..af33f33d --- /dev/null +++ b/advancedbilling/models/upgrade_charge_credit_type.py @@ -0,0 +1,69 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class UpgradeChargeCreditType(object): + """Implementation of the 'Upgrade Charge Credit Type' enum. + + The type of credit to be created when upgrading/downgrading. Defaults to the + component and then site setting if one is not provided. Values are: + `full` - A charge is added for the full price of the component. + `prorated` - A charge is added for the prorated price of the component change. + `none` - No charge is added. + + Attributes: + FULL: The enum member of type str. + PRORATED: The enum member of type str. + NONE: The enum member of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + _all_values = ["full", "prorated", "none"] + FULL = "full" + + PRORATED = "prorated" + + NONE = "none" + + @classmethod + def validate(cls, value): + """Validate value contains in enum + + Args: + value: the value to be validated + + Returns: + boolean : if value is valid enum values. + + """ + return value in cls._all_values + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/advancedbilling/models/upsert_prepaid_configuration.py b/advancedbilling/models/upsert_prepaid_configuration.py index 861bcfc3..f810b963 100644 --- a/advancedbilling/models/upsert_prepaid_configuration.py +++ b/advancedbilling/models/upsert_prepaid_configuration.py @@ -1,61 +1,59 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class UpsertPrepaidConfiguration(object): - """Implementation of the 'Upsert Prepaid Configuration' model. Attributes: initial_funding_amount_in_cents (int): The model property of type int. replenish_to_amount_in_cents (int): The model property of type int. auto_replenish (bool): The model property of type bool. - replenish_threshold_amount_in_cents (int): The model property of type - int. - additional_properties (Dict[str, object]): The additional properties - for the model. + replenish_threshold_amount_in_cents (int): The model property of type int. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "initial_funding_amount_in_cents": 'initial_funding_amount_in_cents', - "replenish_to_amount_in_cents": 'replenish_to_amount_in_cents', - "auto_replenish": 'auto_replenish', - "replenish_threshold_amount_in_cents": 'replenish_threshold_amount_in_cents' + "initial_funding_amount_in_cents": "initial_funding_amount_in_cents", + "replenish_to_amount_in_cents": "replenish_to_amount_in_cents", + "auto_replenish": "auto_replenish", + "replenish_threshold_amount_in_cents": "replenish_threshold_amount_in_cents", } _optionals = [ - 'initial_funding_amount_in_cents', - 'replenish_to_amount_in_cents', - 'auto_replenish', - 'replenish_threshold_amount_in_cents', + "initial_funding_amount_in_cents", + "replenish_to_amount_in_cents", + "auto_replenish", + "replenish_threshold_amount_in_cents", ] - def __init__(self, - initial_funding_amount_in_cents=APIHelper.SKIP, - replenish_to_amount_in_cents=APIHelper.SKIP, - auto_replenish=APIHelper.SKIP, - replenish_threshold_amount_in_cents=APIHelper.SKIP, - additional_properties=None): - """Constructor for the UpsertPrepaidConfiguration class""" - + def __init__( + self, + initial_funding_amount_in_cents=APIHelper.SKIP, + replenish_to_amount_in_cents=APIHelper.SKIP, + auto_replenish=APIHelper.SKIP, + replenish_threshold_amount_in_cents=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpsertPrepaidConfiguration instance.""" # Initialize members of the class if initial_funding_amount_in_cents is not APIHelper.SKIP: - self.initial_funding_amount_in_cents = initial_funding_amount_in_cents + self.initial_funding_amount_in_cents = initial_funding_amount_in_cents if replenish_to_amount_in_cents is not APIHelper.SKIP: - self.replenish_to_amount_in_cents = replenish_to_amount_in_cents + self.replenish_to_amount_in_cents = replenish_to_amount_in_cents if auto_replenish is not APIHelper.SKIP: - self.auto_replenish = auto_replenish + self.auto_replenish = auto_replenish if replenish_threshold_amount_in_cents is not APIHelper.SKIP: - self.replenish_threshold_amount_in_cents = replenish_threshold_amount_in_cents + self.replenish_threshold_amount_in_cents =\ + replenish_threshold_amount_in_cents # Add additional model properties to the instance if additional_properties is None: @@ -65,7 +63,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -76,17 +74,31 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - initial_funding_amount_in_cents = dictionary.get("initial_funding_amount_in_cents") if dictionary.get("initial_funding_amount_in_cents") else APIHelper.SKIP - replenish_to_amount_in_cents = dictionary.get("replenish_to_amount_in_cents") if dictionary.get("replenish_to_amount_in_cents") else APIHelper.SKIP - auto_replenish = dictionary.get("auto_replenish") if "auto_replenish" in dictionary.keys() else APIHelper.SKIP - replenish_threshold_amount_in_cents = dictionary.get("replenish_threshold_amount_in_cents") if dictionary.get("replenish_threshold_amount_in_cents") else APIHelper.SKIP + initial_funding_amount_in_cents =\ + dictionary.get("initial_funding_amount_in_cents")\ + if dictionary.get("initial_funding_amount_in_cents")\ + else APIHelper.SKIP + replenish_to_amount_in_cents =\ + dictionary.get("replenish_to_amount_in_cents")\ + if dictionary.get("replenish_to_amount_in_cents")\ + else APIHelper.SKIP + auto_replenish =\ + dictionary.get("auto_replenish")\ + if "auto_replenish" in dictionary.keys()\ + else APIHelper.SKIP + replenish_threshold_amount_in_cents =\ + dictionary.get("replenish_threshold_amount_in_cents")\ + if dictionary.get("replenish_threshold_amount_in_cents")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(initial_funding_amount_in_cents, replenish_to_amount_in_cents, @@ -96,7 +108,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -107,7 +119,6 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): return True @@ -117,17 +128,67 @@ def validate(cls, dictionary): return True def __repr__(self): - return (f'{self.__class__.__name__}(' - f'initial_funding_amount_in_cents={(self.initial_funding_amount_in_cents if hasattr(self, "initial_funding_amount_in_cents") else None)!r}, ' - f'replenish_to_amount_in_cents={(self.replenish_to_amount_in_cents if hasattr(self, "replenish_to_amount_in_cents") else None)!r}, ' - f'auto_replenish={(self.auto_replenish if hasattr(self, "auto_replenish") else None)!r}, ' - f'replenish_threshold_amount_in_cents={(self.replenish_threshold_amount_in_cents if hasattr(self, "replenish_threshold_amount_in_cents") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _initial_funding_amount_in_cents=( + self.initial_funding_amount_in_cents + if hasattr(self, "initial_funding_amount_in_cents") + else None + ) + _replenish_to_amount_in_cents=( + self.replenish_to_amount_in_cents + if hasattr(self, "replenish_to_amount_in_cents") + else None + ) + _auto_replenish=( + self.auto_replenish + if hasattr(self, "auto_replenish") + else None + ) + _replenish_threshold_amount_in_cents=( + self.replenish_threshold_amount_in_cents + if hasattr(self, "replenish_threshold_amount_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"initial_funding_amount_in_cents={_initial_funding_amount_in_cents!r}, " + f"replenish_to_amount_in_cents={_replenish_to_amount_in_cents!r}, " + f"auto_replenish={_auto_replenish!r}, " + f"replenish_threshold_amount_in_cents={_replenish_threshold_amount_in_cents!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'initial_funding_amount_in_cents={(self.initial_funding_amount_in_cents if hasattr(self, "initial_funding_amount_in_cents") else None)!s}, ' - f'replenish_to_amount_in_cents={(self.replenish_to_amount_in_cents if hasattr(self, "replenish_to_amount_in_cents") else None)!s}, ' - f'auto_replenish={(self.auto_replenish if hasattr(self, "auto_replenish") else None)!s}, ' - f'replenish_threshold_amount_in_cents={(self.replenish_threshold_amount_in_cents if hasattr(self, "replenish_threshold_amount_in_cents") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _initial_funding_amount_in_cents=( + self.initial_funding_amount_in_cents + if hasattr(self, "initial_funding_amount_in_cents") + else None + ) + _replenish_to_amount_in_cents=( + self.replenish_to_amount_in_cents + if hasattr(self, "replenish_to_amount_in_cents") + else None + ) + _auto_replenish=( + self.auto_replenish + if hasattr(self, "auto_replenish") + else None + ) + _replenish_threshold_amount_in_cents=( + self.replenish_threshold_amount_in_cents + if hasattr(self, "replenish_threshold_amount_in_cents") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"initial_funding_amount_in_cents={_initial_funding_amount_in_cents!s}, " + f"replenish_to_amount_in_cents={_replenish_to_amount_in_cents!s}, " + f"auto_replenish={_auto_replenish!s}, " + f"replenish_threshold_amount_in_cents={_replenish_threshold_amount_in_cents!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/upsert_prepaid_configuration_request.py b/advancedbilling/models/upsert_prepaid_configuration_request.py index 062bae09..34d8c94d 100644 --- a/advancedbilling/models/upsert_prepaid_configuration_request.py +++ b/advancedbilling/models/upsert_prepaid_configuration_request.py @@ -1,38 +1,38 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.upsert_prepaid_configuration import UpsertPrepaidConfiguration +# ruff: noqa: E501 +from advancedbilling.models.upsert_prepaid_configuration import ( + UpsertPrepaidConfiguration, +) -class UpsertPrepaidConfigurationRequest(object): +class UpsertPrepaidConfigurationRequest(object): """Implementation of the 'Upsert Prepaid Configuration Request' model. Attributes: - prepaid_configuration (UpsertPrepaidConfiguration): The model property - of type UpsertPrepaidConfiguration. - additional_properties (Dict[str, object]): The additional properties - for the model. + prepaid_configuration (UpsertPrepaidConfiguration): The model property of + type UpsertPrepaidConfiguration. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "prepaid_configuration": 'prepaid_configuration' + "prepaid_configuration": "prepaid_configuration", } - def __init__(self, - prepaid_configuration=None, - additional_properties=None): - """Constructor for the UpsertPrepaidConfigurationRequest class""" - + def __init__( + self, + prepaid_configuration=None, + additional_properties=None): + """Initialize a UpsertPrepaidConfigurationRequest instance.""" # Initialize members of the class - self.prepaid_configuration = prepaid_configuration + self.prepaid_configuration = prepaid_configuration # Add additional model properties to the instance if additional_properties is None: @@ -42,7 +42,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -53,24 +53,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - prepaid_configuration = UpsertPrepaidConfiguration.from_dictionary(dictionary.get('prepaid_configuration')) if dictionary.get('prepaid_configuration') else None + prepaid_configuration =\ + UpsertPrepaidConfiguration.from_dictionary( + dictionary.get("prepaid_configuration"))\ + if dictionary.get("prepaid_configuration") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(prepaid_configuration, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'prepaid_configuration={self.prepaid_configuration!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _prepaid_configuration=self.prepaid_configuration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepaid_configuration={_prepaid_configuration!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'prepaid_configuration={self.prepaid_configuration!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _prepaid_configuration=self.prepaid_configuration + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"prepaid_configuration={_prepaid_configuration!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/usage.py b/advancedbilling/models/usage.py index 1ac920fb..6822746f 100644 --- a/advancedbilling/models/usage.py +++ b/advancedbilling/models/usage.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Usage(object): - """Implementation of the 'Usage' model. Attributes: @@ -18,78 +16,80 @@ class Usage(object): memo (str): The model property of type str. created_at (datetime): The model property of type datetime. price_point_id (int): The model property of type int. - quantity (int | str | None): The model property of type int | str | - None. + quantity (int | str | None): The model property of type int | str | None. overage_quantity (int): The model property of type int. component_id (int): The model property of type int. component_handle (str): The model property of type str. subscription_id (int): The model property of type int. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "memo": 'memo', - "created_at": 'created_at', - "price_point_id": 'price_point_id', - "quantity": 'quantity', - "overage_quantity": 'overage_quantity', - "component_id": 'component_id', - "component_handle": 'component_handle', - "subscription_id": 'subscription_id' + "id": "id", + "memo": "memo", + "created_at": "created_at", + "price_point_id": "price_point_id", + "quantity": "quantity", + "overage_quantity": "overage_quantity", + "component_id": "component_id", + "component_handle": "component_handle", + "subscription_id": "subscription_id", } _optionals = [ - 'id', - 'memo', - 'created_at', - 'price_point_id', - 'quantity', - 'overage_quantity', - 'component_id', - 'component_handle', - 'subscription_id', + "id", + "memo", + "created_at", + "price_point_id", + "quantity", + "overage_quantity", + "component_id", + "component_handle", + "subscription_id", ] _nullables = [ - 'memo', + "memo", ] - def __init__(self, - id=APIHelper.SKIP, - memo=APIHelper.SKIP, - created_at=APIHelper.SKIP, - price_point_id=APIHelper.SKIP, - quantity=APIHelper.SKIP, - overage_quantity=APIHelper.SKIP, - component_id=APIHelper.SKIP, - component_handle=APIHelper.SKIP, - subscription_id=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Usage class""" - + def __init__( + self, + id=APIHelper.SKIP, + memo=APIHelper.SKIP, + created_at=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + quantity=APIHelper.SKIP, + overage_quantity=APIHelper.SKIP, + component_id=APIHelper.SKIP, + component_handle=APIHelper.SKIP, + subscription_id=APIHelper.SKIP, + additional_properties=None): + """Initialize a Usage instance.""" # Initialize members of the class if id is not APIHelper.SKIP: - self.id = id + self.id = id if memo is not APIHelper.SKIP: - self.memo = memo + self.memo = memo if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if price_point_id is not APIHelper.SKIP: - self.price_point_id = price_point_id + self.price_point_id = price_point_id if quantity is not APIHelper.SKIP: - self.quantity = quantity + self.quantity = quantity if overage_quantity is not APIHelper.SKIP: - self.overage_quantity = overage_quantity + self.overage_quantity = overage_quantity if component_id is not APIHelper.SKIP: - self.component_id = component_id + self.component_id = component_id if component_handle is not APIHelper.SKIP: - self.component_handle = component_handle + self.component_handle = component_handle if subscription_id is not APIHelper.SKIP: - self.subscription_id = subscription_id + self.subscription_id = subscription_id # Add additional model properties to the instance if additional_properties is None: @@ -99,7 +99,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -110,23 +110,56 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP - quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UsageQuantity'), dictionary.get('quantity'), False) if dictionary.get('quantity') is not None else APIHelper.SKIP - overage_quantity = dictionary.get("overage_quantity") if dictionary.get("overage_quantity") else APIHelper.SKIP - component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else APIHelper.SKIP - subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if "memo" in dictionary.keys()\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + price_point_id =\ + dictionary.get("price_point_id")\ + if dictionary.get("price_point_id")\ + else APIHelper.SKIP + quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UsageQuantity"), + dictionary.get("quantity"), + False)\ + if dictionary.get("quantity") is not None\ + else APIHelper.SKIP + overage_quantity =\ + dictionary.get("overage_quantity")\ + if dictionary.get("overage_quantity")\ + else APIHelper.SKIP + component_id =\ + dictionary.get("component_id")\ + if dictionary.get("component_id")\ + else APIHelper.SKIP + component_handle =\ + dictionary.get("component_handle")\ + if dictionary.get("component_handle")\ + else APIHelper.SKIP + subscription_id =\ + dictionary.get("subscription_id")\ + if dictionary.get("subscription_id")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, memo, @@ -140,27 +173,127 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!r}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!r}, ' - f'overage_quantity={(self.overage_quantity if hasattr(self, "overage_quantity") else None)!r}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!r}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!r}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _overage_quantity=( + self.overage_quantity + if hasattr(self, "overage_quantity") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"memo={_memo!r}, " + f"created_at={_created_at!r}, " + f"price_point_id={_price_point_id!r}, " + f"quantity={_quantity!r}, " + f"overage_quantity={_overage_quantity!r}, " + f"component_id={_component_id!r}, " + f"component_handle={_component_handle!r}, " + f"subscription_id={_subscription_id!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'memo={(self.memo if hasattr(self, "memo") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'price_point_id={(self.price_point_id if hasattr(self, "price_point_id") else None)!s}, ' - f'quantity={(self.quantity if hasattr(self, "quantity") else None)!s}, ' - f'overage_quantity={(self.overage_quantity if hasattr(self, "overage_quantity") else None)!s}, ' - f'component_id={(self.component_id if hasattr(self, "component_id") else None)!s}, ' - f'component_handle={(self.component_handle if hasattr(self, "component_handle") else None)!s}, ' - f'subscription_id={(self.subscription_id if hasattr(self, "subscription_id") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _overage_quantity=( + self.overage_quantity + if hasattr(self, "overage_quantity") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _component_handle=( + self.component_handle + if hasattr(self, "component_handle") + else None + ) + _subscription_id=( + self.subscription_id + if hasattr(self, "subscription_id") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"memo={_memo!s}, " + f"created_at={_created_at!s}, " + f"price_point_id={_price_point_id!s}, " + f"quantity={_quantity!s}, " + f"overage_quantity={_overage_quantity!s}, " + f"component_id={_component_id!s}, " + f"component_handle={_component_handle!s}, " + f"subscription_id={_subscription_id!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/usage_response.py b/advancedbilling/models/usage_response.py index d7c3de6e..0e75afdc 100644 --- a/advancedbilling/models/usage_response.py +++ b/advancedbilling/models/usage_response.py @@ -1,37 +1,35 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.models.usage import Usage class UsageResponse(object): - """Implementation of the 'Usage Response' model. Attributes: usage (Usage): The model property of type Usage. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "usage": 'usage' + "usage": "usage", } - def __init__(self, - usage=None, - additional_properties=None): - """Constructor for the UsageResponse class""" - + def __init__( + self, + usage=None, + additional_properties=None): + """Initialize a UsageResponse instance.""" # Initialize members of the class - self.usage = usage + self.usage = usage # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +39,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +50,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - usage = Usage.from_dictionary(dictionary.get('usage')) if dictionary.get('usage') else None + usage =\ + Usage.from_dictionary( + dictionary.get("usage"))\ + if dictionary.get("usage") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(usage, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'usage={self.usage!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _usage=self.usage + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"usage={_usage!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'usage={self.usage!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _usage=self.usage + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"usage={_usage!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/void_invoice.py b/advancedbilling/models/void_invoice.py index 551a8ba0..58111867 100644 --- a/advancedbilling/models/void_invoice.py +++ b/advancedbilling/models/void_invoice.py @@ -1,36 +1,32 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ - +# ruff: noqa: E501 class VoidInvoice(object): - """Implementation of the 'Void Invoice' model. Attributes: reason (str): The model property of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "reason": 'reason' + "reason": "reason", } - def __init__(self, - reason=None, - additional_properties=None): - """Constructor for the VoidInvoice class""" - + def __init__( + self, + reason=None, + additional_properties=None): + """Initialize a VoidInvoice instance.""" # Initialize members of the class - self.reason = reason + self.reason = reason # Add additional model properties to the instance if additional_properties is None: @@ -40,7 +36,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -51,24 +47,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - reason = dictionary.get("reason") if dictionary.get("reason") else None + reason =\ + dictionary.get("reason")\ + if dictionary.get("reason")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(reason, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _reason=self.reason + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'reason={self.reason!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _reason=self.reason + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"reason={_reason!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/void_invoice_event.py b/advancedbilling/models/void_invoice_event.py index 17698162..735aa198 100644 --- a/advancedbilling/models/void_invoice_event.py +++ b/advancedbilling/models/void_invoice_event.py @@ -1,58 +1,61 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType -from advancedbilling.models.void_invoice_event_data import VoidInvoiceEventData +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) +from advancedbilling.models.void_invoice_event_data import ( + VoidInvoiceEventData, +) class VoidInvoiceEvent(object): - """Implementation of the 'Void Invoice Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (VoidInvoiceEventData): Example schema for an - `void_invoice` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (VoidInvoiceEventData): Example schema for an `void_invoice` event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='void_invoice', - event_data=None, - additional_properties=None): - """Constructor for the VoidInvoiceEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="void_invoice", + event_data=None, + additional_properties=None): + """Initialize a VoidInvoiceEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +65,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +76,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'void_invoice' - event_data = VoidInvoiceEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "void_invoice" + event_data =\ + VoidInvoiceEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +114,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +125,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: VoidInvoiceEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + VoidInvoiceEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: VoidInvoiceEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + VoidInvoiceEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/void_invoice_event_data.py b/advancedbilling/models/void_invoice_event_data.py index afe42990..cd19b9e6 100644 --- a/advancedbilling/models/void_invoice_event_data.py +++ b/advancedbilling/models/void_invoice_event_data.py @@ -1,69 +1,71 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.credit_note import ( + CreditNote, +) class VoidInvoiceEventData(object): - """Implementation of the 'Void Invoice Event Data' model. Example schema for an `void_invoice` event Attributes: - credit_note_attributes (CreditNote): The model property of type - CreditNote. + credit_note_attributes (CreditNote): The model property of type CreditNote. memo (str): The memo provided during invoice voiding. applied_amount (str): The amount of the void. - transaction_time (datetime): The time the refund was applied, in ISO - 8601 format, i.e. "2019-06-07T17:20:06Z" + transaction_time (datetime): The time the refund was applied, in ISO 8601 + format, i.e. "2019-06-07T17:20:06Z" is_advance_invoice (bool): If true, the invoice is an advance invoice. reason (str): The reason for the void. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "credit_note_attributes": 'credit_note_attributes', - "memo": 'memo', - "applied_amount": 'applied_amount', - "transaction_time": 'transaction_time', - "is_advance_invoice": 'is_advance_invoice', - "reason": 'reason' + "credit_note_attributes": "credit_note_attributes", + "memo": "memo", + "applied_amount": "applied_amount", + "transaction_time": "transaction_time", + "is_advance_invoice": "is_advance_invoice", + "reason": "reason", } _nullables = [ - 'credit_note_attributes', - 'memo', - 'applied_amount', - 'transaction_time', + "credit_note_attributes", + "memo", + "applied_amount", + "transaction_time", ] - def __init__(self, - credit_note_attributes=None, - memo=None, - applied_amount=None, - transaction_time=None, - is_advance_invoice=None, - reason=None, - additional_properties=None): - """Constructor for the VoidInvoiceEventData class""" - + def __init__( + self, + credit_note_attributes=None, + memo=None, + applied_amount=None, + transaction_time=None, + is_advance_invoice=None, + reason=None, + additional_properties=None): + """Initialize a VoidInvoiceEventData instance.""" # Initialize members of the class - self.credit_note_attributes = credit_note_attributes - self.memo = memo - self.applied_amount = applied_amount - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None - self.is_advance_invoice = is_advance_invoice - self.reason = reason + self.credit_note_attributes = credit_note_attributes + self.memo = memo + self.applied_amount = applied_amount + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None + self.is_advance_invoice = is_advance_invoice + self.reason = reason # Add additional model properties to the instance if additional_properties is None: @@ -73,7 +75,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -84,19 +86,38 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - credit_note_attributes = CreditNote.from_dictionary(dictionary.get('credit_note_attributes')) if dictionary.get('credit_note_attributes') else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else None - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else None - is_advance_invoice = dictionary.get("is_advance_invoice") if "is_advance_invoice" in dictionary.keys() else None - reason = dictionary.get("reason") if dictionary.get("reason") else None + credit_note_attributes =\ + CreditNote.from_dictionary( + dictionary.get("credit_note_attributes"))\ + if dictionary.get("credit_note_attributes") else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else None + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else None + is_advance_invoice =\ + dictionary.get("is_advance_invoice")\ + if "is_advance_invoice" in dictionary.keys()\ + else None + reason =\ + dictionary.get("reason")\ + if dictionary.get("reason")\ + else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(credit_note_attributes, memo, @@ -108,7 +129,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -119,63 +140,138 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.credit_note_attributes, - type_callable=lambda value: CreditNote.validate(value), - is_value_nullable=True, - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.applied_amount, - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.transaction_time, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.is_advance_invoice, - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.reason, - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.credit_note_attributes, + type_callable=lambda value: + CreditNote.validate(value), + is_value_nullable=True, + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.applied_amount, + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.transaction_time, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.is_advance_invoice, + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.reason, + type_callable=lambda value: + isinstance( + value, + str, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('credit_note_attributes'), - type_callable=lambda value: CreditNote.validate(value), - is_value_nullable=True, - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('applied_amount'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('transaction_time'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) \ - and APIHelper.is_valid_type(value=dictionary.get('is_advance_invoice'), - type_callable=lambda value: isinstance(value, bool)) \ - and APIHelper.is_valid_type(value=dictionary.get('reason'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("credit_note_attributes"), + type_callable=lambda value: + CreditNote.validate(value), + is_value_nullable=True, + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("applied_amount"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("transaction_time"), + type_callable=lambda value: + isinstance( + value, + str, + ), + is_value_nullable=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("is_advance_invoice"), + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("reason"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'credit_note_attributes={self.credit_note_attributes!r}, ' - f'memo={self.memo!r}, ' - f'applied_amount={self.applied_amount!r}, ' - f'transaction_time={self.transaction_time!r}, ' - f'is_advance_invoice={self.is_advance_invoice!r}, ' - f'reason={self.reason!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _credit_note_attributes=self.credit_note_attributes + _memo=self.memo + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _is_advance_invoice=self.is_advance_invoice + _reason=self.reason + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_note_attributes={_credit_note_attributes!r}, " + f"memo={_memo!r}, " + f"applied_amount={_applied_amount!r}, " + f"transaction_time={_transaction_time!r}, " + f"is_advance_invoice={_is_advance_invoice!r}, " + f"reason={_reason!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'credit_note_attributes={self.credit_note_attributes!s}, ' - f'memo={self.memo!s}, ' - f'applied_amount={self.applied_amount!s}, ' - f'transaction_time={self.transaction_time!s}, ' - f'is_advance_invoice={self.is_advance_invoice!s}, ' - f'reason={self.reason!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _credit_note_attributes=self.credit_note_attributes + _memo=self.memo + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _is_advance_invoice=self.is_advance_invoice + _reason=self.reason + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_note_attributes={_credit_note_attributes!s}, " + f"memo={_memo!s}, " + f"applied_amount={_applied_amount!s}, " + f"transaction_time={_transaction_time!s}, " + f"is_advance_invoice={_is_advance_invoice!s}, " + f"reason={_reason!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/void_invoice_request.py b/advancedbilling/models/void_invoice_request.py index 56d550e3..b6ac7035 100644 --- a/advancedbilling/models/void_invoice_request.py +++ b/advancedbilling/models/void_invoice_request.py @@ -1,37 +1,37 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ -from advancedbilling.models.void_invoice import VoidInvoice +# ruff: noqa: E501 +from advancedbilling.models.void_invoice import ( + VoidInvoice, +) -class VoidInvoiceRequest(object): +class VoidInvoiceRequest(object): """Implementation of the 'Void Invoice Request' model. Attributes: void (VoidInvoice): The model property of type VoidInvoice. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "void": 'void' + "void": "void", } - def __init__(self, - void=None, - additional_properties=None): - """Constructor for the VoidInvoiceRequest class""" - + def __init__( + self, + void=None, + additional_properties=None): + """Initialize a VoidInvoiceRequest instance.""" # Initialize members of the class - self.void = void + self.void = void # Add additional model properties to the instance if additional_properties is None: @@ -41,7 +41,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -52,24 +52,41 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - void = VoidInvoice.from_dictionary(dictionary.get('void')) if dictionary.get('void') else None + void =\ + VoidInvoice.from_dictionary( + dictionary.get("void"))\ + if dictionary.get("void") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(void, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'void={self.void!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _void=self.void + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"void={_void!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'void={self.void!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _void=self.void + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"void={_void!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/void_remainder_event.py b/advancedbilling/models/void_remainder_event.py index 55a01d88..c2e086e5 100644 --- a/advancedbilling/models/void_remainder_event.py +++ b/advancedbilling/models/void_remainder_event.py @@ -1,58 +1,62 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.invoice import Invoice -from advancedbilling.models.invoice_event_type import InvoiceEventType -from advancedbilling.models.void_remainder_event_data import VoidRemainderEventData +from advancedbilling.models.invoice_event_type import ( + InvoiceEventType, +) +from advancedbilling.models.void_remainder_event_data import ( + VoidRemainderEventData, +) class VoidRemainderEvent(object): - """Implementation of the 'Void Remainder Event' model. Attributes: id (int): The model property of type int. timestamp (datetime): The model property of type datetime. invoice (Invoice): The model property of type Invoice. - event_type (InvoiceEventType): The model property of type - InvoiceEventType. - event_data (VoidRemainderEventData): Example schema for an - `void_remainder` event - additional_properties (Dict[str, object]): The additional properties - for the model. + event_type (InvoiceEventType): The model property of type InvoiceEventType. + event_data (VoidRemainderEventData): Example schema for an `void_remainder` + event + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "id": 'id', - "timestamp": 'timestamp', - "invoice": 'invoice', - "event_type": 'event_type', - "event_data": 'event_data' + "id": "id", + "timestamp": "timestamp", + "invoice": "invoice", + "event_type": "event_type", + "event_data": "event_data", } - def __init__(self, - id=None, - timestamp=None, - invoice=None, - event_type='void_remainder', - event_data=None, - additional_properties=None): - """Constructor for the VoidRemainderEvent class""" - + def __init__( + self, + id=None, + timestamp=None, + invoice=None, + event_type="void_remainder", + event_data=None, + additional_properties=None): + """Initialize a VoidRemainderEvent instance.""" # Initialize members of the class - self.id = id - self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None - self.invoice = invoice - self.event_type = event_type - self.event_data = event_data + self.id = id + self.timestamp =\ + APIHelper.apply_datetime_converter( + timestamp, APIHelper.RFC3339DateTime)\ + if timestamp else None + self.invoice = invoice + self.event_type = event_type + self.event_data = event_data # Add additional model properties to the instance if additional_properties is None: @@ -62,7 +66,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -73,18 +77,34 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else None - timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else None - invoice = Invoice.from_dictionary(dictionary.get('invoice')) if dictionary.get('invoice') else None - event_type = dictionary.get("event_type") if dictionary.get("event_type") else 'void_remainder' - event_data = VoidRemainderEventData.from_dictionary(dictionary.get('event_data')) if dictionary.get('event_data') else None + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else None + timestamp = APIHelper.RFC3339DateTime.from_value( + dictionary.get("timestamp")).datetime\ + if dictionary.get("timestamp") else None + invoice =\ + Invoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + event_type =\ + dictionary.get("event_type")\ + if dictionary.get("event_type")\ + else "void_remainder" + event_data =\ + VoidRemainderEventData.from_dictionary( + dictionary.get("event_data"))\ + if dictionary.get("event_data") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(id, timestamp, @@ -95,7 +115,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -106,51 +126,102 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.timestamp, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.invoice, - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.event_type, - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.event_data, - type_callable=lambda value: VoidRemainderEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.timestamp, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) \ + and APIHelper.is_valid_type( + value=dictionary.invoice, + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.event_type, + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.event_data, + type_callable=lambda value: + VoidRemainderEventData.validate(value), + is_model_dict=True) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('timestamp'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('invoice'), - type_callable=lambda value: Invoice.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('event_type'), - type_callable=lambda value: InvoiceEventType.validate(value)) \ - and APIHelper.is_valid_type(value=dictionary.get('event_data'), - type_callable=lambda value: VoidRemainderEventData.validate(value), - is_model_dict=True) + return APIHelper.is_valid_type( + value=dictionary.get("id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("timestamp"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("invoice"), + type_callable=lambda value: + Invoice.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_type"), + type_callable=lambda value: + InvoiceEventType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("event_data"), + type_callable=lambda value: + VoidRemainderEventData.validate(value), + is_model_dict=True) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!r}, ' - f'timestamp={self.timestamp!r}, ' - f'invoice={self.invoice!r}, ' - f'event_type={self.event_type!r}, ' - f'event_data={self.event_data!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"timestamp={_timestamp!r}, " + f"invoice={_invoice!r}, " + f"event_type={_event_type!r}, " + f"event_data={_event_data!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'id={self.id!s}, ' - f'timestamp={self.timestamp!s}, ' - f'invoice={self.invoice!s}, ' - f'event_type={self.event_type!s}, ' - f'event_data={self.event_data!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _id=self.id + _timestamp=self.timestamp + _invoice=self.invoice + _event_type=self.event_type + _event_data=self.event_data + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"timestamp={_timestamp!s}, " + f"invoice={_invoice!s}, " + f"event_type={_event_type!s}, " + f"event_data={_event_data!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/void_remainder_event_data.py b/advancedbilling/models/void_remainder_event_data.py index c886a64b..a9f5bf8a 100644 --- a/advancedbilling/models/void_remainder_event_data.py +++ b/advancedbilling/models/void_remainder_event_data.py @@ -1,54 +1,56 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper -from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.credit_note import ( + CreditNote, +) class VoidRemainderEventData(object): - """Implementation of the 'Void Remainder Event Data' model. Example schema for an `void_remainder` event Attributes: - credit_note_attributes (CreditNote): The model property of type - CreditNote. + credit_note_attributes (CreditNote): The model property of type CreditNote. memo (str): The memo provided during invoice remainder voiding. applied_amount (str): The amount of the void. - transaction_time (datetime): The time the refund was applied, in ISO - 8601 format, i.e. "2019-06-07T17:20:06Z" - additional_properties (Dict[str, object]): The additional properties - for the model. + transaction_time (datetime): The time the refund was applied, in ISO 8601 + format, i.e. "2019-06-07T17:20:06Z" + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "credit_note_attributes": 'credit_note_attributes', - "memo": 'memo', - "applied_amount": 'applied_amount', - "transaction_time": 'transaction_time' + "credit_note_attributes": "credit_note_attributes", + "memo": "memo", + "applied_amount": "applied_amount", + "transaction_time": "transaction_time", } - def __init__(self, - credit_note_attributes=None, - memo=None, - applied_amount=None, - transaction_time=None, - additional_properties=None): - """Constructor for the VoidRemainderEventData class""" - + def __init__( + self, + credit_note_attributes=None, + memo=None, + applied_amount=None, + transaction_time=None, + additional_properties=None): + """Initialize a VoidRemainderEventData instance.""" # Initialize members of the class - self.credit_note_attributes = credit_note_attributes - self.memo = memo - self.applied_amount = applied_amount - self.transaction_time = APIHelper.apply_datetime_converter(transaction_time, APIHelper.RFC3339DateTime) if transaction_time else None + self.credit_note_attributes = credit_note_attributes + self.memo = memo + self.applied_amount = applied_amount + self.transaction_time =\ + APIHelper.apply_datetime_converter( + transaction_time, APIHelper.RFC3339DateTime)\ + if transaction_time else None # Add additional model properties to the instance if additional_properties is None: @@ -58,7 +60,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -69,17 +71,30 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - credit_note_attributes = CreditNote.from_dictionary(dictionary.get('credit_note_attributes')) if dictionary.get('credit_note_attributes') else None - memo = dictionary.get("memo") if dictionary.get("memo") else None - applied_amount = dictionary.get("applied_amount") if dictionary.get("applied_amount") else None - transaction_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("transaction_time")).datetime if dictionary.get("transaction_time") else None + credit_note_attributes =\ + CreditNote.from_dictionary( + dictionary.get("credit_note_attributes"))\ + if dictionary.get("credit_note_attributes") else None + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else None + applied_amount =\ + dictionary.get("applied_amount")\ + if dictionary.get("applied_amount")\ + else None + transaction_time = APIHelper.RFC3339DateTime.from_value( + dictionary.get("transaction_time")).datetime\ + if dictionary.get("transaction_time") else None + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(credit_note_attributes, memo, @@ -89,7 +104,7 @@ def from_dictionary(cls, @classmethod def validate(cls, dictionary): - """Validates dictionary against class required properties + """Validate dictionary against class required properties Args: dictionary (dictionary): A dictionary representation of the object @@ -100,43 +115,94 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type(value=dictionary.credit_note_attributes, - type_callable=lambda value: CreditNote.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.memo, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.applied_amount, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.transaction_time, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) + return APIHelper.is_valid_type( + value=dictionary.credit_note_attributes, + type_callable=lambda value: + CreditNote.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.memo, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.applied_amount, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.transaction_time, + type_callable=lambda value: + isinstance( + value, + APIHelper.RFC3339DateTime, + )) if not isinstance(dictionary, dict): return False - return APIHelper.is_valid_type(value=dictionary.get('credit_note_attributes'), - type_callable=lambda value: CreditNote.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('memo'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('applied_amount'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('transaction_time'), - type_callable=lambda value: isinstance(value, str)) + return APIHelper.is_valid_type( + value=dictionary.get("credit_note_attributes"), + type_callable=lambda value: + CreditNote.validate(value), + is_model_dict=True) \ + and APIHelper.is_valid_type( + value=dictionary.get("memo"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("applied_amount"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("transaction_time"), + type_callable=lambda value: + isinstance( + value, + str, + )) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'credit_note_attributes={self.credit_note_attributes!r}, ' - f'memo={self.memo!r}, ' - f'applied_amount={self.applied_amount!r}, ' - f'transaction_time={self.transaction_time!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _credit_note_attributes=self.credit_note_attributes + _memo=self.memo + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_note_attributes={_credit_note_attributes!r}, " + f"memo={_memo!r}, " + f"applied_amount={_applied_amount!r}, " + f"transaction_time={_transaction_time!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'credit_note_attributes={self.credit_note_attributes!s}, ' - f'memo={self.memo!s}, ' - f'applied_amount={self.applied_amount!s}, ' - f'transaction_time={self.transaction_time!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _credit_note_attributes=self.credit_note_attributes + _memo=self.memo + _applied_amount=self.applied_amount + _transaction_time=self.transaction_time + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"credit_note_attributes={_credit_note_attributes!s}, " + f"memo={_memo!s}, " + f"applied_amount={_applied_amount!s}, " + f"transaction_time={_transaction_time!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/webhook.py b/advancedbilling/models/webhook.py index e7983b22..8a2671a2 100644 --- a/advancedbilling/models/webhook.py +++ b/advancedbilling/models/webhook.py @@ -1,129 +1,134 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper class Webhook(object): - """Implementation of the 'Webhook' model. Attributes: - event (str): A string describing which event type produced the given - webhook + event (str): A string describing which event type produced the given webhook id (int): The unique identifier for the webhooks (unique across all of - Chargify). This is not changed on a retry/replay of the same - webhook, so it may be used to avoid duplicate action for the same - event. - created_at (datetime): Timestamp indicating when the webhook was - created - last_error (str): Text describing the status code and/or error from - the last failed attempt to send the Webhook. When a webhook is - retried and accepted, this field will be cleared. - last_error_at (datetime): Timestamp indicating when the last - non-acceptance occurred. If a webhook is later resent and + Chargify). This is not changed on a retry/replay of the same webhook, so + it may be used to avoid duplicate action for the same event. + created_at (datetime): Timestamp indicating when the webhook was created + last_error (str): Text describing the status code and/or error from the last + failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared. - accepted_at (datetime): Timestamp indicating when the webhook was - accepted by the merchant endpoint. When a webhook is explicitly - replayed by the merchant, this value will be cleared until it is - accepted again. - last_sent_at (datetime): Timestamp indicating when the most recent - attempt was made to send the webhook + last_error_at (datetime): Timestamp indicating when the last non-acceptance + occurred. If a webhook is later resent and accepted, this field will be + cleared. + accepted_at (datetime): Timestamp indicating when the webhook was accepted by + the merchant endpoint. When a webhook is explicitly replayed by the + merchant, this value will be cleared until it is accepted again. + last_sent_at (datetime): Timestamp indicating when the most recent attempt + was made to send the webhook last_sent_url (str): The url that the endpoint was last sent to. - successful (bool): A boolean flag describing whether the webhook was - accepted by the webhook endpoint for the most recent attempt. - (Acceptance is defined by receiving a “200 OK” HTTP response - within a reasonable timeframe, i.e. 15 seconds) + successful (bool): A boolean flag describing whether the webhook was accepted + by the webhook endpoint for the most recent attempt. (Acceptance is + defined by receiving a “200 OK” HTTP response within a reasonable + timeframe, i.e. 15 seconds) body (str): The data sent within the webhook post signature (str): The calculated webhook signature - signature_hmac_sha_256 (str): The calculated HMAC-SHA-256 webhook - signature - additional_properties (Dict[str, object]): The additional properties - for the model. + signature_hmac_sha_256 (str): The calculated HMAC-SHA-256 webhook signature + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "event": 'event', - "id": 'id', - "created_at": 'created_at', - "last_error": 'last_error', - "last_error_at": 'last_error_at', - "accepted_at": 'accepted_at', - "last_sent_at": 'last_sent_at', - "last_sent_url": 'last_sent_url', - "successful": 'successful', - "body": 'body', - "signature": 'signature', - "signature_hmac_sha_256": 'signature_hmac_sha_256' + "event": "event", + "id": "id", + "created_at": "created_at", + "last_error": "last_error", + "last_error_at": "last_error_at", + "accepted_at": "accepted_at", + "last_sent_at": "last_sent_at", + "last_sent_url": "last_sent_url", + "successful": "successful", + "body": "body", + "signature": "signature", + "signature_hmac_sha_256": "signature_hmac_sha_256", } _optionals = [ - 'event', - 'id', - 'created_at', - 'last_error', - 'last_error_at', - 'accepted_at', - 'last_sent_at', - 'last_sent_url', - 'successful', - 'body', - 'signature', - 'signature_hmac_sha_256', + "event", + "id", + "created_at", + "last_error", + "last_error_at", + "accepted_at", + "last_sent_at", + "last_sent_url", + "successful", + "body", + "signature", + "signature_hmac_sha_256", ] _nullables = [ - 'accepted_at', + "accepted_at", ] - def __init__(self, - event=APIHelper.SKIP, - id=APIHelper.SKIP, - created_at=APIHelper.SKIP, - last_error=APIHelper.SKIP, - last_error_at=APIHelper.SKIP, - accepted_at=APIHelper.SKIP, - last_sent_at=APIHelper.SKIP, - last_sent_url=APIHelper.SKIP, - successful=APIHelper.SKIP, - body=APIHelper.SKIP, - signature=APIHelper.SKIP, - signature_hmac_sha_256=APIHelper.SKIP, - additional_properties=None): - """Constructor for the Webhook class""" - + def __init__( + self, + event=APIHelper.SKIP, + id=APIHelper.SKIP, + created_at=APIHelper.SKIP, + last_error=APIHelper.SKIP, + last_error_at=APIHelper.SKIP, + accepted_at=APIHelper.SKIP, + last_sent_at=APIHelper.SKIP, + last_sent_url=APIHelper.SKIP, + successful=APIHelper.SKIP, + body=APIHelper.SKIP, + signature=APIHelper.SKIP, + signature_hmac_sha_256=APIHelper.SKIP, + additional_properties=None): + """Initialize a Webhook instance.""" # Initialize members of the class if event is not APIHelper.SKIP: - self.event = event + self.event = event if id is not APIHelper.SKIP: - self.id = id + self.id = id if created_at is not APIHelper.SKIP: - self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None + self.created_at =\ + APIHelper.apply_datetime_converter( + created_at, APIHelper.RFC3339DateTime)\ + if created_at else None if last_error is not APIHelper.SKIP: - self.last_error = last_error + self.last_error = last_error if last_error_at is not APIHelper.SKIP: - self.last_error_at = APIHelper.apply_datetime_converter(last_error_at, APIHelper.RFC3339DateTime) if last_error_at else None + self.last_error_at =\ + APIHelper.apply_datetime_converter( + last_error_at, APIHelper.RFC3339DateTime)\ + if last_error_at else None if accepted_at is not APIHelper.SKIP: - self.accepted_at = APIHelper.apply_datetime_converter(accepted_at, APIHelper.RFC3339DateTime) if accepted_at else None + self.accepted_at =\ + APIHelper.apply_datetime_converter( + accepted_at, APIHelper.RFC3339DateTime)\ + if accepted_at else None if last_sent_at is not APIHelper.SKIP: - self.last_sent_at = APIHelper.apply_datetime_converter(last_sent_at, APIHelper.RFC3339DateTime) if last_sent_at else None + self.last_sent_at =\ + APIHelper.apply_datetime_converter( + last_sent_at, APIHelper.RFC3339DateTime)\ + if last_sent_at else None if last_sent_url is not APIHelper.SKIP: - self.last_sent_url = last_sent_url + self.last_sent_url = last_sent_url if successful is not APIHelper.SKIP: - self.successful = successful + self.successful = successful if body is not APIHelper.SKIP: - self.body = body + self.body = body if signature is not APIHelper.SKIP: - self.signature = signature + self.signature = signature if signature_hmac_sha_256 is not APIHelper.SKIP: - self.signature_hmac_sha_256 = signature_hmac_sha_256 + self.signature_hmac_sha_256 = signature_hmac_sha_256 # Add additional model properties to the instance if additional_properties is None: @@ -133,7 +138,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -144,28 +149,63 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - event = dictionary.get("event") if dictionary.get("event") else APIHelper.SKIP - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP - created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP - last_error = dictionary.get("last_error") if dictionary.get("last_error") else APIHelper.SKIP - last_error_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("last_error_at")).datetime if dictionary.get("last_error_at") else APIHelper.SKIP - if 'accepted_at' in dictionary.keys(): - accepted_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("accepted_at")).datetime if dictionary.get("accepted_at") else None + event =\ + dictionary.get("event")\ + if dictionary.get("event")\ + else APIHelper.SKIP + id =\ + dictionary.get("id")\ + if dictionary.get("id")\ + else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("created_at")).datetime\ + if dictionary.get("created_at") else APIHelper.SKIP + last_error =\ + dictionary.get("last_error")\ + if dictionary.get("last_error")\ + else APIHelper.SKIP + last_error_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("last_error_at")).datetime\ + if dictionary.get("last_error_at") else APIHelper.SKIP + if "accepted_at" in dictionary.keys(): + accepted_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("accepted_at")).datetime\ + if dictionary.get("accepted_at") else None + else: accepted_at = APIHelper.SKIP - last_sent_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("last_sent_at")).datetime if dictionary.get("last_sent_at") else APIHelper.SKIP - last_sent_url = dictionary.get("last_sent_url") if dictionary.get("last_sent_url") else APIHelper.SKIP - successful = dictionary.get("successful") if "successful" in dictionary.keys() else APIHelper.SKIP - body = dictionary.get("body") if dictionary.get("body") else APIHelper.SKIP - signature = dictionary.get("signature") if dictionary.get("signature") else APIHelper.SKIP - signature_hmac_sha_256 = dictionary.get("signature_hmac_sha_256") if dictionary.get("signature_hmac_sha_256") else APIHelper.SKIP + last_sent_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("last_sent_at")).datetime\ + if dictionary.get("last_sent_at") else APIHelper.SKIP + last_sent_url =\ + dictionary.get("last_sent_url")\ + if dictionary.get("last_sent_url")\ + else APIHelper.SKIP + successful =\ + dictionary.get("successful")\ + if "successful" in dictionary.keys()\ + else APIHelper.SKIP + body =\ + dictionary.get("body")\ + if dictionary.get("body")\ + else APIHelper.SKIP + signature =\ + dictionary.get("signature")\ + if dictionary.get("signature")\ + else APIHelper.SKIP + signature_hmac_sha_256 =\ + dictionary.get("signature_hmac_sha_256")\ + if dictionary.get("signature_hmac_sha_256")\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(event, id, @@ -182,33 +222,163 @@ def from_dictionary(cls, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'event={(self.event if hasattr(self, "event") else None)!r}, ' - f'id={(self.id if hasattr(self, "id") else None)!r}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!r}, ' - f'last_error={(self.last_error if hasattr(self, "last_error") else None)!r}, ' - f'last_error_at={(self.last_error_at if hasattr(self, "last_error_at") else None)!r}, ' - f'accepted_at={(self.accepted_at if hasattr(self, "accepted_at") else None)!r}, ' - f'last_sent_at={(self.last_sent_at if hasattr(self, "last_sent_at") else None)!r}, ' - f'last_sent_url={(self.last_sent_url if hasattr(self, "last_sent_url") else None)!r}, ' - f'successful={(self.successful if hasattr(self, "successful") else None)!r}, ' - f'body={(self.body if hasattr(self, "body") else None)!r}, ' - f'signature={(self.signature if hasattr(self, "signature") else None)!r}, ' - f'signature_hmac_sha_256={(self.signature_hmac_sha_256 if hasattr(self, "signature_hmac_sha_256") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _event=( + self.event + if hasattr(self, "event") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _last_error=( + self.last_error + if hasattr(self, "last_error") + else None + ) + _last_error_at=( + self.last_error_at + if hasattr(self, "last_error_at") + else None + ) + _accepted_at=( + self.accepted_at + if hasattr(self, "accepted_at") + else None + ) + _last_sent_at=( + self.last_sent_at + if hasattr(self, "last_sent_at") + else None + ) + _last_sent_url=( + self.last_sent_url + if hasattr(self, "last_sent_url") + else None + ) + _successful=( + self.successful + if hasattr(self, "successful") + else None + ) + _body=( + self.body + if hasattr(self, "body") + else None + ) + _signature=( + self.signature + if hasattr(self, "signature") + else None + ) + _signature_hmac_sha_256=( + self.signature_hmac_sha_256 + if hasattr(self, "signature_hmac_sha_256") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event={_event!r}, " + f"id={_id!r}, " + f"created_at={_created_at!r}, " + f"last_error={_last_error!r}, " + f"last_error_at={_last_error_at!r}, " + f"accepted_at={_accepted_at!r}, " + f"last_sent_at={_last_sent_at!r}, " + f"last_sent_url={_last_sent_url!r}, " + f"successful={_successful!r}, " + f"body={_body!r}, " + f"signature={_signature!r}, " + f"signature_hmac_sha_256={_signature_hmac_sha_256!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'event={(self.event if hasattr(self, "event") else None)!s}, ' - f'id={(self.id if hasattr(self, "id") else None)!s}, ' - f'created_at={(self.created_at if hasattr(self, "created_at") else None)!s}, ' - f'last_error={(self.last_error if hasattr(self, "last_error") else None)!s}, ' - f'last_error_at={(self.last_error_at if hasattr(self, "last_error_at") else None)!s}, ' - f'accepted_at={(self.accepted_at if hasattr(self, "accepted_at") else None)!s}, ' - f'last_sent_at={(self.last_sent_at if hasattr(self, "last_sent_at") else None)!s}, ' - f'last_sent_url={(self.last_sent_url if hasattr(self, "last_sent_url") else None)!s}, ' - f'successful={(self.successful if hasattr(self, "successful") else None)!s}, ' - f'body={(self.body if hasattr(self, "body") else None)!s}, ' - f'signature={(self.signature if hasattr(self, "signature") else None)!s}, ' - f'signature_hmac_sha_256={(self.signature_hmac_sha_256 if hasattr(self, "signature_hmac_sha_256") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _event=( + self.event + if hasattr(self, "event") + else None + ) + _id=( + self.id + if hasattr(self, "id") + else None + ) + _created_at=( + self.created_at + if hasattr(self, "created_at") + else None + ) + _last_error=( + self.last_error + if hasattr(self, "last_error") + else None + ) + _last_error_at=( + self.last_error_at + if hasattr(self, "last_error_at") + else None + ) + _accepted_at=( + self.accepted_at + if hasattr(self, "accepted_at") + else None + ) + _last_sent_at=( + self.last_sent_at + if hasattr(self, "last_sent_at") + else None + ) + _last_sent_url=( + self.last_sent_url + if hasattr(self, "last_sent_url") + else None + ) + _successful=( + self.successful + if hasattr(self, "successful") + else None + ) + _body=( + self.body + if hasattr(self, "body") + else None + ) + _signature=( + self.signature + if hasattr(self, "signature") + else None + ) + _signature_hmac_sha_256=( + self.signature_hmac_sha_256 + if hasattr(self, "signature_hmac_sha_256") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"event={_event!s}, " + f"id={_id!s}, " + f"created_at={_created_at!s}, " + f"last_error={_last_error!s}, " + f"last_error_at={_last_error_at!s}, " + f"accepted_at={_accepted_at!s}, " + f"last_sent_at={_last_sent_at!s}, " + f"last_sent_url={_last_sent_url!s}, " + f"successful={_successful!s}, " + f"body={_body!s}, " + f"signature={_signature!s}, " + f"signature_hmac_sha_256={_signature_hmac_sha_256!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/webhook_order.py b/advancedbilling/models/webhook_order.py index 3909d1c5..5488e5bc 100644 --- a/advancedbilling/models/webhook_order.py +++ b/advancedbilling/models/webhook_order.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class WebhookOrder(object): - """Implementation of the 'Webhook Order' enum. Attributes: NEWEST_FIRST: The enum member of type str. OLDEST_FIRST: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - NEWEST_FIRST = 'newest_first' - OLDEST_FIRST = 'oldest_first' + NEWEST_FIRST = "newest_first" + + OLDEST_FIRST = "oldest_first" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/webhook_response.py b/advancedbilling/models/webhook_response.py index cafcf872..2681ec1e 100644 --- a/advancedbilling/models/webhook_response.py +++ b/advancedbilling/models/webhook_response.py @@ -1,43 +1,41 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ + +# ruff: noqa: E501 from advancedbilling.api_helper import APIHelper from advancedbilling.models.webhook import Webhook class WebhookResponse(object): - """Implementation of the 'Webhook Response' model. Attributes: webhook (Webhook): The model property of type Webhook. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ # Create a mapping from Model property names to API property names _names = { - "webhook": 'webhook' + "webhook": "webhook", } _optionals = [ - 'webhook', + "webhook", ] - def __init__(self, - webhook=APIHelper.SKIP, - additional_properties=None): - """Constructor for the WebhookResponse class""" - + def __init__( + self, + webhook=APIHelper.SKIP, + additional_properties=None): + """Initialize a WebhookResponse instance.""" # Initialize members of the class if webhook is not APIHelper.SKIP: - self.webhook = webhook + self.webhook = webhook # Add additional model properties to the instance if additional_properties is None: @@ -47,7 +45,7 @@ def __init__(self, @classmethod def from_dictionary(cls, dictionary): - """Creates an instance of this model from a dictionary + """Create an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object @@ -58,24 +56,50 @@ def from_dictionary(cls, object: An instance of this structure class. """ - if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - webhook = Webhook.from_dictionary(dictionary.get('webhook')) if 'webhook' in dictionary.keys() else APIHelper.SKIP + webhook =\ + Webhook.from_dictionary( + dictionary.get("webhook"))\ + if "webhook" in dictionary.keys()\ + else APIHelper.SKIP + # Clean out expected properties from dictionary - additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + # Return an object of this model return cls(webhook, additional_properties) def __repr__(self): - return (f'{self.__class__.__name__}(' - f'webhook={(self.webhook if hasattr(self, "webhook") else None)!r}, ' - f'additional_properties={self.additional_properties!r})') + """Return a unambiguous string representation.""" + _webhook=( + self.webhook + if hasattr(self, "webhook") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"webhook={_webhook!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) def __str__(self): - return (f'{self.__class__.__name__}(' - f'webhook={(self.webhook if hasattr(self, "webhook") else None)!s}, ' - f'additional_properties={self.additional_properties!s})') + """Return a human-readable string representation.""" + _webhook=( + self.webhook + if hasattr(self, "webhook") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"webhook={_webhook!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/webhook_status.py b/advancedbilling/models/webhook_status.py index 7f4cf448..1522babe 100644 --- a/advancedbilling/models/webhook_status.py +++ b/advancedbilling/models/webhook_status.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class WebhookStatus(object): - """Implementation of the 'Webhook Status' enum. Attributes: @@ -17,20 +14,22 @@ class WebhookStatus(object): FAILED: The enum member of type str. PENDING: The enum member of type str. PAUSED: The enum member of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - SUCCESSFUL = 'successful' - FAILED = 'failed' + SUCCESSFUL = "successful" + + FAILED = "failed" - PENDING = 'pending' + PENDING = "pending" - PAUSED = 'paused' + PAUSED = "paused" @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/models/webhook_subscription.py b/advancedbilling/models/webhook_subscription.py index b562491d..28549335 100644 --- a/advancedbilling/models/webhook_subscription.py +++ b/advancedbilling/models/webhook_subscription.py @@ -1,15 +1,12 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing +"""advanced_billing. This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +# ruff: noqa: E501 class WebhookSubscription(object): - """Implementation of the 'Webhook Subscription' enum. Attributes: @@ -46,86 +43,87 @@ class WebhookSubscription(object): UPGRADE_DOWNGRADE_FAILURE: The enum member of type str. UPGRADE_DOWNGRADE_SUCCESS: The enum member of type str. PENDING_CANCELLATION_CHANGE: The enum member of type str. - SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED: The enum member of - type str. - SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED: The enum member - of type str. - additional_properties (Dict[str, object]): The additional properties - for the model. + SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED: The enum member of type str. + SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED: The enum member of type + str. + additional_properties (Dict[str, object]): The additional properties for the + model. """ - BILLING_DATE_CHANGE = 'billing_date_change' - COMPONENT_ALLOCATION_CHANGE = 'component_allocation_change' + BILLING_DATE_CHANGE = "billing_date_change" + + COMPONENT_ALLOCATION_CHANGE = "component_allocation_change" - CUSTOMER_CREATE = 'customer_create' + CUSTOMER_CREATE = "customer_create" - CUSTOMER_UPDATE = 'customer_update' + CUSTOMER_UPDATE = "customer_update" - DUNNING_STEP_REACHED = 'dunning_step_reached' + DUNNING_STEP_REACHED = "dunning_step_reached" - EXPIRING_CARD = 'expiring_card' + EXPIRING_CARD = "expiring_card" - EXPIRATION_DATE_CHANGE = 'expiration_date_change' + EXPIRATION_DATE_CHANGE = "expiration_date_change" - INVOICE_ISSUED = 'invoice_issued' + INVOICE_ISSUED = "invoice_issued" - METERED_USAGE = 'metered_usage' + METERED_USAGE = "metered_usage" - PAYMENT_FAILURE = 'payment_failure' + PAYMENT_FAILURE = "payment_failure" - PAYMENT_SUCCESS = 'payment_success' + PAYMENT_SUCCESS = "payment_success" - DIRECT_DEBIT_PAYMENT_PENDING = 'direct_debit_payment_pending' + DIRECT_DEBIT_PAYMENT_PENDING = "direct_debit_payment_pending" - DIRECT_DEBIT_PAYMENT_PAID_OUT = 'direct_debit_payment_paid_out' + DIRECT_DEBIT_PAYMENT_PAID_OUT = "direct_debit_payment_paid_out" - DIRECT_DEBIT_PAYMENT_REJECTED = 'direct_debit_payment_rejected' + DIRECT_DEBIT_PAYMENT_REJECTED = "direct_debit_payment_rejected" - PREPAID_SUBSCRIPTION_BALANCE_CHANGED = 'prepaid_subscription_balance_changed' + PREPAID_SUBSCRIPTION_BALANCE_CHANGED = "prepaid_subscription_balance_changed" - PREPAID_USAGE = 'prepaid_usage' + PREPAID_USAGE = "prepaid_usage" - REFUND_FAILURE = 'refund_failure' + REFUND_FAILURE = "refund_failure" - REFUND_SUCCESS = 'refund_success' + REFUND_SUCCESS = "refund_success" - RENEWAL_FAILURE = 'renewal_failure' + RENEWAL_FAILURE = "renewal_failure" - RENEWAL_SUCCESS = 'renewal_success' + RENEWAL_SUCCESS = "renewal_success" - SIGNUP_FAILURE = 'signup_failure' + SIGNUP_FAILURE = "signup_failure" - SIGNUP_SUCCESS = 'signup_success' + SIGNUP_SUCCESS = "signup_success" - STATEMENT_CLOSED = 'statement_closed' + STATEMENT_CLOSED = "statement_closed" - STATEMENT_SETTLED = 'statement_settled' + STATEMENT_SETTLED = "statement_settled" - SUBSCRIPTION_CARD_UPDATE = 'subscription_card_update' + SUBSCRIPTION_CARD_UPDATE = "subscription_card_update" - SUBSCRIPTION_GROUP_CARD_UPDATE = 'subscription_group_card_update' + SUBSCRIPTION_GROUP_CARD_UPDATE = "subscription_group_card_update" - SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change' + SUBSCRIPTION_PRODUCT_CHANGE = "subscription_product_change" - SUBSCRIPTION_STATE_CHANGE = 'subscription_state_change' + SUBSCRIPTION_STATE_CHANGE = "subscription_state_change" - TRIAL_END_NOTICE = 'trial_end_notice' + TRIAL_END_NOTICE = "trial_end_notice" - UPCOMING_RENEWAL_NOTICE = 'upcoming_renewal_notice' + UPCOMING_RENEWAL_NOTICE = "upcoming_renewal_notice" - UPGRADE_DOWNGRADE_FAILURE = 'upgrade_downgrade_failure' + UPGRADE_DOWNGRADE_FAILURE = "upgrade_downgrade_failure" - UPGRADE_DOWNGRADE_SUCCESS = 'upgrade_downgrade_success' + UPGRADE_DOWNGRADE_SUCCESS = "upgrade_downgrade_success" - PENDING_CANCELLATION_CHANGE = 'pending_cancellation_change' + PENDING_CANCELLATION_CHANGE = "pending_cancellation_change" - SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED = 'subscription_prepayment_account_balance_changed' + SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED = "subscription_prepayment_account_balance_changed" # noqa: E501 - SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED = 'subscription_service_credit_account_balance_changed' + SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED = "subscription_service_credit_account_balance_changed" # noqa: E501 @classmethod def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" if value is None: return default diff --git a/advancedbilling/utilities/__init__.py b/advancedbilling/utilities/__init__.py index 3ab66eb8..6f2718e6 100644 --- a/advancedbilling/utilities/__init__.py +++ b/advancedbilling/utilities/__init__.py @@ -1,4 +1,6 @@ +# ruff: noqa: D104 | Missing docstring in public package +# ruff: noqa: RUF022 | `__all__` is not sorted __all__ = [ - 'pagination', - 'file_wrapper', + "file_wrapper", + "pagination", ] diff --git a/advancedbilling/utilities/file_wrapper.py b/advancedbilling/utilities/file_wrapper.py index bbad69a1..8e188b0a 100644 --- a/advancedbilling/utilities/file_wrapper.py +++ b/advancedbilling/utilities/file_wrapper.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """ advanced_billing @@ -13,15 +11,35 @@ class FileWrapper(CoreFileWrapper): """A wrapper to allow passing in content type for file uploads.""" - def __init__(self, file, content_type='application/octet-stream'): + def __init__(self, file, content_type: str="application/octet-stream") -> None: + """Initialize a new `FileWrapper` instance. + + Args: + file: A readable file-like object or byte stream to wrap. + content_type (str, optional): The MIME type to associate with the + file. Defaults to `"application/octet-stream"`. + + """ super().__init__(file, content_type) - def __repr__(self): - return (f'{self.__class__.__name__}(' - f'file={self._file_stream!r}, ' - f'content_type={self.content_type!r})') + def __repr__(self) -> str: + """Return a detailed string representation of the instance. + + Returns: + str: A detailed, unambiguous representation of the wrapper. + + """ + return (f"{self.__class__.__name__}(" + f"file={self._file_stream!r}, " + f"content_type={self.content_type!r})") + + def __str__(self) -> str: + """Return a user-friendly string representation of the instance. + + Returns: + str: A concise, readable representation of the wrapper. - def __str__(self): - return (f'{self.__class__.__name__}(' - f'file={self._file_stream!s}, ' - f'content_type={self.content_type!s})') + """ + return (f"{self.__class__.__name__}(" + f"file={self._file_stream!s}, " + f"content_type={self.content_type!s})") diff --git a/advancedbilling/utilities/union_type_lookup.py b/advancedbilling/utilities/union_type_lookup.py index cb31cfde..06a6df35 100644 --- a/advancedbilling/utilities/union_type_lookup.py +++ b/advancedbilling/utilities/union_type_lookup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ advanced_billing @@ -7,628 +6,776 @@ https://www.apimatic.io ). """ -from advancedbilling.models.apple_pay_payment_profile import ApplePayPaymentProfile -from advancedbilling.models.apply_credit_note_event import ApplyCreditNoteEvent -from advancedbilling.models.apply_debit_note_event import ApplyDebitNoteEvent -from advancedbilling.models.apply_payment_event import ApplyPaymentEvent -from advancedbilling.models.backport_invoice_event import BackportInvoiceEvent -from advancedbilling.models.bank_account_payment_profile import BankAccountPaymentProfile -from advancedbilling.models.change_chargeback_status_event import ChangeChargebackStatusEvent -from advancedbilling.models.change_invoice_collection_method_event import ChangeInvoiceCollectionMethodEvent -from advancedbilling.models.change_invoice_status_event import ChangeInvoiceStatusEvent -from advancedbilling.models.component_allocation_change import ComponentAllocationChange -from advancedbilling.models.create_component_price_point import CreateComponentPricePoint -from advancedbilling.models.create_credit_note_event import CreateCreditNoteEvent -from advancedbilling.models.create_debit_note_event import CreateDebitNoteEvent -from advancedbilling.models.create_metafield import CreateMetafield -from advancedbilling.models.create_prepaid_usage_component_price_point import CreatePrepaidUsageComponentPricePoint -from advancedbilling.models.credit_account_balance_changed import CreditAccountBalanceChanged -from advancedbilling.models.credit_card_payment_profile import CreditCardPaymentProfile -from advancedbilling.models.custom_field_value_change import CustomFieldValueChange -from advancedbilling.models.customer_error import CustomerError -from advancedbilling.models.dunning_step_reached import DunningStepReached -from advancedbilling.models.failed_payment_event import FailedPaymentEvent -from advancedbilling.models.invoice_issued import InvoiceIssued -from advancedbilling.models.issue_invoice_event import IssueInvoiceEvent -from advancedbilling.models.item_price_point_changed import ItemPricePointChanged -from advancedbilling.models.metered_usage import MeteredUsage -from advancedbilling.models.payment_collection_method_changed import PaymentCollectionMethodChanged -from advancedbilling.models.payment_method_apple_pay import PaymentMethodApplePay -from advancedbilling.models.payment_method_bank_account import PaymentMethodBankAccount -from advancedbilling.models.payment_method_credit_card import PaymentMethodCreditCard -from advancedbilling.models.payment_method_external import PaymentMethodExternal -from advancedbilling.models.payment_method_paypal import PaymentMethodPaypal -from advancedbilling.models.payment_related_events import PaymentRelatedEvents -from advancedbilling.models.paypal_payment_profile import PaypalPaymentProfile -from advancedbilling.models.pending_cancellation_change import PendingCancellationChange -from advancedbilling.models.prepaid_subscription_balance_changed import PrepaidSubscriptionBalanceChanged -from advancedbilling.models.prepaid_usage import PrepaidUsage -from advancedbilling.models.prepayment_account_balance_changed import PrepaymentAccountBalanceChanged -from advancedbilling.models.proforma_invoice_issued import ProformaInvoiceIssued -from advancedbilling.models.refund_consolidated_invoice import RefundConsolidatedInvoice -from advancedbilling.models.refund_invoice import RefundInvoice -from advancedbilling.models.refund_invoice_event import RefundInvoiceEvent -from advancedbilling.models.refund_success import RefundSuccess -from advancedbilling.models.remove_payment_event import RemovePaymentEvent -from advancedbilling.models.resume_options import ResumeOptions -from advancedbilling.models.snap_day import SnapDay -from advancedbilling.models.subscription_group_members_array_error import SubscriptionGroupMembersArrayError -from advancedbilling.models.subscription_group_signup_event_data import SubscriptionGroupSignupEventData -from advancedbilling.models.subscription_group_single_error import SubscriptionGroupSingleError -from advancedbilling.models.subscription_product_change import SubscriptionProductChange -from advancedbilling.models.subscription_state_change import SubscriptionStateChange -from advancedbilling.models.update_metafield import UpdateMetafield -from advancedbilling.models.void_invoice_event import VoidInvoiceEvent -from advancedbilling.models.void_remainder_event import VoidRemainderEvent -from apimatic_core.types.union_types.any_of import AnyOf -from apimatic_core.types.union_types.leaf_type import LeafType -from apimatic_core.types.union_types.one_of import OneOf -from apimatic_core.types.union_types.union_type_context import UnionTypeContext as Context +# ruff: noqa: E501 +from __future__ import annotations + +from typing import ( + Callable, + ClassVar, +) + +from apimatic_core.types.union_types.any_of import ( + AnyOf, +) +from apimatic_core.types.union_types.leaf_type import ( + LeafType, +) +from apimatic_core.types.union_types.one_of import ( + OneOf, +) +from apimatic_core.types.union_types.union_type_context import ( + UnionTypeContext as Context, +) + +from advancedbilling.models.apple_pay_payment_profile import ( + ApplePayPaymentProfile, +) +from advancedbilling.models.apply_credit_note_event import ( + ApplyCreditNoteEvent, +) +from advancedbilling.models.apply_debit_note_event import ( + ApplyDebitNoteEvent, +) +from advancedbilling.models.apply_payment_event import ( + ApplyPaymentEvent, +) +from advancedbilling.models.backport_invoice_event import ( + BackportInvoiceEvent, +) +from advancedbilling.models.bank_account_payment_profile import ( + BankAccountPaymentProfile, +) +from advancedbilling.models.change_chargeback_status_event import ( + ChangeChargebackStatusEvent, +) +from advancedbilling.models.change_invoice_collection_method_event import ( + ChangeInvoiceCollectionMethodEvent, +) +from advancedbilling.models.change_invoice_status_event import ( + ChangeInvoiceStatusEvent, +) +from advancedbilling.models.component_allocation_change import ( + ComponentAllocationChange, +) +from advancedbilling.models.create_component_price_point import ( + CreateComponentPricePoint, +) +from advancedbilling.models.create_credit_note_event import ( + CreateCreditNoteEvent, +) +from advancedbilling.models.create_debit_note_event import ( + CreateDebitNoteEvent, +) +from advancedbilling.models.create_metafield import ( + CreateMetafield, +) +from advancedbilling.models.create_prepaid_usage_component_price_point import ( + CreatePrepaidUsageComponentPricePoint, +) +from advancedbilling.models.credit_account_balance_changed import ( + CreditAccountBalanceChanged, +) +from advancedbilling.models.credit_card_payment_profile import ( + CreditCardPaymentProfile, +) +from advancedbilling.models.custom_field_value_change import ( + CustomFieldValueChange, +) +from advancedbilling.models.customer_error import ( + CustomerError, +) +from advancedbilling.models.dunning_step_reached import ( + DunningStepReached, +) +from advancedbilling.models.failed_payment_event import ( + FailedPaymentEvent, +) +from advancedbilling.models.invoice_issued import ( + InvoiceIssued, +) +from advancedbilling.models.issue_invoice_event import ( + IssueInvoiceEvent, +) +from advancedbilling.models.item_price_point_changed import ( + ItemPricePointChanged, +) +from advancedbilling.models.metered_usage import ( + MeteredUsage, +) +from advancedbilling.models.payment_collection_method_changed import ( + PaymentCollectionMethodChanged, +) +from advancedbilling.models.payment_method_apple_pay import ( + PaymentMethodApplePay, +) +from advancedbilling.models.payment_method_bank_account import ( + PaymentMethodBankAccount, +) +from advancedbilling.models.payment_method_credit_card import ( + PaymentMethodCreditCard, +) +from advancedbilling.models.payment_method_external import ( + PaymentMethodExternal, +) +from advancedbilling.models.payment_method_paypal import ( + PaymentMethodPaypal, +) +from advancedbilling.models.payment_related_events import ( + PaymentRelatedEvents, +) +from advancedbilling.models.paypal_payment_profile import ( + PaypalPaymentProfile, +) +from advancedbilling.models.pending_cancellation_change import ( + PendingCancellationChange, +) +from advancedbilling.models.prepaid_subscription_balance_changed import ( + PrepaidSubscriptionBalanceChanged, +) +from advancedbilling.models.prepaid_usage import ( + PrepaidUsage, +) +from advancedbilling.models.prepayment_account_balance_changed import ( + PrepaymentAccountBalanceChanged, +) +from advancedbilling.models.proforma_invoice_issued import ( + ProformaInvoiceIssued, +) +from advancedbilling.models.refund_consolidated_invoice import ( + RefundConsolidatedInvoice, +) +from advancedbilling.models.refund_invoice import ( + RefundInvoice, +) +from advancedbilling.models.refund_invoice_event import ( + RefundInvoiceEvent, +) +from advancedbilling.models.refund_success import ( + RefundSuccess, +) +from advancedbilling.models.remove_payment_event import ( + RemovePaymentEvent, +) +from advancedbilling.models.resume_options import ( + ResumeOptions, +) +from advancedbilling.models.scheduled_renewal_item_request_body_component import ( + ScheduledRenewalItemRequestBodyComponent, +) +from advancedbilling.models.scheduled_renewal_item_request_body_product import ( + ScheduledRenewalItemRequestBodyProduct, +) +from advancedbilling.models.snap_day import ( + SnapDay, +) +from advancedbilling.models.subscription_group_members_array_error import ( + SubscriptionGroupMembersArrayError, +) +from advancedbilling.models.subscription_group_signup_event_data import ( + SubscriptionGroupSignupEventData, +) +from advancedbilling.models.subscription_group_single_error import ( + SubscriptionGroupSingleError, +) +from advancedbilling.models.subscription_product_change import ( + SubscriptionProductChange, +) +from advancedbilling.models.subscription_state_change import ( + SubscriptionStateChange, +) +from advancedbilling.models.update_metafield import ( + UpdateMetafield, +) +from advancedbilling.models.void_invoice_event import ( + VoidInvoiceEvent, +) +from advancedbilling.models.void_remainder_event import ( + VoidRemainderEvent, +) class UnionTypeLookUp: + """ + Provides lookup and factory methods for predefined union type templates. + This class stores a mapping of template names to callables that construct + union type instances. These templates are used to describe compatible + data shapes by combining primitive or model-based types into a single + resolved representation at runtime. - """The `UnionTypeLookUp` class serves as a utility class for - storing and managing type combinator templates.It acts as a container for the templates - used in handling various data types within the application. + Attributes: + _templates (dict): A mapping of template names to factory callables + that create configured union types. """ - _templates = { - 'UpdateComponentPricePointComponentId': lambda: OneOf( + + _templates: ClassVar[dict[str, Callable]] = { + "CloneComponentPricePointComponentId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'UpdateComponentPricePointPricePointId': lambda: OneOf( + "CloneComponentPricePointPricePointId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ReadComponentPricePointComponentId': lambda: OneOf( + "UpdateComponentPricePointComponentId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ReadComponentPricePointPricePointId': lambda: OneOf( + "UpdateComponentPricePointPricePointId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ArchiveComponentPricePointComponentId': lambda: OneOf( + "ReadComponentPricePointComponentId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ArchiveComponentPricePointPricePointId': lambda: OneOf( + "ReadComponentPricePointPricePointId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'CreateProductPricePointProductId': lambda: OneOf( + "ArchiveComponentPricePointComponentId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ListProductPricePointsInputProductId': lambda: OneOf( + "ArchiveComponentPricePointPricePointId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'UpdateProductPricePointProductId': lambda: OneOf( + "CreateProductPricePointProductId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'UpdateProductPricePointPricePointId': lambda: OneOf( + "ListProductPricePointsInputProductId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ReadProductPricePointProductId': lambda: OneOf( + "UpdateProductPricePointProductId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ReadProductPricePointPricePointId': lambda: OneOf( + "UpdateProductPricePointPricePointId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ArchiveProductPricePointProductId': lambda: OneOf( + "ReadProductPricePointProductId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], + ), + "ReadProductPricePointPricePointId": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], ), - 'ArchiveProductPricePointPricePointId': lambda: OneOf( + "ArchiveProductPricePointProductId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], + ), + "ArchiveProductPricePointPricePointId": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], ), - 'CreateUsageSubscriptionIdOrReference': lambda: OneOf( + "CreateUsageSubscriptionIdOrReference": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'CreateUsageComponentId': lambda: OneOf( + "CreateUsageComponentId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ListUsagesInputSubscriptionIdOrReference': lambda: OneOf( + "ListUsagesInputSubscriptionIdOrReference": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'ListUsagesInputComponentId': lambda: OneOf( + "ListUsagesInputComponentId": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'Invoice-Event': lambda: AnyOf( + "Invoice-Event": lambda: AnyOf( [ LeafType(ApplyCreditNoteEvent, Context.create( - discriminator_value='apply_credit_note', - discriminator='event_type' + discriminator_value="apply_credit_note", + discriminator="event_type", )), LeafType(ApplyDebitNoteEvent, Context.create( - discriminator_value='apply_debit_note', - discriminator='event_type' + discriminator_value="apply_debit_note", + discriminator="event_type", )), LeafType(ApplyPaymentEvent, Context.create( - discriminator_value='apply_payment', - discriminator='event_type' + discriminator_value="apply_payment", + discriminator="event_type", )), LeafType(BackportInvoiceEvent, Context.create( - discriminator_value='backport_invoice', - discriminator='event_type' + discriminator_value="backport_invoice", + discriminator="event_type", )), LeafType(ChangeChargebackStatusEvent, Context.create( - discriminator_value='change_chargeback_status', - discriminator='event_type' + discriminator_value="change_chargeback_status", + discriminator="event_type", )), LeafType(ChangeInvoiceCollectionMethodEvent, Context.create( - discriminator_value='change_invoice_collection_method', - discriminator='event_type' + discriminator_value="change_invoice_collection_method", + discriminator="event_type", )), LeafType(ChangeInvoiceStatusEvent, Context.create( - discriminator_value='change_invoice_status', - discriminator='event_type' + discriminator_value="change_invoice_status", + discriminator="event_type", )), LeafType(CreateCreditNoteEvent, Context.create( - discriminator_value='create_credit_note', - discriminator='event_type' + discriminator_value="create_credit_note", + discriminator="event_type", )), LeafType(CreateDebitNoteEvent, Context.create( - discriminator_value='create_debit_note', - discriminator='event_type' + discriminator_value="create_debit_note", + discriminator="event_type", )), LeafType(FailedPaymentEvent, Context.create( - discriminator_value='failed_payment', - discriminator='event_type' + discriminator_value="failed_payment", + discriminator="event_type", )), LeafType(IssueInvoiceEvent, Context.create( - discriminator_value='issue_invoice', - discriminator='event_type' + discriminator_value="issue_invoice", + discriminator="event_type", )), LeafType(RefundInvoiceEvent, Context.create( - discriminator_value='refund_invoice', - discriminator='event_type' + discriminator_value="refund_invoice", + discriminator="event_type", )), LeafType(RemovePaymentEvent, Context.create( - discriminator_value='remove_payment', - discriminator='event_type' + discriminator_value="remove_payment", + discriminator="event_type", )), LeafType(VoidInvoiceEvent, Context.create( - discriminator_value='void_invoice', - discriminator='event_type' + discriminator_value="void_invoice", + discriminator="event_type", )), LeafType(VoidRemainderEvent, Context.create( - discriminator_value='void_remainder', - discriminator='event_type' - )) + discriminator_value="void_remainder", + discriminator="event_type", + )), ], Context.create( is_array=True, - is_optional=True - ) + is_optional=True, + ), ), - 'AllocationQuantity': lambda: OneOf( + "AllocationQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'AllocationPreviousQuantity': lambda: OneOf( + "AllocationPreviousQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'AllocationPreviewItemQuantity': lambda: OneOf( + "AllocationPreviewItemQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'AllocationPreviewItemPreviousQuantity': lambda: OneOf( + "AllocationPreviewItemPreviousQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'Invoice-Event-Payment': lambda: AnyOf( + "Invoice-Event-Payment": lambda: AnyOf( [ LeafType(PaymentMethodApplePay, Context.create( - discriminator_value='apple_pay', - discriminator='type' + discriminator_value="apple_pay", + discriminator="type", )), LeafType(PaymentMethodBankAccount, Context.create( - discriminator_value='bank_account', - discriminator='type' + discriminator_value="bank_account", + discriminator="type", )), LeafType(PaymentMethodCreditCard, Context.create( - discriminator_value='credit_card', - discriminator='type' + discriminator_value="credit_card", + discriminator="type", )), LeafType(PaymentMethodExternal, Context.create( - discriminator_value='external', - discriminator='type' + discriminator_value="external", + discriminator="type", )), LeafType(PaymentMethodPaypal, Context.create( - discriminator_value='paypal_account', - discriminator='type' - )) - ] + discriminator_value="paypal_account", + discriminator="type", + )), + ], ), - 'CalendarBillingSnapDay': lambda: OneOf( + "CalendarBillingSnapDay": lambda: OneOf( [ LeafType(int), - LeafType(SnapDay) + LeafType(SnapDay), ], Context.create( is_optional=True, - is_nullable=True - ) + is_nullable=True, + ), ), - 'ComponentAllocationChangeAllocatedQuantity': lambda: OneOf( + "ComponentAllocationChangeAllocatedQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'ComponentPricePointAssignmentPricePoint': lambda: OneOf( + "ComponentPricePointAssignmentPricePoint": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CouponPayloadPercentage': lambda: OneOf( + "CouponPayloadPercentage": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateAllocationPricePointId': lambda: OneOf( + "CreateAllocationPricePointId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( is_optional=True, - is_nullable=True - ) + is_nullable=True, + ), ), - 'CreateComponentPricePointRequestPricePoint': lambda: AnyOf( + "CreateComponentPricePointRequestPricePoint": lambda: AnyOf( [ LeafType(CreateComponentPricePoint), - LeafType(CreatePrepaidUsageComponentPricePoint) - ] + LeafType(CreatePrepaidUsageComponentPricePoint), + ], ), - 'CreateComponentPricePointsRequestPricePoints': lambda: AnyOf( + "CreateComponentPricePointsRequestPricePoints": lambda: AnyOf( [ LeafType(CreateComponentPricePoint), - LeafType(CreatePrepaidUsageComponentPricePoint) + LeafType(CreatePrepaidUsageComponentPricePoint), ], Context.create( - is_array=True - ) + is_array=True, + ), ), - 'CreateInvoiceCouponPercentage': lambda: OneOf( + "CreateInvoiceCouponPercentage": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceCouponAmount': lambda: OneOf( + "CreateInvoiceCouponAmount": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceCouponProductFamilyId': lambda: OneOf( + "CreateInvoiceCouponProductFamilyId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceItemQuantity': lambda: OneOf( + "CreateInvoiceItemQuantity": lambda: OneOf( [ LeafType(float), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceItemUnitPrice': lambda: OneOf( + "CreateInvoiceItemUnitPrice": lambda: OneOf( [ LeafType(float), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceItemProductId': lambda: OneOf( + "CreateInvoiceItemProductId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceItemComponentId': lambda: OneOf( + "CreateInvoiceItemComponentId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceItemPricePointId': lambda: OneOf( + "CreateInvoiceItemPricePointId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoiceItemProductPricePointId': lambda: OneOf( + "CreateInvoiceItemProductPricePointId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateInvoicePaymentAmount': lambda: OneOf( + "CreateInvoicePaymentAmount": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateMetafieldsRequestMetafields': lambda: OneOf( + "CreateMetafieldsRequestMetafields": lambda: OneOf( [ LeafType(CreateMetafield), LeafType(CreateMetafield, Context.create( - is_array=True - )) - ] + is_array=True, + )), + ], ), - 'CreateMultiInvoicePaymentAmount': lambda: OneOf( + "CreateMultiInvoicePaymentAmount": lambda: OneOf( [ LeafType(str), - LeafType(float) - ] + LeafType(float), + ], ), - 'CreateOrUpdateSegmentPriceUnitPrice': lambda: OneOf( + "CreateOrUpdateSegmentPriceUnitPrice": lambda: OneOf( [ LeafType(str), - LeafType(float) - ] + LeafType(float), + ], ), - 'CreatePaymentProfileExpirationMonth': lambda: OneOf( + "CreatePaymentProfileExpirationMonth": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreatePaymentProfileExpirationYear': lambda: OneOf( + "CreatePaymentProfileExpirationYear": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSegmentSegmentProperty1Value': lambda: OneOf( + "CreateSegmentSegmentProperty1Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSegmentSegmentProperty2Value': lambda: OneOf( + "CreateSegmentSegmentProperty2Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSegmentSegmentProperty3Value': lambda: OneOf( + "CreateSegmentSegmentProperty3Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSegmentSegmentProperty4Value': lambda: OneOf( + "CreateSegmentSegmentProperty4Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSubscriptionOfferId': lambda: OneOf( + "CreateSubscriptionOfferId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSubscriptionComponentComponentId': lambda: OneOf( + "CreateSubscriptionComponentComponentId": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSubscriptionComponentAllocatedQuantity': lambda: OneOf( + "CreateSubscriptionComponentAllocatedQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CreateSubscriptionComponentPricePointId': lambda: OneOf( + "CreateSubscriptionComponentPricePointId": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'CustomerErrorResponseErrors': lambda: OneOf( + "CustomerErrorResponseErrors": lambda: OneOf( [ LeafType(CustomerError), LeafType(str, Context.create( - is_array=True - )) + is_array=True, + )), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'DeductServiceCreditAmount': lambda: OneOf( + "DeductServiceCreditAmount": lambda: OneOf( [ LeafType(str), - LeafType(float) - ] + LeafType(float), + ], ), - 'EBBComponentUnitPrice': lambda: OneOf( + "EBBComponentUnitPrice": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'EventEventSpecificData': lambda: OneOf( + "EventEventSpecificData": lambda: OneOf( [ LeafType(SubscriptionProductChange), LeafType(SubscriptionStateChange), @@ -647,427 +794,463 @@ class UnionTypeLookUp: LeafType(PrepaymentAccountBalanceChanged), LeafType(PaymentCollectionMethodChanged), LeafType(ItemPricePointChanged), - LeafType(CustomFieldValueChange) + LeafType(CustomFieldValueChange), ], Context.create( - is_nullable=True - ) + is_nullable=True, + ), ), - 'IssueServiceCreditAmount': lambda: OneOf( + "IssueServiceCreditAmount": lambda: OneOf( [ LeafType(float), - LeafType(str) - ] + LeafType(str), + ], ), - 'MetafieldEnum': lambda: OneOf( + "MetafieldEnum": lambda: OneOf( [ LeafType(str), LeafType(str, Context.create( - is_array=True - )) + is_array=True, + )), ], Context.create( is_optional=True, - is_nullable=True - ) + is_nullable=True, + ), ), - 'MeteredComponentUnitPrice': lambda: OneOf( + "MeteredComponentUnitPrice": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'OnOffComponentUnitPrice': lambda: OneOf( + "OnOffComponentUnitPrice": lambda: OneOf( [ LeafType(str), - LeafType(float) - ] + LeafType(float), + ], ), - 'PaymentProfileAttributesExpirationMonth': lambda: OneOf( + "PaymentProfileAttributesExpirationMonth": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'PaymentProfileAttributesExpirationYear': lambda: OneOf( + "PaymentProfileAttributesExpirationYear": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'Payment-Profile': lambda: AnyOf( + "Payment-Profile": lambda: AnyOf( [ LeafType(ApplePayPaymentProfile, Context.create( - discriminator_value='apple_pay', - discriminator='payment_type' + discriminator_value="apple_pay", + discriminator="payment_type", )), LeafType(BankAccountPaymentProfile, Context.create( - discriminator_value='bank_account', - discriminator='payment_type' + discriminator_value="bank_account", + discriminator="payment_type", )), LeafType(CreditCardPaymentProfile, Context.create( - discriminator_value='credit_card', - discriminator='payment_type' + discriminator_value="credit_card", + discriminator="payment_type", )), LeafType(PaypalPaymentProfile, Context.create( - discriminator_value='paypal_account', - discriminator='payment_type' - )) - ] + discriminator_value="paypal_account", + discriminator="payment_type", + )), + ], ), - 'PrepaidUsageComponentUnitPrice': lambda: OneOf( + "PrepaidUsageComponentUnitPrice": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'PriceStartingQuantity': lambda: OneOf( + "PriceStartingQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) - ] + LeafType(str), + ], ), - 'PriceEndingQuantity': lambda: OneOf( + "PriceEndingQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( is_optional=True, - is_nullable=True - ) + is_nullable=True, + ), ), - 'PriceUnitPrice': lambda: OneOf( + "PriceUnitPrice": lambda: OneOf( [ LeafType(float), - LeafType(str) - ] + LeafType(str), + ], ), - 'QuantityBasedComponentUnitPrice': lambda: OneOf( + "QuantityBasedComponentUnitPrice": lambda: OneOf( [ LeafType(str), - LeafType(float) + LeafType(float), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'ReactivateSubscriptionRequestResume': lambda: OneOf( + "ReactivateSubscriptionRequestResume": lambda: OneOf( [ LeafType(bool), - LeafType(ResumeOptions) + LeafType(ResumeOptions), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'RefundConsolidatedInvoiceSegmentUids': lambda: OneOf( + "RefundConsolidatedInvoiceSegmentUids": lambda: OneOf( [ LeafType(str, Context.create( - is_array=True + is_array=True, )), - LeafType(str) - ] + LeafType(str), + ], ), - 'RefundInvoiceRequestRefund': lambda: AnyOf( + "RefundInvoiceRequestRefund": lambda: AnyOf( [ LeafType(RefundInvoice), - LeafType(RefundConsolidatedInvoice) - ] + LeafType(RefundConsolidatedInvoice), + ], ), - 'RefundPrepaymentAmount': lambda: OneOf( + "RefundPrepaymentAmount": lambda: OneOf( [ LeafType(str), - LeafType(float) - ] + LeafType(float), + ], ), - 'RenewalPreviewComponentComponentId': lambda: OneOf( + "RenewalPreviewComponentComponentId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'RenewalPreviewComponentPricePointId': lambda: OneOf( + "RenewalPreviewComponentPricePointId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), + ), + "ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem": lambda: OneOf( + [ + LeafType(ScheduledRenewalItemRequestBodyComponent), + LeafType(ScheduledRenewalItemRequestBodyProduct), + ], + ), + "ScheduledRenewalProductPricePointPriceInCents": lambda: OneOf( + [ + LeafType(str), + LeafType(int), + ], + ), + "ScheduledRenewalProductPricePointInterval": lambda: OneOf( + [ + LeafType(str), + LeafType(int), + ], + ), + "ScheduledRenewalUpdateRequestRenewalConfigurationItem": lambda: OneOf( + [ + LeafType(ScheduledRenewalItemRequestBodyComponent), + LeafType(ScheduledRenewalItemRequestBodyProduct), + ], ), - 'SegmentSegmentProperty1Value': lambda: OneOf( + "SegmentSegmentProperty1Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SegmentSegmentProperty2Value': lambda: OneOf( + "SegmentSegmentProperty2Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SegmentSegmentProperty3Value': lambda: OneOf( + "SegmentSegmentProperty3Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SegmentSegmentProperty4Value': lambda: OneOf( + "SegmentSegmentProperty4Value": lambda: OneOf( [ LeafType(str), LeafType(float), LeafType(int), - LeafType(bool) + LeafType(bool), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionSnapDay': lambda: OneOf( + "SubscriptionSnapDay": lambda: OneOf( [ LeafType(int), - LeafType(SnapDay) + LeafType(SnapDay), ], Context.create( is_optional=True, - is_nullable=True - ) + is_nullable=True, + ), ), - 'SubscriptionComponentAllocatedQuantity': lambda: OneOf( + "SubscriptionComponentAllocatedQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionCustomPricePriceInCents': lambda: OneOf( + "SubscriptionCustomPricePriceInCents": lambda: OneOf( [ LeafType(str), - LeafType(int) - ] + LeafType(int), + ], ), - 'SubscriptionCustomPriceInterval': lambda: OneOf( + "SubscriptionCustomPriceInterval": lambda: OneOf( [ LeafType(str), - LeafType(int) - ] + LeafType(int), + ], ), - 'SubscriptionCustomPriceTrialPriceInCents': lambda: OneOf( + "SubscriptionCustomPriceTrialPriceInCents": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionCustomPriceTrialInterval': lambda: OneOf( + "SubscriptionCustomPriceTrialInterval": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionCustomPriceInitialChargeInCents': lambda: OneOf( + "SubscriptionCustomPriceInitialChargeInCents": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionCustomPriceExpirationInterval': lambda: OneOf( + "SubscriptionCustomPriceExpirationInterval": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionGroupCreateErrorResponseErrors': lambda: OneOf( + "SubscriptionGroupCreateErrorResponseErrors": lambda: OneOf( [ LeafType(SubscriptionGroupMembersArrayError), LeafType(SubscriptionGroupSingleError), - LeafType(str) - ] + LeafType(str), + ], ), - 'SubscriptionGroupCreditCardFullNumber': lambda: OneOf( + "SubscriptionGroupCreditCardFullNumber": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionGroupCreditCardExpirationMonth': lambda: OneOf( + "SubscriptionGroupCreditCardExpirationMonth": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionGroupCreditCardExpirationYear': lambda: OneOf( + "SubscriptionGroupCreditCardExpirationYear": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionGroupSignupComponentComponentId': lambda: OneOf( + "SubscriptionGroupSignupComponentComponentId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionGroupSignupComponentAllocatedQuantity': lambda: OneOf( + "SubscriptionGroupSignupComponentAllocatedQuantity": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionGroupSignupComponentUnitBalance': lambda: OneOf( + "SubscriptionGroupSignupComponentUnitBalance": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'SubscriptionGroupSignupComponentPricePointId': lambda: OneOf( + "SubscriptionGroupSignupComponentPricePointId": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'UpdateMetafieldsRequestMetafields': lambda: OneOf( + "UpdateMetafieldsRequestMetafields": lambda: OneOf( [ LeafType(UpdateMetafield), LeafType(UpdateMetafield, Context.create( - is_array=True - )) + is_array=True, + )), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'UpdatePriceEndingQuantity': lambda: OneOf( + "UpdatePriceEndingQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'UpdatePriceUnitPrice': lambda: OneOf( + "UpdatePriceUnitPrice": lambda: OneOf( [ LeafType(float), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'UpdatePriceStartingQuantity': lambda: OneOf( + "UpdatePriceStartingQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'UpdateSubscriptionSnapDay': lambda: OneOf( + "UpdateSubscriptionSnapDay": lambda: OneOf( [ LeafType(int), - LeafType(SnapDay) + LeafType(SnapDay), ], Context.create( is_optional=True, - is_nullable=True - ) + is_nullable=True, + ), ), - 'UpdateSubscriptionNetTerms': lambda: OneOf( + "UpdateSubscriptionNetTerms": lambda: OneOf( [ LeafType(str), - LeafType(int) + LeafType(int), ], Context.create( - is_optional=True - ) + is_optional=True, + ), ), - 'UsageQuantity': lambda: OneOf( + "UsageQuantity": lambda: OneOf( [ LeafType(int), - LeafType(str) + LeafType(str), ], Context.create( - is_optional=True - ) - ) + is_optional=True, + ), + ), } @staticmethod def get(name): - return UnionTypeLookUp._templates[name]() + """ + Retrieve and construct a union type template by name. + + Args: + name (str): The key identifying the template to resolve. + Returns: + Any: A new instance of the union type defined for the given name. + + Raises: + KeyError: If no template exists for the specified name. + + """ + return UnionTypeLookUp._templates[name]() diff --git a/doc/client.md b/doc/client.md index 214fa1c4..33f823d4 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,8 +5,8 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| site | `str` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| environment | `Environment` | The API environment.
**Default: `Environment.US`** | +| site | `str` | The subdomain for your Advanced Billing site.
*Default*: `"subdomain"` | +| environment | [`Environment`](../README.md#environments) | The API environment.
**Default: `Environment.US`** | | http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests | | override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user | | http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint | @@ -14,7 +14,7 @@ The following parameters are configurable for the API Client: | max_retries | `int` | The number of times to retry an endpoint call if it fails.
**Default: 0** | | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**Default: 2** | | retry_statuses | `Array of int` | The http statuses on which retry is to be done.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | -| retry_methods | `Array of string` | The http methods on which retry is to be done.
**Default: ['GET', 'PUT']** | +| retry_methods | `Array of string` | The http methods on which retry is to be done.
**Default: ["GET", "PUT"]** | | proxy_settings | [`ProxySettings`](../doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | | basic_auth_credentials | [`BasicAuthCredentials`](auth/basic-authentication.md) | The credential object for Basic Authentication | @@ -86,6 +86,7 @@ The gateway for the SDK. This class acts as a factory for the Controllers and al | subscription_invoice_account | Gets SubscriptionInvoiceAccountController | | subscription_notes | Gets SubscriptionNotesController | | subscription_products | Gets SubscriptionProductsController | +| subscription_renewals | Gets SubscriptionRenewalsController | | subscription_status | Gets SubscriptionStatusController | | webhooks | Gets WebhooksController | diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index fd1138fe..24efc08c 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -32,7 +32,7 @@ def issue_advance_invoice(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`IssueAdvanceInvoiceRequest`](../../doc/models/issue-advance-invoice-request.md) | Body, Optional | - | ## Response Type @@ -76,7 +76,7 @@ def read_advance_invoice(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type @@ -113,7 +113,7 @@ def void_advance_invoice(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`VoidInvoiceRequest`](../../doc/models/void-invoice-request.md) | Body, Optional | - | ## Response Type diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 7edfec09..fb91baaa 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -14,6 +14,7 @@ component_price_points_controller = client.component_price_points * [Create Component Price Point](../../doc/controllers/component-price-points.md#create-component-price-point) * [List Component Price Points](../../doc/controllers/component-price-points.md#list-component-price-points) * [Bulk Create Component Price Points](../../doc/controllers/component-price-points.md#bulk-create-component-price-points) +* [Clone Component Price Point](../../doc/controllers/component-price-points.md#clone-component-price-point) * [Update Component Price Point](../../doc/controllers/component-price-points.md#update-component-price-point) * [Read Component Price Point](../../doc/controllers/component-price-points.md#read-component-price-point) * [Archive Component Price Point](../../doc/controllers/component-price-points.md#archive-component-price-point) @@ -376,6 +377,138 @@ print(result) | 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +# Clone Component Price Point + +Clones a component price point. Custom price points (tied to a specific subscription) cannot be cloned. The following attributes are copied from the source price point: + +- Pricing scheme +- All price tiers (with starting/ending quantities and unit prices) +- Tax included setting +- Currency prices (if definitive pricing is set) +- Overage pricing (for prepaid usage components) +- Interval settings (if multi-frequency is enabled) +- Event-based billing segments (if applicable) + +```python +def clone_component_price_point(self, + component_id, + price_point_id, + body=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `component_id` | int \| str | Template, Required | This is a container for one-of cases. | +| `price_point_id` | int \| str | Template, Required | This is a container for one-of cases. | +| `body` | [`CloneComponentPricePointRequest`](../../doc/models/clone-component-price-point-request.md) | Body, Optional | - | + +## Response Type + +[`ComponentPricePointCurrencyOverageResponse`](../../doc/models/component-price-point-currency-overage-response.md) + +## Example Usage + +```python +component_id = 144 + +price_point_id = 188 + +body = CloneComponentPricePointRequest( + price_point=CloneComponentPricePoint( + name='Pro Usage Tiered Clone' + ) +) + +result = component_price_points_controller.clone_component_price_point( + component_id, + price_point_id, + body=body +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 9012, + "name": "Pro Usage Tiered Clone", + "type": "catalog", + "pricing_scheme": "tiered", + "component_id": 1234, + "handle": "pro-usage-tiered-clone", + "archived_at": null, + "created_at": "2024-05-01T12:34:56-04:00", + "updated_at": "2024-05-01T12:34:56-04:00", + "use_site_exchange_rate": false, + "currency_prices": [ + { + "id": 3001, + "currency": "EUR", + "price": "9.99", + "formatted_price": "€9.99", + "price_id": 4001, + "price_point_id": 9012 + } + ], + "currency_overage_prices": [ + { + "id": 3002, + "currency": "EUR", + "price": "2.50", + "formatted_price": "€2.50", + "price_id": 4002, + "price_point_id": 9012 + } + ], + "renew_prepaid_allocation": true, + "rollover_prepaid_remainder": false, + "expiration_interval": 1, + "expiration_interval_unit": "month", + "overage_pricing_scheme": "tiered", + "subscription_id": 4321, + "prices": [ + { + "id": 4001, + "component_id": 1234, + "starting_quantity": 1, + "ending_quantity": 100, + "unit_price": "9.99", + "price_point_id": 9012, + "formatted_unit_price": "$9.99", + "segment_id": null + } + ], + "overage_prices": [ + { + "id": 4002, + "component_id": 1234, + "starting_quantity": 101, + "ending_quantity": null, + "unit_price": "2.50", + "price_point_id": 9012, + "formatted_unit_price": "$2.50", + "segment_id": null + } + ], + "tax_included": false, + "interval": 1, + "interval_unit": "month" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `APIException` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + # Update Component Price Point When updating a price point, prices can be updated as well by creating new prices or editing / removing existing ones. @@ -469,7 +602,7 @@ def read_component_price_point(self, ## Response Type -[`ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) +[`ComponentPricePointCurrencyOverageResponse`](../../doc/models/component-price-point-currency-overage-response.md) ## Example Usage diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 6a642ad2..8d7b10c1 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -99,7 +99,7 @@ def list_events(self, | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `"desc"` | | `filter` | [`List[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `date_field` | [`ListEventsDateField`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `start_date` | `str` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | @@ -214,12 +214,12 @@ def list_subscription_events(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `"desc"` | | `filter` | [`List[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type @@ -304,7 +304,7 @@ def read_events_count(self, | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `"desc"` | | `filter` | [`List[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 2cce6324..222e4b4c 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -107,7 +107,7 @@ def list_invoices(self, | `consolidation_level` | `str` | Query, Optional | The consolidation level of the invoice. Allowed Values: none, parent, child or comma-separated lists of thereof, e.g. none,parent. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `"desc"` | | `line_items` | `bool` | Query, Optional | Include line items data

**Default**: `False` | | `discounts` | `bool` | Query, Optional | Include discounts data

**Default**: `False` | | `taxes` | `bool` | Query, Optional | Include taxes data

**Default**: `False` | @@ -115,13 +115,13 @@ def list_invoices(self, | `payments` | `bool` | Query, Optional | Include payments data

**Default**: `False` | | `custom_fields` | `bool` | Query, Optional | Include custom fields data

**Default**: `False` | | `refunds` | `bool` | Query, Optional | Include refunds data

**Default**: `False` | -| `date_field` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.

**Default**: `'due_date'` | +| `date_field` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.

**Default**: `"due_date"` | | `start_datetime` | `str` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `end_datetime` | `str` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `customer_ids` | `List[int]` | Query, Optional | Allows fetching invoices with matching customer id based on provided values. Use in query `customer_ids=1,2,3`. | | `number` | `List[str]` | Query, Optional | Allows fetching invoices with matching invoice number based on provided values. Use in query `number=1234,1235`. | | `product_ids` | `List[int]` | Query, Optional | Allows fetching invoices with matching line items product ids based on provided values. Use in query `product_ids=23,34`. | -| `sort` | [`InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`.

**Default**: `'number'` | +| `sort` | [`InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`.

**Default**: `"number"` | ## Response Type @@ -1885,7 +1885,7 @@ def record_payment_for_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`RecordPaymentRequest`](../../doc/models/record-payment-request.md) | Body, Optional | - | ## Response Type @@ -2052,7 +2052,7 @@ def list_consolidated_invoice_segments(self, | `invoice_uid` | `str` | Template, Required | The unique identifier of the consolidated invoice | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments.

**Default**: `'asc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments.

**Default**: `"asc"` | ## Response Type @@ -2565,7 +2565,7 @@ def create_invoice(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Optional | - | ## Response Type @@ -2704,6 +2704,8 @@ print(result) This endpoint allows for invoices to be programmatically delivered via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. +**File Attachments**: You can attach files to invoice emails using `attachment_urls[]` parameter by providing URLs to the files you want to attach. When using attachments, the request must use `multipart/form-data` content type. Max 10 files, 10MB per file. + If no recipient email addresses are specified in the request, then the subscription's default email configuration will be used. For example, if `recipient_emails` is left blank, then the invoice will be delivered to the subscription's customer email address. On success, a 204 no-content response will be returned. The response does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If _any_ invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned. @@ -3074,7 +3076,7 @@ print(result) # Issue Invoice -This endpoint allows you to issue an invoice that is in "pending" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. +This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. You cannot issue a pending child invoice that was created for a member subscription in a group. diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 7293701b..a150e29f 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -516,7 +516,7 @@ payment_profiles_controller.delete_unused_payment_profile(payment_profile_id) # Delete Subscriptions Payment Profile -This will delete a payment profile belonging to the customer on the subscription. +Deletes a payment profile belonging to the customer on the subscription. + If the customer has multiple subscriptions, the payment profile will be removed from all of them. @@ -532,7 +532,7 @@ def delete_subscriptions_payment_profile(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `payment_profile_id` | `int` | Template, Required | The Chargify id of the payment profile | ## Response Type @@ -631,7 +631,7 @@ print(result) # Delete Subscription Group Payment Profile -This will delete a Payment Profile belonging to a Subscription Group. +Deletes a Payment Profile belonging to a Subscription Group. **Note**: If the Payment Profile belongs to multiple Subscription Groups and/or Subscriptions, it will be removed from all of them. @@ -682,7 +682,7 @@ def change_subscription_default_payment_profile(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `payment_profile_id` | `int` | Template, Required | The Chargify id of the payment profile | ## Response Type @@ -873,7 +873,7 @@ def send_request_update_payment_email(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 647f9866..76327965 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -275,7 +275,8 @@ print(result) "handle": "acme-projects", "accounting_code": null, "created_at": "2013-02-20T15:05:51-07:00", - "updated_at": "2013-02-20T15:05:51-07:00" + "updated_at": "2013-02-20T15:05:51-07:00", + "archived_at": null } }, { @@ -286,7 +287,8 @@ print(result) "handle": "bat-family", "accounting_code": null, "created_at": "2014-04-16T12:41:13-06:00", - "updated_at": "2014-04-16T12:41:13-06:00" + "updated_at": "2014-04-16T12:41:13-06:00", + "archived_at": "2024-11-05T09:30:00-07:00" } } ] @@ -332,7 +334,8 @@ print(result) "name": "Acme Projects", "description": "", "handle": "billing-plans", - "accounting_code": null + "accounting_code": null, + "archived_at": null } } ``` diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 4ca6bea8..df576ae6 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -13,6 +13,7 @@ proforma_invoices_controller = client.proforma_invoices * [Create Consolidated Proforma Invoice](../../doc/controllers/proforma-invoices.md#create-consolidated-proforma-invoice) * [List Subscription Group Proforma Invoices](../../doc/controllers/proforma-invoices.md#list-subscription-group-proforma-invoices) * [Read Proforma Invoice](../../doc/controllers/proforma-invoices.md#read-proforma-invoice) +* [Deliver Proforma Invoice](../../doc/controllers/proforma-invoices.md#deliver-proforma-invoice) * [Create Proforma Invoice](../../doc/controllers/proforma-invoices.md#create-proforma-invoice) * [List Proforma Invoices](../../doc/controllers/proforma-invoices.md#list-proforma-invoices) * [Void Proforma Invoice](../../doc/controllers/proforma-invoices.md#void-proforma-invoice) @@ -150,6 +151,64 @@ print(result) | 404 | Not Found | `APIException` | +# Deliver Proforma Invoice + +Allows for proforma invoices to be programmatically delivered via email. Supports email +delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. + +If `recipient_emails` is omitted, the system will fall back to the primary recipient derived from the invoice or +subscription. At least one recipient must be present, either via the request body or via this default behavior, so an +empty body may still succeed when defaults are available. + +```python +def deliver_proforma_invoice(self, + proforma_invoice_uid, + body=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `proforma_invoice_uid` | `str` | Template, Required | The uid of the proforma invoice | +| `body` | [`DeliverProformaInvoiceRequest`](../../doc/models/deliver-proforma-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```python +proforma_invoice_uid = 'proforma_invoice_uid4' + +body = DeliverProformaInvoiceRequest( + recipient_emails=[ + 'user0@example.com' + ], + cc_recipient_emails=[ + 'user1@example.com' + ], + bcc_recipient_emails=[ + 'user2@example.com' + ] +) + +result = proforma_invoices_controller.deliver_proforma_invoice( + proforma_invoice_uid, + body=body +) +print(result) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `APIException` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + # Create Proforma Invoice This endpoint will create a proforma invoice and return it as a response. If the information becomes outdated, simply void the old proforma invoice and generate a new one. @@ -169,7 +228,7 @@ def create_proforma_invoice(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type @@ -204,13 +263,13 @@ def list_proforma_invoices(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `start_date` | `str` | Query, Optional | The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `end_date` | `str` | Query, Optional | The ending date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `status` | [`ProformaInvoiceStatus`](../../doc/models/proforma-invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `"desc"` | | `line_items` | `bool` | Query, Optional | Include line items data

**Default**: `False` | | `discounts` | `bool` | Query, Optional | Include discounts data

**Default**: `False` | | `taxes` | `bool` | Query, Optional | Include taxes data

**Default**: `False` | @@ -307,7 +366,7 @@ def preview_proforma_invoice(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 6e70544b..97befef1 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -37,7 +37,7 @@ def list_sales_commission_settings(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `seller_id` | `str` | Template, Required | The Chargify id of your seller account | -| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | +| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `"Bearer <>"` | | `live_mode` | `bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | @@ -116,7 +116,7 @@ def list_sales_reps(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `seller_id` | `str` | Template, Required | The Chargify id of your seller account | -| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | +| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `"Bearer <>"` | | `live_mode` | `bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | @@ -238,7 +238,7 @@ Access to the Sales Commission API endpoints is available to users with financia def read_sales_rep(self, seller_id, sales_rep_id, - authorization='Bearer <>', + authorization="Bearer <>", live_mode=None, page=1, per_page=100) @@ -250,7 +250,7 @@ def read_sales_rep(self, | --- | --- | --- | --- | | `seller_id` | `str` | Template, Required | The Chargify id of your seller account | | `sales_rep_id` | `str` | Template, Required | The Advanced Billing id of sales rep. | -| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | +| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `"Bearer <>"` | | `live_mode` | `bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 99fc54c5..f4baeec0 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -109,14 +109,14 @@ This call is asynchronous and there may be a delay before the site data is fully ```python def clear_site(self, - cleanup_scope='all') + cleanup_scope="all") ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cleanup_scope` | [`CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`.

**Default**: `'all'` | +| `cleanup_scope` | [`CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`.

**Default**: `"all"` | ## Response Type diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 97937c7c..ecbb8f4f 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -43,7 +43,7 @@ def read_subscription_component(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `component_id` | `int` | Template, Required | The Advanced Billing id of the component. Alternatively, the component's handle prefixed by `handle:` | ## Response Type @@ -107,7 +107,7 @@ def list_subscription_components(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `date_field` | [`SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Use in query `date_field=updated_at`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `filter` | [`ListSubscriptionComponentsFilter`](../../doc/models/list-subscription-components-filter.md) | Query, Optional | Filter to use for List Subscription Components operation | @@ -204,7 +204,7 @@ def bulk_update_subscription_components_price_points(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`BulkComponentsPricePointAssignment`](../../doc/models/bulk-components-price-point-assignment.md) | Body, Optional | - | ## Response Type @@ -279,7 +279,7 @@ def bulk_reset_subscription_components_price_points(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type @@ -397,41 +397,13 @@ print(result) # Allocate Component -This endpoint creates a new allocation, setting the current allocated quantity for the Component and recording a memo. +Creates an allocation, sets the current allocated quantity for the component, and records a memo. Allocations can only be updated for Quantity, On/Off, and Prepaid Components. -**Notice**: Allocations can only be updated for Quantity, On/Off, and Prepaid Components. +When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. -## Allocations Documentation +> **Note:** These proration and accural fields are ignored for Prepaid Components since this component type always generate charges immediately without proration. -Full documentation on how to record Allocations in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview). It is focused on how allocations operate within the Advanced Billing UI.It goes into greater detail on how the user interface will react when recording allocations. - -This documentation also goes into greater detail on how proration is taken into consideration when applying component allocations. - -## Proration Schemes - -Changing the allocated quantity of a component mid-period can result in either a Charge or Credit being applied to the subscription. When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. - -**Notice:** These proration and accural fields will be ignored for Prepaid Components since this component type always generate charges immediately without proration. - -For background information on prorated components and upgrade/downgrade schemes, see [Setting Component Allocations.](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration). -See the tables below for valid values. - -| upgrade_charge | Definition                                                        | -|----------------|-------------------------------------------------------------------| -| `full`         | A charge is added for the full price of the component.            | -| `prorated`     | A charge is added for the prorated price of the component change. | -| `none`         | No charge is added.                                               | - -| downgrade_credit | Definition                                        | -|------------------|---------------------------------------------------| -| `full`           | A full price credit is added for the amount owed. | -| `prorated`       | A prorated credit is added for the amount owed.   | -| `none`           | No charge is added.                               | - -| accrue_charge | Definition                                                                                               | -|---------------|------------------------------------------------------------------------------------------------------------| -| `true`        | Attempt to charge the customer at next renewal. | -| `false`       | Attempt to charge the customer right away. If it fails, the charge will be accrued until the next renewal. | +For information on prorated components and upgrade/downgrade schemes, see [Setting Component Allocations.](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration) ### Order of Resolution for upgrade_charge and downgrade_credit @@ -445,7 +417,9 @@ See the tables below for valid values. 1. Allocation API call top level (outside of the `allocations` array) 2. [Site-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#proration-schemes) -**NOTE: Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong.** +> **Note:** Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong. + +For more informaiton see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product Documentation. ```python def allocate_component(self, @@ -458,7 +432,7 @@ def allocate_component(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `component_id` | `int` | Template, Required | The Advanced Billing id of the component | | `body` | [`CreateAllocationRequest`](../../doc/models/create-allocation-request.md) | Body, Optional | - | @@ -475,8 +449,44 @@ component_id = 222 body = CreateAllocationRequest( allocation=CreateAllocation( - quantity=5, - memo='Recoding component purchase of Acme Support' + quantity=10, + decimal_quantity='10.0', + previous_quantity=5, + decimal_previous_quantity='5.0', + memo='Increase seats to 10', + proration_downgrade_scheme='prorate', + proration_upgrade_scheme='full-price-attempt-capture', + downgrade_credit=DowngradeCreditCreditType.PRORATED, + upgrade_charge=UpgradeChargeCreditType.FULL, + accrue_charge=False, + price_point_id=789, + billing_schedule=BillingSchedule( + initial_billing_at=dateutil.parser.parse('2025-02-28').date() + ), + custom_price=ComponentCustomPrice( + prices=[ + Price( + starting_quantity=1, + unit_price='49.00', + ending_quantity=25 + ), + Price( + starting_quantity=26, + unit_price='39.00', + ending_quantity=None + ) + ], + tax_included=False, + pricing_scheme=PricingScheme.PER_UNIT, + interval=1, + interval_unit=IntervalUnit.MONTH, + list_price_point_id=4321, + use_default_list_price=False, + renew_prepaid_allocation=False, + rollover_prepaid_remainder=False, + expiration_interval=150, + expiration_interval_unit=ExpirationIntervalUnit.NEVER + ) ) ) @@ -531,21 +541,6 @@ This endpoint returns the 50 most recent Allocations, ordered by most recent fir When a subscription's on/off component has been toggled to on (`1`) or off (`0`), usage will be logged in this response. -## Querying data via Advanced Billing gem - -You can also query the current quantity via the [official Advanced Billing Gem.](http://github.com/chargify/chargify_api_ares) - -```# First way -component = Chargify::Subscription::Component.find(1, :params => {:subscription_id => 7}) -puts component.allocated_quantity -# => 23 - -# Second way -component = Chargify::Subscription.find(7).component(1) -puts component.allocated_quantity -# => 23 -``` - ```python def list_allocations(self, subscription_id, @@ -557,7 +552,7 @@ def list_allocations(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `component_id` | `int` | Template, Required | The Advanced Billing id of the component | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | @@ -637,11 +632,25 @@ print(result) # Allocate Components -Creates multiple allocations, setting the current allocated quantity for each of the components and recording a memo. The charges and/or credits that are created will be rolled up into a single total which is used to determine whether this is an upgrade or a downgrade. Be aware of the Order of Resolutions explained below in determining the proration scheme. +Creates multiple allocations, sets the current allocated quantity for each of the components, and recording a memo. A `component_id` is required for each allocation. + +The charges and/or credits that are created will be rolled up into a single total which is used to determine whether this is an upgrade or a downgrade. + +### Order of Resolution for upgrade_charge and downgrade_credit + +1. Per allocation in API call (within a single allocation of the `allocations` array) +2. [Component-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) +3. Allocation API call top level (outside of the `allocations` array) +4. [Site-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#proration-schemes) + +### Order of Resolution for accrue charge + +1. Allocation API call top level (outside of the `allocations` array) +2. [Site-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#proration-schemes) -A `component_id` is required for each allocation. +> **Note:** Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong. -This endpoint only responds to JSON. It is not available for XML. +For more informaiton see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product Documentation. ```python def allocate_components(self, @@ -653,7 +662,7 @@ def allocate_components(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`AllocateComponents`](../../doc/models/allocate-components.md) | Body, Optional | - | ## Response Type @@ -760,7 +769,7 @@ def preview_allocations(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`PreviewAllocationsRequest`](../../doc/models/preview-allocations-request.md) | Body, Optional | - | ## Response Type @@ -929,7 +938,7 @@ def update_prepaid_usage_allocation_expiration_date(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `component_id` | `int` | Template, Required | The Advanced Billing id of the component | | `allocation_id` | `int` | Template, Required | The Advanced Billing id of the allocation | | `body` | [`UpdateAllocationExpirationDate`](../../doc/models/update-allocation-expiration-date.md) | Body, Optional | - | @@ -993,7 +1002,7 @@ def delete_prepaid_usage_allocation(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `component_id` | `int` | Template, Required | The Advanced Billing id of the component | | `allocation_id` | `int` | Template, Required | The Advanced Billing id of the allocation | | `body` | [`CreditSchemeRequest`](../../doc/models/credit-scheme-request.md) | Body, Optional | - | diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index c3cd4240..712905a1 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -129,6 +129,7 @@ print(result) ```json { "subscription_group": { + "uid": "grp_952mvqcnk53wq", "customer_id": 1, "payment_profile": { "id": 1, @@ -389,8 +390,8 @@ print(result) # Delete Subscription Group -Use this endpoint to delete subscription group. -Only groups without members can be deleted +Deletes a subscription group. +Only groups without members can be deleted. ```python def delete_subscription_group(self, @@ -537,7 +538,7 @@ def add_subscription_to_group(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`AddSubscriptionToAGroup`](../../doc/models/add-subscription-to-a-group.md) | Body, Optional | - | ## Response Type @@ -606,7 +607,7 @@ def remove_subscription_from_group(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index 5d0383a7..d6893b6b 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -32,7 +32,7 @@ def read_account_balances(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type @@ -68,7 +68,7 @@ def create_prepayment(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`CreatePrepaymentRequest`](../../doc/models/create-prepayment-request.md) | Body, Optional | - | ## Response Type @@ -132,7 +132,7 @@ def list_prepayments(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`ListPrepaymentsFilter`](../../doc/models/list-prepayments-filter.md) | Query, Optional | Filter to use for List Prepayments operations | @@ -200,7 +200,7 @@ def issue_service_credit(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`IssueServiceCreditRequest`](../../doc/models/issue-service-credit-request.md) | Body, Optional | - | ## Response Type @@ -258,7 +258,7 @@ def deduct_service_credit(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`DeductServiceCreditRequest`](../../doc/models/deduct-service-credit-request.md) | Body, Optional | - | ## Response Type @@ -306,7 +306,7 @@ def list_service_credits(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | @@ -386,7 +386,7 @@ def refund_prepayment(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `prepayment_id` | `int` | Template, Required | id of prepayment | | `body` | [`RefundPrepaymentRequest`](../../doc/models/refund-prepayment-request.md) | Body, Optional | - | diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index dfc2f06e..c8a1279a 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -39,7 +39,7 @@ def create_subscription_note(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`UpdateSubscriptionNoteRequest`](../../doc/models/update-subscription-note-request.md) | Body, Optional | Updatable fields for Subscription Note | ## Response Type @@ -85,7 +85,7 @@ def list_subscription_notes(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | @@ -153,7 +153,7 @@ def read_subscription_note(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `note_id` | `int` | Template, Required | The Advanced Billing id of the note | ## Response Type @@ -205,7 +205,7 @@ def update_subscription_note(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `note_id` | `int` | Template, Required | The Advanced Billing id of the note | | `body` | [`UpdateSubscriptionNoteRequest`](../../doc/models/update-subscription-note-request.md) | Body, Optional | Updatable fields for Subscription Note | @@ -244,7 +244,7 @@ print(result) # Delete Subscription Note -Use the following method to delete a note for a Subscription. +Deletes a note for a Subscription. ```python def delete_subscription_note(self, @@ -256,7 +256,7 @@ def delete_subscription_note(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `note_id` | `int` | Template, Required | The Advanced Billing id of the note | ## Response Type diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index fdc2cdcb..bf98aeba 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -83,7 +83,7 @@ def migrate_subscription_product(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`SubscriptionProductMigrationRequest`](../../doc/models/subscription-product-migration-request.md) | Body, Optional | - | ## Response Type @@ -261,7 +261,7 @@ def preview_subscription_product_migration(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`SubscriptionMigrationPreviewRequest`](../../doc/models/subscription-migration-preview-request.md) | Body, Optional | - | ## Response Type diff --git a/doc/controllers/subscription-renewals.md b/doc/controllers/subscription-renewals.md new file mode 100644 index 00000000..73239529 --- /dev/null +++ b/doc/controllers/subscription-renewals.md @@ -0,0 +1,910 @@ +# Subscription Renewals + +```python +subscription_renewals_controller = client.subscription_renewals +``` + +## Class Name + +`SubscriptionRenewalsController` + +## Methods + +* [Create Scheduled Renewal Configuration](../../doc/controllers/subscription-renewals.md#create-scheduled-renewal-configuration) +* [List Scheduled Renewal Configurations](../../doc/controllers/subscription-renewals.md#list-scheduled-renewal-configurations) +* [Read Scheduled Renewal Configuration](../../doc/controllers/subscription-renewals.md#read-scheduled-renewal-configuration) +* [Update Scheduled Renewal Configuration](../../doc/controllers/subscription-renewals.md#update-scheduled-renewal-configuration) +* [Schedule Scheduled Renewal Lock In](../../doc/controllers/subscription-renewals.md#schedule-scheduled-renewal-lock-in) +* [Lock in Scheduled Renewal Immediately](../../doc/controllers/subscription-renewals.md#lock-in-scheduled-renewal-immediately) +* [Unpublish Scheduled Renewal Configuration](../../doc/controllers/subscription-renewals.md#unpublish-scheduled-renewal-configuration) +* [Cancel Scheduled Renewal Configuration](../../doc/controllers/subscription-renewals.md#cancel-scheduled-renewal-configuration) +* [Create Scheduled Renewal Configuration Item](../../doc/controllers/subscription-renewals.md#create-scheduled-renewal-configuration-item) +* [Update Scheduled Renewal Configuration Item](../../doc/controllers/subscription-renewals.md#update-scheduled-renewal-configuration-item) +* [Delete Scheduled Renewal Configuration Item](../../doc/controllers/subscription-renewals.md#delete-scheduled-renewal-configuration-item) + + +# Create Scheduled Renewal Configuration + +Creates a scheduled renewal configuration for a subscription. The scheduled renewal is based on the subscription’s current product and component setup. + +```python +def create_scheduled_renewal_configuration(self, + subscription_id, + body=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `body` | [`ScheduledRenewalConfigurationRequest`](../../doc/models/scheduled-renewal-configuration-request.md) | Body, Optional | - | + +## Response Type + +[`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) + +## Example Usage + +```python +subscription_id = 222 + +body = ScheduledRenewalConfigurationRequest( + renewal_configuration=ScheduledRenewalConfigurationRequestBody( + starts_at=dateutil.parser.parse('2024-12-01T00:00:00Z'), + ends_at=dateutil.parser.parse('2025-12-01T00:00:00Z'), + lock_in_at=dateutil.parser.parse('2024-11-15T00:00:00Z'), + contract_id=222 + ) +) + +result = subscription_renewals_controller.create_scheduled_renewal_configuration( + subscription_id, + body=body +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration": { + "id": 123, + "site_id": 456, + "subscription_id": 12345, + "starts_at": "2024-12-01T00:00:00Z", + "ends_at": "2025-12-01T00:00:00Z", + "lock_in_at": "2024-11-15T00:00:00Z", + "created_at": "2024-09-01T12:00:00Z", + "status": "scheduled", + "scheduled_renewal_configuration_items": [ + { + "id": 789, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 123, + "item_id": 4, + "item_type": "Product", + "item_subclass": "Product", + "price_point_id": 7, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2024-09-01T12:00:00Z" + } + ], + "contract": { + "id": 107, + "maxio_id": "maxio-id", + "number": null, + "register": { + "id": 12, + "maxio_id": "maxio_id-id", + "name": "Register", + "currency_code": "USD" + } + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Scheduled Renewal Configurations + +Lists scheduled renewal configurations for the subscription and permits an optional status query filter. + +```python +def list_scheduled_renewal_configurations(self, + subscription_id, + status=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `status` | [`Status`](../../doc/models/status.md) | Query, Optional | (Optional) Status filter for scheduled renewal configurations. | + +## Response Type + +[`ScheduledRenewalConfigurationsResponse`](../../doc/models/scheduled-renewal-configurations-response.md) + +## Example Usage + +```python +subscription_id = 222 + +result = subscription_renewals_controller.list_scheduled_renewal_configurations(subscription_id) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configurations": [ + { + "id": 123, + "site_id": 456, + "subscription_id": 12345, + "starts_at": "2024-12-01T00:00:00Z", + "ends_at": "2025-12-01T00:00:00Z", + "lock_in_at": "2024-11-15T00:00:00Z", + "created_at": "2024-09-01T12:00:00Z", + "status": "scheduled", + "scheduled_renewal_configuration_items": [ + { + "id": 789, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 123, + "item_id": 4, + "item_type": "Product", + "item_subclass": "Product", + "price_point_id": 7, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2024-09-01T12:00:00Z" + } + ], + "contract": { + "id": 107, + "maxio_id": "maxio-id", + "number": null, + "register": { + "id": 12, + "maxio_id": "maxio-id", + "name": "Register", + "currency_code": "USD" + } + } + } + ] +} +``` + + +# Read Scheduled Renewal Configuration + +Retrieves the configuration settings for the scheduled renewal. + +```python +def read_scheduled_renewal_configuration(self, + subscription_id, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `id` | `int` | Template, Required | The renewal id. | + +## Response Type + +[`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) + +## Example Usage + +```python +subscription_id = 222 + +id = 112 + +result = subscription_renewals_controller.read_scheduled_renewal_configuration( + subscription_id, + id +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration": { + "id": 123, + "site_id": 456, + "subscription_id": 12345, + "starts_at": "2024-12-01T00:00:00Z", + "ends_at": "2025-12-01T00:00:00Z", + "lock_in_at": "2024-11-15T00:00:00Z", + "created_at": "2024-09-01T12:00:00Z", + "status": "scheduled", + "scheduled_renewal_configuration_items": [ + { + "id": 789, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 123, + "item_id": 4, + "item_type": "Product", + "item_subclass": "Product", + "price_point_id": 7, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2024-09-01T12:00:00Z" + } + ], + "contract": { + "id": 107, + "maxio_id": "maxio-id", + "number": null, + "register": { + "id": 12, + "maxio_id": "maxio-id", + "name": "Register", + "currency_code": "USD" + } + } + } +} +``` + + +# Update Scheduled Renewal Configuration + +Updates an existing configuration. + +```python +def update_scheduled_renewal_configuration(self, + subscription_id, + id, + body=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `id` | `int` | Template, Required | The renewal id. | +| `body` | [`ScheduledRenewalConfigurationRequest`](../../doc/models/scheduled-renewal-configuration-request.md) | Body, Optional | - | + +## Response Type + +[`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) + +## Example Usage + +```python +subscription_id = 222 + +id = 112 + +body = ScheduledRenewalConfigurationRequest( + renewal_configuration=ScheduledRenewalConfigurationRequestBody( + starts_at=dateutil.parser.parse('2025-12-01T00:00:00Z'), + ends_at=dateutil.parser.parse('2026-12-01T00:00:00Z'), + lock_in_at=dateutil.parser.parse('2025-11-15T00:00:00Z') + ) +) + +result = subscription_renewals_controller.update_scheduled_renewal_configuration( + subscription_id, + id, + body=body +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration": { + "id": 123, + "site_id": 456, + "subscription_id": 12345, + "starts_at": "2025-12-01T00:00:00Z", + "ends_at": "2026-12-01T00:00:00Z", + "lock_in_at": "2025-11-15T00:00:00Z", + "created_at": "2025-09-01T12:00:00Z", + "status": "scheduled", + "scheduled_renewal_configuration_items": [ + { + "id": 789, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 123, + "item_id": 4, + "item_type": "Product", + "item_subclass": "Product", + "price_point_id": 7, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2025-09-01T12:00:00Z" + } + ], + "contract": { + "id": 107, + "maxio_id": "maxio-id", + "number": null, + "register": { + "id": 12, + "maxio_id": "maxio-id", + "name": "Register", + "currency_code": "USD" + } + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Schedule Scheduled Renewal Lock In + +Schedules a future lock-in date for the renewal. + +```python +def schedule_scheduled_renewal_lock_in(self, + subscription_id, + id, + body=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `id` | `int` | Template, Required | The renewal id. | +| `body` | [`ScheduledRenewalLockInRequest`](../../doc/models/scheduled-renewal-lock-in-request.md) | Body, Optional | - | + +## Response Type + +[`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) + +## Example Usage + +```python +subscription_id = 222 + +id = 112 + +body = ScheduledRenewalLockInRequest( + lock_in_at=dateutil.parser.parse('2025-11-15').date() +) + +result = subscription_renewals_controller.schedule_scheduled_renewal_lock_in( + subscription_id, + id, + body=body +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration": { + "id": 123, + "site_id": 456, + "subscription_id": 12345, + "starts_at": "2025-12-01T00:00:00Z", + "ends_at": "2026-12-01T00:00:00Z", + "lock_in_at": "2025-11-15T00:00:00Z", + "created_at": "2025-09-01T12:00:00Z", + "status": "scheduled", + "scheduled_renewal_configuration_items": [ + { + "id": 789, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 123, + "item_id": 4, + "item_type": "Product", + "item_subclass": "Product", + "price_point_id": 7, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2025-09-01T12:00:00Z" + } + ], + "contract": { + "id": 107, + "maxio_id": "maxio-id", + "number": null, + "register": { + "id": 12, + "maxio_id": "maxio-id", + "name": "Register", + "currency_code": "USD" + } + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Lock in Scheduled Renewal Immediately + +Locks in the renewal immediately. + +```python +def lock_in_scheduled_renewal_immediately(self, + subscription_id, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `id` | `int` | Template, Required | The renewal id. | + +## Response Type + +[`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) + +## Example Usage + +```python +subscription_id = 222 + +id = 112 + +result = subscription_renewals_controller.lock_in_scheduled_renewal_immediately( + subscription_id, + id +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration": { + "id": 987, + "site_id": 321, + "subscription_id": 12345, + "starts_at": "2025-12-01T00:00:00Z", + "ends_at": "2026-12-01T00:00:00Z", + "lock_in_at": "2025-11-15T00:00:00Z", + "created_at": "2025-09-01T12:00:00Z", + "status": "scheduled", + "scheduled_renewal_configuration_items": [ + { + "id": 555, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 987, + "item_id": 42, + "item_type": "Product", + "price_point_id": 73, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2025-09-01T12:00:00Z" + } + ], + "contract": { + "id": 222, + "maxio_id": "maxio-id", + "number": null, + "register": { + "id": 12, + "maxio_id": "maxio-id", + "name": "Register", + "currency_code": "USD" + } + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Unpublish Scheduled Renewal Configuration + +Returns a scheduled renewal configuration to an editable state. + +```python +def unpublish_scheduled_renewal_configuration(self, + subscription_id, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `id` | `int` | Template, Required | The renewal id. | + +## Response Type + +[`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) + +## Example Usage + +```python +subscription_id = 222 + +id = 112 + +result = subscription_renewals_controller.unpublish_scheduled_renewal_configuration( + subscription_id, + id +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration": { + "id": 987, + "site_id": 321, + "subscription_id": 12345, + "starts_at": "2025-12-01T00:00:00Z", + "ends_at": "2026-12-01T00:00:00Z", + "lock_in_at": "2025-11-15T00:00:00Z", + "created_at": "2025-09-01T12:00:00Z", + "status": "draft", + "scheduled_renewal_configuration_items": [ + { + "id": 555, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 987, + "item_id": 42, + "item_type": "Product", + "price_point_id": 73, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2025-09-01T12:00:00Z" + } + ], + "contract": { + "id": 222 + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Cancel Scheduled Renewal Configuration + +Cancels a scheduled renewal configuration. + +```python +def cancel_scheduled_renewal_configuration(self, + subscription_id, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `id` | `int` | Template, Required | The renewal id. | + +## Response Type + +[`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) + +## Example Usage + +```python +subscription_id = 222 + +id = 112 + +result = subscription_renewals_controller.cancel_scheduled_renewal_configuration( + subscription_id, + id +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration": { + "id": 987, + "site_id": 321, + "subscription_id": 12345, + "starts_at": "2025-12-01T00:00:00Z", + "ends_at": "2026-12-01T00:00:00Z", + "lock_in_at": "2025-11-15T00:00:00Z", + "created_at": "2025-09-01T12:00:00Z", + "status": "canceled", + "scheduled_renewal_configuration_items": [ + { + "id": 555, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 987, + "item_id": 42, + "item_type": "Product", + "price_point_id": 73, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2025-09-01T12:00:00Z" + } + ], + "contract": { + "id": 222 + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Create Scheduled Renewal Configuration Item + +Adds product and component line items to the scheduled renewal. + +```python +def create_scheduled_renewal_configuration_item(self, + subscription_id, + scheduled_renewals_configuration_id, + body=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `scheduled_renewals_configuration_id` | `int` | Template, Required | The scheduled renewal configuration id. | +| `body` | [`ScheduledRenewalConfigurationItemRequest`](../../doc/models/scheduled-renewal-configuration-item-request.md) | Body, Optional | - | + +## Response Type + +[`ScheduledRenewalConfigurationItemResponse`](../../doc/models/scheduled-renewal-configuration-item-response.md) + +## Example Usage + +```python +subscription_id = 222 + +scheduled_renewals_configuration_id = 250 + +body = ScheduledRenewalConfigurationItemRequest( + renewal_configuration_item=ScheduledRenewalItemRequestBodyComponent( + item_id=57, + quantity=1, + custom_price=ScheduledRenewalComponentCustomPrice( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=1, + unit_price=5, + ending_quantity=None + ) + ] + ) + ) +) + +result = subscription_renewals_controller.create_scheduled_renewal_configuration_item( + subscription_id, + scheduled_renewals_configuration_id, + body=body +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration_item": { + "id": 555, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 987, + "item_id": 42, + "item_type": "Product", + "item_subclass": "SubscriptionProduct", + "price_point_id": 73, + "price_point_type": "ProductPricePoint", + "quantity": 1, + "decimal_quantity": "1.0", + "created_at": "2025-09-01T12:00:00Z" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Update Scheduled Renewal Configuration Item + +Updates an existing configuration item’s pricing and quantity. + +```python +def update_scheduled_renewal_configuration_item(self, + subscription_id, + scheduled_renewals_configuration_id, + id, + body=None) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `scheduled_renewals_configuration_id` | `int` | Template, Required | The scheduled renewal configuration id. | +| `id` | `int` | Template, Required | The scheduled renewal configuration item id. | +| `body` | [`ScheduledRenewalUpdateRequest`](../../doc/models/scheduled-renewal-update-request.md) | Body, Optional | - | + +## Response Type + +[`ScheduledRenewalConfigurationItemResponse`](../../doc/models/scheduled-renewal-configuration-item-response.md) + +## Example Usage + +```python +subscription_id = 222 + +scheduled_renewals_configuration_id = 250 + +id = 112 + +body = ScheduledRenewalUpdateRequest( + renewal_configuration_item=ScheduledRenewalItemRequestBodyComponent( + item_id=57, + quantity=2, + custom_price=ScheduledRenewalComponentCustomPrice( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=1, + unit_price=5, + ending_quantity=None + ) + ] + ) + ) +) + +result = subscription_renewals_controller.update_scheduled_renewal_configuration_item( + subscription_id, + scheduled_renewals_configuration_id, + id, + body=body +) +print(result) +``` + +## Example Response *(as JSON)* + +```json +{ + "scheduled_renewal_configuration_item": { + "id": 555, + "subscription_id": 12345, + "subscription_renewal_configuration_id": 987, + "item_id": 42, + "item_type": "Component", + "item_subclass": "SubscriptionComponent", + "price_point_id": 73, + "price_point_type": "ComponentPricePoint", + "quantity": 3, + "decimal_quantity": "3.0", + "created_at": "2025-09-01T12:00:00Z" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Delete Scheduled Renewal Configuration Item + +Removes an item from the pending renewal configuration. + +```python +def delete_scheduled_renewal_configuration_item(self, + subscription_id, + scheduled_renewals_configuration_id, + id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `scheduled_renewals_configuration_id` | `int` | Template, Required | The scheduled renewal configuration id. | +| `id` | `int` | Template, Required | The scheduled renewal configuration item id. | + +## Response Type + +`void` + +## Example Usage + +```python +subscription_id = 222 + +scheduled_renewals_configuration_id = 250 + +id = 112 + +subscription_renewals_controller.delete_scheduled_renewal_configuration_item( + subscription_id, + scheduled_renewals_configuration_id, + id +) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 17f6861a..1140e220 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -43,7 +43,7 @@ def retry_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type @@ -203,7 +203,8 @@ print(result) # Cancel Subscription -The DELETE action causes the cancellation of the Subscription. This means, the method sets the Subscription state to "canceled". +Cancels the Subscription. The Delete method sets the Subscription state to `canceled`. +To cancel the subscription immediately, omit any schedule parameters from the request. To use the schedule options, the Schedule Subscription Cancellation feature must be enabled on your site. ```python def cancel_subscription(self, @@ -215,7 +216,7 @@ def cancel_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`CancellationRequest`](../../doc/models/cancellation-request.md) | Body, Optional | - | ## Response Type @@ -382,15 +383,15 @@ Resume a paused (on-hold) subscription. If the normal next renewal date has not ```python def resume_subscription(self, subscription_id, - calendar_billing_resumption_charge='prorated') + calendar_billing_resumption_charge="prorated") ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | -| `calendar_billing_resumption_charge` | [`ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled

**Default**: `'prorated'` | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `calendar_billing_resumption_charge` | [`ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled.

**Default**: `"prorated"` | ## Response Type @@ -539,7 +540,7 @@ def pause_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | ## Response Type @@ -700,7 +701,7 @@ def update_automatic_subscription_resumption(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | ## Response Type @@ -854,7 +855,7 @@ print(result) # Reactivate Subscription -Advanced Billing offers the ability to reactivate a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). +Reactivate a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). **Note: The term "resume" is used also during another process in Advanced Billing. This occurs when an on-hold subscription is "resumed". This returns the subscription to an active state.** @@ -875,6 +876,8 @@ If a reactivation with `resume: true` were attempted _before_ what would have be If a reactivation with `resume: true` were attempted _after_ what would have been the next billing date of July 1st, then Advanced Billing would not resume the subscription, and instead it would be reactivated with a new billing period. +If a reactivation with `resume: false`, or where 'resume" is omited were attempted, then Advanced Billing would reactivate the subscription with a new billing period regardless of whether or not resuming the previous billing period were possible. + | Canceled | Reactivation | Resumable? | |---|---|---| | Jun 15 | June 28 | Yes | @@ -1023,7 +1026,7 @@ def reactivate_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`ReactivateSubscriptionRequest`](../../doc/models/reactivate-subscription-request.md) | Body, Optional | - | ## Response Type @@ -1172,11 +1175,7 @@ print(result) # Initiate Delayed Cancellation -Advanced Billing offers the ability to cancel a subscription at the end of the current billing period. This period is set by its current product. - -Requesting to cancel the subscription at the end of the period sets the `cancel_at_end_of_period` flag to true. - -Note that you cannot set `cancel_at_end_of_period` at subscription creation, or if the subscription is past due. +Cancels a subscription at the end of the current billing period based on the subscription's current product. You cannot set `cancel_at_end_of_period` at subscription creation, or if the subscription is past due. ```python def initiate_delayed_cancellation(self, @@ -1188,7 +1187,7 @@ def initiate_delayed_cancellation(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`CancellationRequest`](../../doc/models/cancellation-request.md) | Body, Optional | - | ## Response Type @@ -1227,7 +1226,7 @@ def cancel_delayed_cancellation(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type @@ -1270,7 +1269,7 @@ def cancel_dunning(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | ## Response Type @@ -1315,7 +1314,7 @@ Optionally, **you may provide your own custom quantities** for any component to ## Subscription Side Effects -You can request a `POST` to obtain this data from the endpoint without any side effects. Plain and simple, this will preview data, not log any changes against a subscription. +You can request a `POST` to obtain this data from the endpoint without any side effects. This method allows you to preview data, but does not log any changes against a subscription. ```python def preview_renewal(self, @@ -1327,7 +1326,7 @@ def preview_renewal(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`RenewalPreviewRequest`](../../doc/models/renewal-preview-request.md) | Body, Optional | - | ## Response Type diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index ce719048..e4c470ae 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -235,7 +235,7 @@ print(result) # List Subscriptions -This method will return an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. +returns an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. ## Search for a subscription @@ -268,7 +268,7 @@ def list_subscriptions(self, | `end_datetime` | `datetime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. | | `metadata` | `Dict[str, str]` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `'signup_date'` | +| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `"signup_date"` | | `include` | [`List[SubscriptionListInclude]`](../../doc/models/subscription-list-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. | ## Response Type @@ -357,7 +357,7 @@ def update_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`UpdateSubscriptionRequest`](../../doc/models/update-subscription-request.md) | Body, Optional | - | ## Response Type @@ -502,7 +502,7 @@ print(result) # Read Subscription -Use this endpoint to find subscription details. +Retrieves subscription details. ## Self-Service Page token @@ -518,7 +518,7 @@ def read_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `include` | [`List[SubscriptionInclude]`](../../doc/models/subscription-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=coupons&include[]=self_service_page_token`. | ## Response Type @@ -714,7 +714,7 @@ def override_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`OverrideSubscriptionRequest`](../../doc/models/override-subscription-request.md) | Body, Optional | Only these fields are available to be set. | ## Response Type @@ -804,7 +804,7 @@ def purge_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `ack` | `int` | Query, Required | id of the customer. | | `cascade` | [`List[SubscriptionPurgeType]`](../../doc/models/subscription-purge-type.md) | Query, Optional | Options are "customer" or "payment_profile".
Use in query: `cascade[]=customer&cascade[]=payment_profile`. | @@ -853,7 +853,7 @@ def update_prepaid_subscription_configuration(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`UpsertPrepaidConfigurationRequest`](../../doc/models/upsert-prepaid-configuration-request.md) | Body, Optional | - | ## Response Type @@ -1102,7 +1102,7 @@ def apply_coupons_to_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `code` | `str` | Query, Optional | A code for the coupon that would be applied to a subscription | | `body` | [`AddCouponsRequest`](../../doc/models/add-coupons-request.md) | Body, Optional | - | @@ -1302,7 +1302,7 @@ def remove_coupon_from_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `coupon_code` | `str` | Query, Optional | The coupon code | ## Response Type @@ -1387,7 +1387,7 @@ def activate_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `body` | [`ActivateSubscriptionRequest`](../../doc/models/activate-subscription-request.md) | Body, Optional | - | ## Response Type diff --git a/doc/models/activate-event-based-component.md b/doc/models/activate-event-based-component.md index eaedd613..5938f472 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -26,6 +26,7 @@ "pricing_scheme": "stairstep", "interval": 66, "interval_unit": "day", + "list_price_point_id": 174, "prices": [ { "starting_quantity": 242, @@ -37,8 +38,7 @@ "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] } } ``` diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index cb48494f..80d9c377 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -13,8 +13,8 @@ | `proration_downgrade_scheme` | `str` | Optional | - | | `allocations` | [`List[CreateAllocation]`](../../doc/models/create-allocation.md) | Optional | - | | `accrue_charge` | `bool` | Optional | - | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription | | `initiate_dunning` | `bool` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | @@ -27,19 +27,19 @@ "allocations": [ { "quantity": 26.48, + "decimal_quantity": "decimal_quantity8", + "previous_quantity": 55.5, + "decimal_previous_quantity": "decimal_previous_quantity2", "component_id": 242, - "memo": "memo6", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "accrue_charge": false + "memo": "memo6" }, { "quantity": 26.48, + "decimal_quantity": "decimal_quantity8", + "previous_quantity": 55.5, + "decimal_previous_quantity": "decimal_previous_quantity2", "component_id": 242, - "memo": "memo6", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "accrue_charge": false + "memo": "memo6" } ], "accrue_charge": false, diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 4e51aa47..74caf08f 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -18,8 +18,8 @@ | `proration_upgrade_scheme` | `str` | Optional | - | | `proration_downgrade_scheme` | `str` | Optional | - | | `accrue_charge` | `bool` | Optional | - | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `price_point_id` | `int` | Optional | - | | `interval` | `int` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | diff --git a/doc/models/allocation-settings.md b/doc/models/allocation-settings.md index 291ee351..e10321f2 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -9,8 +9,8 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `accrue_charge` | `str` | Optional | Either "true" or "false". | ## Example (as JSON) diff --git a/doc/models/allocation.md b/doc/models/allocation.md index deb8421e..cb0c6007 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -28,8 +28,8 @@ | `previous_price_point_id` | `int` | Optional | - | | `accrue_charge` | `bool` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. | | `initiate_dunning` | `bool` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `payment` | [`PaymentForAllocation`](../../doc/models/payment-for-allocation.md) | Optional | - | | `expires_at` | `datetime` | Optional | - | | `used_quantity` | `int` | Optional | - | diff --git a/doc/models/apple-pay-payment-profile.md b/doc/models/apple-pay-payment-profile.md index 02eeb79c..21363428 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -22,7 +22,7 @@ | `billing_country` | `str` | Optional | The current billing address country for the Apple Pay account | | `customer_vault_token` | `str` | Optional | - | | `billing_address_2` | `str` | Optional | The current billing street address, second line, for the Apple Pay account | -| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `'apple_pay'` | +| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `"apple_pay"` | | `site_gateway_setting_id` | `int` | Optional | - | | `gateway_handle` | `str` | Optional | - | | `created_at` | `datetime` | Optional | A timestamp indicating when this payment profile was created | diff --git a/doc/models/apply-credit-note-event.md b/doc/models/apply-credit-note-event.md index 8714576b..552875aa 100644 --- a/doc/models/apply-credit-note-event.md +++ b/doc/models/apply-credit-note-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'apply_credit_note'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"apply_credit_note"` | | `event_data` | [`ApplyCreditNoteEventData`](../../doc/models/apply-credit-note-event-data.md) | Required | Example schema for an `apply_credit_note` event | ## Example (as JSON) diff --git a/doc/models/apply-debit-note-event.md b/doc/models/apply-debit-note-event.md index 98585372..9e927529 100644 --- a/doc/models/apply-debit-note-event.md +++ b/doc/models/apply-debit-note-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'apply_debit_note'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"apply_debit_note"` | | `event_data` | [`ApplyDebitNoteEventData`](../../doc/models/apply-debit-note-event-data.md) | Required | Example schema for an `apply_debit_note` event | ## Example (as JSON) diff --git a/doc/models/apply-payment-event.md b/doc/models/apply-payment-event.md index 11a3d71c..cdb2d959 100644 --- a/doc/models/apply-payment-event.md +++ b/doc/models/apply-payment-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'apply_payment'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"apply_payment"` | | `event_data` | [`ApplyPaymentEventData`](../../doc/models/apply-payment-event-data.md) | Required | Example schema for an `apply_payment` event | ## Example (as JSON) diff --git a/doc/models/available-actions.md b/doc/models/available-actions.md new file mode 100644 index 00000000..29da049d --- /dev/null +++ b/doc/models/available-actions.md @@ -0,0 +1,24 @@ + +# Available Actions + +## Structure + +`AvailableActions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `send_email` | [`SendEmail`](../../doc/models/send-email.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "send_email": { + "can_execute": false, + "url": "url0" + } +} +``` + diff --git a/doc/models/backport-invoice-event.md b/doc/models/backport-invoice-event.md index d9899c32..76145bcf 100644 --- a/doc/models/backport-invoice-event.md +++ b/doc/models/backport-invoice-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'backport_invoice'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"backport_invoice"` | | `event_data` | [`Invoice`](../../doc/models/invoice.md) | Required | Example schema for an `backport_invoice` event | ## Example (as JSON) diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index ba8b5fe3..aa1e9be4 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -27,7 +27,7 @@ | `masked_bank_account_number` | `str` | Required | A string representation of the stored bank account number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’) | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | -| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `'bank_account'` | +| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `"bank_account"` | | `verified` | `bool` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account

**Default**: `False` | | `site_gateway_setting_id` | `int` | Optional | - | | `gateway_handle` | `str` | Optional | - | diff --git a/doc/models/cancellation-options.md b/doc/models/cancellation-options.md index 38c20e0c..c2d397f7 100644 --- a/doc/models/cancellation-options.md +++ b/doc/models/cancellation-options.md @@ -9,15 +9,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `cancellation_message` | `str` | Optional | For your internal use. An indication as to why the subscription is being canceled. | -| `reason_code` | `str` | Optional | The reason code associated with the cancellation. See the list of reason codes associated with your site. | +| `cancellation_message` | `str` | Optional | An indication as to why the subscription is being canceled. For your internal use. | +| `reason_code` | `str` | Optional | The reason code associated with the cancellation. Use the [List Reason Codes](../../doc/controllers/reason-codes.md#list-reason-codes) endpoint to retrieve the reason codes associated with your site. | +| `cancel_at_end_of_period` | `bool` | Optional | When true, the subscription is cancelled at the current period end instead of immediately. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | +| `scheduled_cancellation_at` | `datetime` | Optional | Schedules the cancellation on the provided date. This is option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | +| `refund_prepayment_account_balance` | `bool` | Optional | Applies to prepaid subscriptions. When true, which is the default, the remaining prepaid balance is refunded as part of cancellation processing. When false, prepaid balance is not refunded as part of cancellation processing. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | ## Example (as JSON) ```json { "cancellation_message": "cancellation_message0", - "reason_code": "reason_code6" + "reason_code": "reason_code6", + "cancel_at_end_of_period": false, + "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", + "refund_prepayment_account_balance": false } ``` diff --git a/doc/models/cancellation-request.md b/doc/models/cancellation-request.md index 0599f69e..7b229041 100644 --- a/doc/models/cancellation-request.md +++ b/doc/models/cancellation-request.md @@ -17,7 +17,10 @@ { "subscription": { "cancellation_message": "cancellation_message2", - "reason_code": "reason_code8" + "reason_code": "reason_code8", + "cancel_at_end_of_period": false, + "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", + "refund_prepayment_account_balance": false } } ``` diff --git a/doc/models/change-chargeback-status-event.md b/doc/models/change-chargeback-status-event.md index 4d4a8909..d351a759 100644 --- a/doc/models/change-chargeback-status-event.md +++ b/doc/models/change-chargeback-status-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'change_chargeback_status'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"change_chargeback_status"` | | `event_data` | [`ChangeChargebackStatusEventData`](../../doc/models/change-chargeback-status-event-data.md) | Required | Example schema for an `change_chargeback_status` event | ## Example (as JSON) diff --git a/doc/models/change-invoice-collection-method-event.md b/doc/models/change-invoice-collection-method-event.md index 41043264..cee7a7f2 100644 --- a/doc/models/change-invoice-collection-method-event.md +++ b/doc/models/change-invoice-collection-method-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'change_invoice_collection_method'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"change_invoice_collection_method"` | | `event_data` | [`ChangeInvoiceCollectionMethodEventData`](../../doc/models/change-invoice-collection-method-event-data.md) | Required | Example schema for an `change_invoice_collection_method` event | ## Example (as JSON) diff --git a/doc/models/change-invoice-status-event.md b/doc/models/change-invoice-status-event.md index d14b45e2..86fd1083 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'change_invoice_status'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"change_invoice_status"` | | `event_data` | [`ChangeInvoiceStatusEventData`](../../doc/models/change-invoice-status-event-data.md) | Required | Example schema for an `change_invoice_status` event | ## Example (as JSON) diff --git a/doc/models/clone-component-price-point-request.md b/doc/models/clone-component-price-point-request.md new file mode 100644 index 00000000..25aa3aef --- /dev/null +++ b/doc/models/clone-component-price-point-request.md @@ -0,0 +1,24 @@ + +# Clone Component Price Point Request + +## Structure + +`CloneComponentPricePointRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `price_point` | [`CloneComponentPricePoint`](../../doc/models/clone-component-price-point.md) | Required | - | + +## Example (as JSON) + +```json +{ + "price_point": { + "name": "name0", + "handle": "handle6" + } +} +``` + diff --git a/doc/models/clone-component-price-point.md b/doc/models/clone-component-price-point.md new file mode 100644 index 00000000..ae8e21cf --- /dev/null +++ b/doc/models/clone-component-price-point.md @@ -0,0 +1,23 @@ + +# Clone Component Price Point + +## Structure + +`CloneComponentPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Required | - | +| `handle` | `str` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name2", + "handle": "handle8" +} +``` + diff --git a/doc/models/component-custom-price.md b/doc/models/component-custom-price.md index adf51d9d..59101d58 100644 --- a/doc/models/component-custom-price.md +++ b/doc/models/component-custom-price.md @@ -15,7 +15,9 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components | | `interval` | `int` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -| `prices` | [`List[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1 | +| `list_price_point_id` | `int` | Optional | Optional id of the price point to use for list price calculations when
overriding the customer price. | +| `use_default_list_price` | `bool` | Optional | When true, list price calculations will continue to use the default price point even when a `custom_price` is supplied. | +| `prices` | [`List[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | | `renew_prepaid_allocation` | `bool` | Optional | Applicable only to prepaid usage components. Controls whether the allocated quantity renews each period. | | `rollover_prepaid_remainder` | `bool` | Optional | Applicable only to prepaid usage components. Controls whether remaining units roll over to the next period. | | `expiration_interval` | `int` | Optional | Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover amounts expire. | @@ -36,7 +38,7 @@ Create or update custom pricing unique to the subscription. Used in place of `pr "pricing_scheme": "stairstep", "interval": 162, "interval_unit": "day", - "renew_prepaid_allocation": false + "list_price_point_id": 146 } ``` diff --git a/doc/models/component-price-point-currency-overage-response.md b/doc/models/component-price-point-currency-overage-response.md new file mode 100644 index 00000000..0721f1f9 --- /dev/null +++ b/doc/models/component-price-point-currency-overage-response.md @@ -0,0 +1,27 @@ + +# Component Price Point Currency Overage Response + +## Structure + +`ComponentPricePointCurrencyOverageResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `price_point` | [`CurrencyOveragePrices`](../../doc/models/currency-overage-prices.md) | Required | Extends a component price point with currency overage prices. | + +## Example (as JSON) + +```json +{ + "price_point": { + "id": 248, + "type": "default", + "default": false, + "name": "name0", + "pricing_scheme": "per_unit" + } +} +``` + diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index d9dadde8..74f6f5a6 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -25,7 +25,7 @@ | `tax_included` | `bool` | Optional | - | | `interval` | `int` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -| `currency_prices` | [`List[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. | +| `currency_prices` | [`List[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | | `overage_prices` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | | `overage_pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Applicable only to prepaid usage components. Pricing scheme for overage pricing. | | `renew_prepaid_allocation` | `bool` | Optional | Applicable only to prepaid usage components. Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. | diff --git a/doc/models/component.md b/doc/models/component.md index bcae9eaf..37004c28 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -31,8 +31,8 @@ | `taxable` | `bool` | Optional | Boolean flag describing whether a component is taxable or not. | | `tax_code` | `str` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | | `recurring` | `bool` | Optional | - | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `created_at` | `datetime` | Optional | Timestamp indicating when this component was created | | `updated_at` | `datetime` | Optional | Timestamp indicating when this component was updated | | `archived_at` | `datetime` | Optional | Timestamp indicating when this component was archived | diff --git a/doc/models/containers/clone-component-price-point-component-id.md b/doc/models/containers/clone-component-price-point-component-id.md new file mode 100644 index 00000000..33f25a9e --- /dev/null +++ b/doc/models/containers/clone-component-price-point-component-id.md @@ -0,0 +1,14 @@ + +# Clone Component Price Point Component Id + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/models/containers/clone-component-price-point-price-point-id.md b/doc/models/containers/clone-component-price-point-price-point-id.md new file mode 100644 index 00000000..510a343a --- /dev/null +++ b/doc/models/containers/clone-component-price-point-price-point-id.md @@ -0,0 +1,14 @@ + +# Clone Component Price Point Price Point Id + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md b/doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md new file mode 100644 index 00000000..88108485 --- /dev/null +++ b/doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md @@ -0,0 +1,14 @@ + +# Scheduled Renewal Configuration Item Request Renewal Configuration Item + +## Data Type + +`ScheduledRenewalItemRequestBodyComponent | ScheduledRenewalItemRequestBodyProduct` + +## Cases + +| Type | +| --- | +| [`ScheduledRenewalItemRequestBodyComponent`](../../../doc/models/scheduled-renewal-item-request-body-component.md) | +| [`ScheduledRenewalItemRequestBodyProduct`](../../../doc/models/scheduled-renewal-item-request-body-product.md) | + diff --git a/doc/models/containers/scheduled-renewal-product-price-point-interval.md b/doc/models/containers/scheduled-renewal-product-price-point-interval.md new file mode 100644 index 00000000..ad056bb7 --- /dev/null +++ b/doc/models/containers/scheduled-renewal-product-price-point-interval.md @@ -0,0 +1,14 @@ + +# Scheduled Renewal Product Price Point Interval + +## Data Type + +`str | int` + +## Cases + +| Type | +| --- | +| `str` | +| `int` | + diff --git a/doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md b/doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md new file mode 100644 index 00000000..310b6c3f --- /dev/null +++ b/doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md @@ -0,0 +1,14 @@ + +# Scheduled Renewal Product Price Point Price in Cents + +## Data Type + +`str | int` + +## Cases + +| Type | +| --- | +| `str` | +| `int` | + diff --git a/doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md b/doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md new file mode 100644 index 00000000..b6d6cce8 --- /dev/null +++ b/doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md @@ -0,0 +1,14 @@ + +# Scheduled Renewal Update Request Renewal Configuration Item + +## Data Type + +`ScheduledRenewalItemRequestBodyComponent | ScheduledRenewalItemRequestBodyProduct` + +## Cases + +| Type | +| --- | +| [`ScheduledRenewalItemRequestBodyComponent`](../../../doc/models/scheduled-renewal-item-request-body-component.md) | +| [`ScheduledRenewalItemRequestBodyProduct`](../../../doc/models/scheduled-renewal-item-request-body-product.md) | + diff --git a/doc/models/contract.md b/doc/models/contract.md new file mode 100644 index 00000000..df1cb25b --- /dev/null +++ b/doc/models/contract.md @@ -0,0 +1,34 @@ + +# Contract + +Contract linked to the scheduled renewal configuration. + +## Structure + +`Contract` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Optional | - | +| `maxio_id` | `str` | Optional | - | +| `number` | `str` | Optional | - | +| `register` | [`Register`](../../doc/models/register.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 136, + "maxio_id": "maxio_id8", + "number": "number6", + "register": { + "id": 54, + "maxio_id": "maxio_id4", + "name": "name2", + "currency_code": "currency_code2" + } +} +``` + diff --git a/doc/models/create-allocation-request.md b/doc/models/create-allocation-request.md index c76650cf..e94dd765 100644 --- a/doc/models/create-allocation-request.md +++ b/doc/models/create-allocation-request.md @@ -17,11 +17,11 @@ { "allocation": { "quantity": 228.94, + "decimal_quantity": "decimal_quantity6", + "previous_quantity": 254.04, + "decimal_previous_quantity": "decimal_previous_quantity8", "component_id": 8, - "memo": "memo2", - "proration_downgrade_scheme": "proration_downgrade_scheme4", - "proration_upgrade_scheme": "proration_upgrade_scheme6", - "accrue_charge": false + "memo": "memo2" } } ``` diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 4ea3ad94..cd96a65a 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -10,27 +10,31 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `quantity` | `float` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1for on and 0 for off. | -| `component_id` | `int` | Optional | (required for the multiple allocations endpoint) The id associated with the component for which the allocation is being made | -| `memo` | `str` | Optional | A memo to record along with the allocation | +| `decimal_quantity` | `str` | Optional | Decimal representation of the allocated quantity. Only valid when decimal
allocations are enabled for the component. | +| `previous_quantity` | `float` | Optional | The quantity that was in effect before this allocation. Responses always
include this value; it may be supplied on preview requests to ensure the
expected change is evaluated. | +| `decimal_previous_quantity` | `str` | Optional | Decimal representation of `previous_quantity`. Only valid when decimal
allocations are enabled for the component. | +| `component_id` | `int` | Optional | (required for the multiple allocations endpoint) The id associated with the component for which the allocation is being made. | +| `memo` | `str` | Optional | A memo to record along with the allocation. | | `proration_downgrade_scheme` | `str` | Optional | The scheme used if the proration is a downgrade. Defaults to the site setting if one is not provided. | | `proration_upgrade_scheme` | `str` | Optional | The scheme used if the proration is an upgrade. Defaults to the site setting if one is not provided. | -| `accrue_charge` | `bool` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. Defaults to the site setting if one is not provided. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `downgrade_credit` | [`DowngradeCreditCreditType`](../../doc/models/downgrade-credit-credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Values are:

`full` - A full price credit is added for the amount owed.

`prorated` - A prorated credit is added for the amount owed.

`none` - No charge is added. | +| `upgrade_charge` | [`UpgradeChargeCreditType`](../../doc/models/upgrade-charge-credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Values are:

`full` - A charge is added for the full price of the component.

`prorated` - A charge is added for the prorated price of the component change.

`none` - No charge is added. | +| `accrue_charge` | `bool` | Optional | "If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately.

`true` - Attempt to charge the customer at the next renewal.

`false` - Attempt to charge the customer right away. If it fails, the charge will be accrued until the next renewal.

Defaults to the site setting if unspecified in the request. | | `initiate_dunning` | `bool` | Optional | If set to true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. Defaults to false. | | `price_point_id` | str \| int \| None | Optional | This is a container for one-of cases. | | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. | +| `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ## Example (as JSON) ```json { "quantity": 8.06, + "decimal_quantity": "decimal_quantity4", + "previous_quantity": 218.92, + "decimal_previous_quantity": "decimal_previous_quantity0", "component_id": 192, - "memo": "memo4", - "proration_downgrade_scheme": "proration_downgrade_scheme2", - "proration_upgrade_scheme": "proration_upgrade_scheme4", - "accrue_charge": false + "memo": "memo4" } ``` diff --git a/doc/models/create-credit-note-event.md b/doc/models/create-credit-note-event.md index a98171cd..845483ba 100644 --- a/doc/models/create-credit-note-event.md +++ b/doc/models/create-credit-note-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'create_credit_note'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"create_credit_note"` | | `event_data` | [`CreditNote`](../../doc/models/credit-note.md) | Required | Example schema for an `create_credit_note` event | ## Example (as JSON) diff --git a/doc/models/create-debit-note-event.md b/doc/models/create-debit-note-event.md index e24870b0..f7d242fe 100644 --- a/doc/models/create-debit-note-event.md +++ b/doc/models/create-debit-note-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'create_debit_note'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"create_debit_note"` | | `event_data` | [`DebitNote`](../../doc/models/debit-note.md) | Required | Example schema for an `create_debit_note` event | ## Example (as JSON) diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index 43570fff..e9d50c06 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -18,7 +18,7 @@ | `billing_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | | `shipping_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | | `coupons` | [`List[CreateInvoiceCoupon]`](../../doc/models/create-invoice-coupon.md) | Optional | - | -| `status` | [`CreateInvoiceStatus`](../../doc/models/create-invoice-status.md) | Optional | **Default**: `'open'` | +| `status` | [`CreateInvoiceStatus`](../../doc/models/create-invoice-status.md) | Optional | **Default**: `"open"` | ## Example (as JSON) diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index 92b1bc14..8bf22598 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -13,7 +13,7 @@ | `product_id` | `int` | Optional | The Product ID of the product for which you are creating a subscription. The product ID is not currently published, so we recommend using the API Handle instead. | | `product_price_point_handle` | `str` | Optional | The user-friendly API handle of a product's particular price point. | | `product_price_point_id` | `int` | Optional | The ID of the particular price point on the product. | -| `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription | +| `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. | | `coupon_code` | `str` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | | `coupon_codes` | `List[str]` | Optional | An array for all the coupons attached to the subscription. | | `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index d94b5821..1a754cbc 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -27,6 +27,7 @@ "pricing_scheme": "stairstep", "interval": 66, "interval_unit": "day", + "list_price_point_id": 174, "prices": [ { "starting_quantity": 242, @@ -38,8 +39,7 @@ "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] } } } diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 01e8ec4b..93ac1650 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -30,6 +30,7 @@ "pricing_scheme": "stairstep", "interval": 66, "interval_unit": "day", + "list_price_point_id": 174, "prices": [ { "starting_quantity": 242, @@ -41,8 +42,7 @@ "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] } } ``` diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index b21e0a82..5268e6ed 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -26,7 +26,7 @@ | `billing_country` | `str` | Optional | The current billing address country for the card. | | `customer_vault_token` | `str` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | | `billing_address_2` | `str` | Optional | The current billing street address, second line, for the card. | -| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `'credit_card'` | +| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `"credit_card"` | | `disabled` | `bool` | Optional | - | | `chargify_token` | `str` | Optional | Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | | `site_gateway_setting_id` | `int` | Optional | - | diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index b92ca7b7..f7d2a090 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -2,7 +2,6 @@ # Credit Type The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. -Available values: `full`, `prorated`, `none`. ## Enumeration diff --git a/doc/models/currency-overage-prices.md b/doc/models/currency-overage-prices.md new file mode 100644 index 00000000..4655d663 --- /dev/null +++ b/doc/models/currency-overage-prices.md @@ -0,0 +1,50 @@ + +# Currency Overage Prices + +Extends a component price point with currency overage prices. + +## Structure + +`CurrencyOveragePrices` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Optional | - | +| `mtype` | [`PricePointType`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | +| `default` | `bool` | Optional | Note: Refer to type attribute instead | +| `name` | `str` | Optional | - | +| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | +| `component_id` | `int` | Optional | - | +| `handle` | `str` | Optional | - | +| `archived_at` | `datetime` | Optional | - | +| `created_at` | `datetime` | Optional | - | +| `updated_at` | `datetime` | Optional | - | +| `prices` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | - | +| `use_site_exchange_rate` | `bool` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Defaults to true during creation. | +| `subscription_id` | `int` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | +| `tax_included` | `bool` | Optional | - | +| `interval` | `int` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | +| `currency_prices` | [`List[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | +| `overage_prices` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | +| `overage_pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Applicable only to prepaid usage components. Pricing scheme for overage pricing. | +| `renew_prepaid_allocation` | `bool` | Optional | Applicable only to prepaid usage components. Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. | +| `rollover_prepaid_remainder` | `bool` | Optional | Applicable only to prepaid usage components. Boolean which controls whether or not remaining units should be rolled over to the next period. | +| `expiration_interval` | `int` | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. The number of `expiration_interval_unit`s after which rollover amounts should expire. | +| `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | +| `currency_overage_prices` | [`List[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | Applicable only to prepaid usage components. An array of currency pricing data for overage prices. | + +## Example (as JSON) + +```json +{ + "id": 50, + "type": "catalog", + "default": false, + "name": "name8", + "pricing_scheme": "stairstep" +} +``` + diff --git a/doc/models/deliver-proforma-invoice-request.md b/doc/models/deliver-proforma-invoice-request.md new file mode 100644 index 00000000..a01e3dfa --- /dev/null +++ b/doc/models/deliver-proforma-invoice-request.md @@ -0,0 +1,33 @@ + +# Deliver Proforma Invoice Request + +## Structure + +`DeliverProformaInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipient_emails` | `List[str]` | Optional | - | +| `cc_recipient_emails` | `List[str]` | Optional | - | +| `bcc_recipient_emails` | `List[str]` | Optional | - | + +## Example (as JSON) + +```json +{ + "recipient_emails": [ + "recipient_emails9" + ], + "cc_recipient_emails": [ + "cc_recipient_emails8" + ], + "bcc_recipient_emails": [ + "bcc_recipient_emails2", + "bcc_recipient_emails3", + "bcc_recipient_emails4" + ] +} +``` + diff --git a/doc/models/downgrade-credit-credit-type.md b/doc/models/downgrade-credit-credit-type.md new file mode 100644 index 00000000..50858a3b --- /dev/null +++ b/doc/models/downgrade-credit-credit-type.md @@ -0,0 +1,23 @@ + +# Downgrade Credit Credit Type + +The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Values are: + +`full` - A full price credit is added for the amount owed. + +`prorated` - A prorated credit is added for the amount owed. + +`none` - No charge is added. + +## Enumeration + +`DowngradeCreditCreditType` + +## Fields + +| Name | +| --- | +| `FULL` | +| `PRORATED` | +| `NONE` | + diff --git a/doc/models/failed-payment-event.md b/doc/models/failed-payment-event.md index e0ff2bd4..ce039bb3 100644 --- a/doc/models/failed-payment-event.md +++ b/doc/models/failed-payment-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'failed_payment'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"failed_payment"` | | `event_data` | [`FailedPaymentEventData`](../../doc/models/failed-payment-event-data.md) | Required | Example schema for an `failed_payment` event | ## Example (as JSON) diff --git a/doc/models/issue-invoice-event.md b/doc/models/issue-invoice-event.md index 6f0054bf..4c5a000a 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'issue_invoice'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"issue_invoice"` | | `event_data` | [`IssueInvoiceEventData`](../../doc/models/issue-invoice-event-data.md) | Required | Example schema for an `issue_invoice` event | ## Example (as JSON) diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index 5ceacdc7..d88c9927 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `on_failed_payment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `'leave_open_invoice'` | +| `on_failed_payment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `"leave_open_invoice"` | ## Example (as JSON) diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index 660c33fe..1679d23d 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -13,8 +13,8 @@ | `description` | `str` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | | `handle` | `str` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `price_points` | [`List[ComponentPricePointItem]`](../../doc/models/component-price-point-item.md) | Optional | - | | `unit_price` | str \| float | Required | This is a container for one-of cases. | | `tax_code` | `str` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index dd554eab..50563b62 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -22,7 +22,7 @@ | `billing_country` | `str` | Optional | The current billing address country for the PayPal account | | `customer_vault_token` | `str` | Optional | - | | `billing_address_2` | `str` | Optional | The current billing street address, second line, for the PayPal account | -| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `'paypal_account'` | +| `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `"paypal_account"` | | `site_gateway_setting_id` | `int` | Optional | - | | `gateway_handle` | `str` | Optional | - | | `paypal_email` | `str` | Optional | - | diff --git a/doc/models/prepaid-product-price-point-filter.md b/doc/models/prepaid-product-price-point-filter.md index 305a2d7f..03badb63 100644 --- a/doc/models/prepaid-product-price-point-filter.md +++ b/doc/models/prepaid-product-price-point-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `product_price_point_id` | `str` | Required, Constant | Passed as a parameter to list methods to return only non null values.

**Value**: `'not_null'` | +| `product_price_point_id` | `str` | Required, Constant | Passed as a parameter to list methods to return only non null values.

**Value**: `"not_null"` | ## Example (as JSON) diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 6996ee1a..f7113642 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -16,8 +16,8 @@ | `taxable` | `bool` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`List[Price]`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `price_points` | [`List[CreatePrepaidUsageComponentPricePoint]`](../../doc/models/create-prepaid-usage-component-price-point.md) | Optional | - | | `unit_price` | str \| float \| None | Optional | This is a container for one-of cases. | | `tax_code` | `str` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | diff --git a/doc/models/preview-allocations-request.md b/doc/models/preview-allocations-request.md index f33944e1..cb7beb9f 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -11,8 +11,8 @@ | --- | --- | --- | --- | | `allocations` | [`List[CreateAllocation]`](../../doc/models/create-allocation.md) | Required | - | | `effective_proration_date` | `date` | Optional | To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | ## Example (as JSON) @@ -21,11 +21,11 @@ "allocations": [ { "quantity": 26.48, + "decimal_quantity": "decimal_quantity8", + "previous_quantity": 55.5, + "decimal_previous_quantity": "decimal_previous_quantity2", "component_id": 242, - "memo": "memo6", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "accrue_charge": false + "memo": "memo6" } ], "effective_proration_date": "2023-12-01", diff --git a/doc/models/product-family.md b/doc/models/product-family.md index b97e55be..11ddd169 100644 --- a/doc/models/product-family.md +++ b/doc/models/product-family.md @@ -16,6 +16,7 @@ | `description` | `str` | Optional | - | | `created_at` | `datetime` | Optional | - | | `updated_at` | `datetime` | Optional | - | +| `archived_at` | `datetime` | Optional | Timestamp indicating when this product family was archived. `null` if the product family is not archived. | ## Example (as JSON) diff --git a/doc/models/proforma-invoice.md b/doc/models/proforma-invoice.md index ce3b2cf9..70554a40 100644 --- a/doc/models/proforma-invoice.md +++ b/doc/models/proforma-invoice.md @@ -45,6 +45,7 @@ | `payments` | [`List[ProformaInvoicePayment]`](../../doc/models/proforma-invoice-payment.md) | Optional | - | | `custom_fields` | [`List[InvoiceCustomField]`](../../doc/models/invoice-custom-field.md) | Optional | - | | `public_url` | `str` | Optional | - | +| `available_actions` | [`AvailableActions`](../../doc/models/available-actions.md) | Optional | - | ## Example (as JSON) diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index 535321c2..3fee3ace 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -16,8 +16,8 @@ | `taxable` | `bool` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`List[Price]`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `price_points` | [`List[ComponentPricePointItem]`](../../doc/models/component-price-point-item.md) | Optional | - | | `unit_price` | str \| float \| None | Optional | This is a container for one-of cases. | | `tax_code` | `str` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | diff --git a/doc/models/reactivate-subscription-request.md b/doc/models/reactivate-subscription-request.md index 6aa30b6e..247b3a1d 100644 --- a/doc/models/reactivate-subscription-request.md +++ b/doc/models/reactivate-subscription-request.md @@ -13,7 +13,7 @@ | `include_trial` | `bool` | Optional | If `true` is sent, the reactivated Subscription will include a trial if one is available. If `false` is sent, the trial period will be ignored. | | `preserve_balance` | `bool` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | | `coupon_code` | `str` | Optional | The coupon code to be applied during reactivation. | -| `use_credits_and_prepayments` | `bool` | Optional | If true is sent, Chargify will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | +| `use_credits_and_prepayments` | `bool` | Optional | If true is sent, Advanced Billing will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | | `resume` | bool \| [Resume Options](../../doc/models/resume-options.md) \| None | Optional | This is a container for one-of cases. | ## Example (as JSON) diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index a555fb21..f56885c5 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -11,7 +11,7 @@ These values are only applicable to subscriptions using calendar billing | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `reactivation_charge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

**Default**: `'prorated'` | +| `reactivation_charge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

**Default**: `"prorated"` | ## Example (as JSON) diff --git a/doc/models/refund-invoice-event.md b/doc/models/refund-invoice-event.md index cad9d2bb..32dfbc19 100644 --- a/doc/models/refund-invoice-event.md +++ b/doc/models/refund-invoice-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'refund_invoice'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"refund_invoice"` | | `event_data` | [`RefundInvoiceEventData`](../../doc/models/refund-invoice-event-data.md) | Required | Example schema for an `refund_invoice` event | ## Example (as JSON) diff --git a/doc/models/register.md b/doc/models/register.md new file mode 100644 index 00000000..0b165c99 --- /dev/null +++ b/doc/models/register.md @@ -0,0 +1,27 @@ + +# Register + +## Structure + +`Register` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Optional | - | +| `maxio_id` | `str` | Optional | - | +| `name` | `str` | Optional | - | +| `currency_code` | `str` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | + +## Example (as JSON) + +```json +{ + "id": 90, + "maxio_id": "maxio_id0", + "name": "name6", + "currency_code": "currency_code2" +} +``` + diff --git a/doc/models/remove-payment-event.md b/doc/models/remove-payment-event.md index bc4db9e6..5d162f57 100644 --- a/doc/models/remove-payment-event.md +++ b/doc/models/remove-payment-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'remove_payment'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"remove_payment"` | | `event_data` | [`RemovePaymentEventData`](../../doc/models/remove-payment-event-data.md) | Required | Example schema for an `remove_payment` event | ## Example (as JSON) diff --git a/doc/models/scheduled-renewal-component-custom-price.md b/doc/models/scheduled-renewal-component-custom-price.md new file mode 100644 index 00000000..d629aa3e --- /dev/null +++ b/doc/models/scheduled-renewal-component-custom-price.md @@ -0,0 +1,33 @@ + +# Scheduled Renewal Component Custom Price + +Custom pricing for a component within a scheduled renewal. + +## Structure + +`ScheduledRenewalComponentCustomPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `tax_included` | `bool` | Optional | Whether or not the price point includes tax | +| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components | +| `prices` | [`List[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | + +## Example (as JSON) + +```json +{ + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ], + "tax_included": false +} +``` + diff --git a/doc/models/scheduled-renewal-configuration-item-request.md b/doc/models/scheduled-renewal-configuration-item-request.md new file mode 100644 index 00000000..1c50749a --- /dev/null +++ b/doc/models/scheduled-renewal-configuration-item-request.md @@ -0,0 +1,42 @@ + +# Scheduled Renewal Configuration Item Request + +## Structure + +`ScheduledRenewalConfigurationItemRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `renewal_configuration_item` | [Scheduled Renewal Item Request Body Component](../../doc/models/scheduled-renewal-item-request-body-component.md) \| [Scheduled Renewal Item Request Body Product](../../doc/models/scheduled-renewal-item-request-body-product.md) | Required | This is a container for one-of cases. | + +## Example (as JSON) + +```json +{ + "renewal_configuration_item": { + "item_type": "Component", + "item_id": 108, + "price_point_id": 122, + "quantity": 212, + "custom_price": { + "tax_included": false, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + }, + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ] + } + } +} +``` + diff --git a/doc/models/scheduled-renewal-configuration-item-response.md b/doc/models/scheduled-renewal-configuration-item-response.md new file mode 100644 index 00000000..ec6dbeda --- /dev/null +++ b/doc/models/scheduled-renewal-configuration-item-response.md @@ -0,0 +1,27 @@ + +# Scheduled Renewal Configuration Item Response + +## Structure + +`ScheduledRenewalConfigurationItemResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `scheduled_renewal_configuration_item` | [`ScheduledRenewalConfigurationItem`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "scheduled_renewal_configuration_item": { + "id": 98, + "subscription_id": 208, + "subscription_renewal_configuration_id": 108, + "item_id": 246, + "item_type": "item_type2" + } +} +``` + diff --git a/doc/models/scheduled-renewal-configuration-item.md b/doc/models/scheduled-renewal-configuration-item.md new file mode 100644 index 00000000..15391d9f --- /dev/null +++ b/doc/models/scheduled-renewal-configuration-item.md @@ -0,0 +1,35 @@ + +# Scheduled Renewal Configuration Item + +## Structure + +`ScheduledRenewalConfigurationItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Optional | - | +| `subscription_id` | `int` | Optional | - | +| `subscription_renewal_configuration_id` | `int` | Optional | - | +| `item_id` | `int` | Optional | - | +| `item_type` | `str` | Optional | - | +| `item_subclass` | `str` | Optional | - | +| `price_point_id` | `int` | Optional | - | +| `price_point_type` | `str` | Optional | - | +| `quantity` | `int` | Optional | - | +| `decimal_quantity` | `str` | Optional | - | +| `created_at` | `datetime` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 146, + "subscription_id": 0, + "subscription_renewal_configuration_id": 156, + "item_id": 38, + "item_type": "item_type4" +} +``` + diff --git a/doc/models/scheduled-renewal-configuration-request-body.md b/doc/models/scheduled-renewal-configuration-request-body.md new file mode 100644 index 00000000..fc5f0dbd --- /dev/null +++ b/doc/models/scheduled-renewal-configuration-request-body.md @@ -0,0 +1,29 @@ + +# Scheduled Renewal Configuration Request Body + +## Structure + +`ScheduledRenewalConfigurationRequestBody` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `starts_at` | `datetime` | Optional | (Optional) Start of the renewal term. | +| `ends_at` | `datetime` | Optional | (Optional) End of the renewal term. | +| `lock_in_at` | `datetime` | Optional | (Optional) Lock-in date for the renewal. | +| `contract_id` | `int` | Optional | (Optional) Existing contract to associate with the scheduled renewal. Contracts must be enabled for your site. | +| `create_new_contract` | `bool` | Optional | (Optional) Set to true to create a new contract when contracts are enabled. Contracts must be enabled for your site. | + +## Example (as JSON) + +```json +{ + "starts_at": "2016-03-13T12:52:32.123Z", + "ends_at": "2016-03-13T12:52:32.123Z", + "lock_in_at": "2016-03-13T12:52:32.123Z", + "contract_id": 110, + "create_new_contract": false +} +``` + diff --git a/doc/models/scheduled-renewal-configuration-request.md b/doc/models/scheduled-renewal-configuration-request.md new file mode 100644 index 00000000..a3e40f78 --- /dev/null +++ b/doc/models/scheduled-renewal-configuration-request.md @@ -0,0 +1,27 @@ + +# Scheduled Renewal Configuration Request + +## Structure + +`ScheduledRenewalConfigurationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `renewal_configuration` | [`ScheduledRenewalConfigurationRequestBody`](../../doc/models/scheduled-renewal-configuration-request-body.md) | Required | - | + +## Example (as JSON) + +```json +{ + "renewal_configuration": { + "starts_at": "2016-03-13T12:52:32.123Z", + "ends_at": "2016-03-13T12:52:32.123Z", + "lock_in_at": "2016-03-13T12:52:32.123Z", + "contract_id": 244, + "create_new_contract": false + } +} +``` + diff --git a/doc/models/scheduled-renewal-configuration-response.md b/doc/models/scheduled-renewal-configuration-response.md new file mode 100644 index 00000000..8869eaba --- /dev/null +++ b/doc/models/scheduled-renewal-configuration-response.md @@ -0,0 +1,27 @@ + +# Scheduled Renewal Configuration Response + +## Structure + +`ScheduledRenewalConfigurationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `scheduled_renewal_configuration` | [`ScheduledRenewalConfiguration`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "scheduled_renewal_configuration": { + "id": 134, + "site_id": 60, + "subscription_id": 244, + "starts_at": "2016-03-13T12:52:32.123Z", + "ends_at": "2016-03-13T12:52:32.123Z" + } +} +``` + diff --git a/doc/models/scheduled-renewal-configuration.md b/doc/models/scheduled-renewal-configuration.md new file mode 100644 index 00000000..df1bac2b --- /dev/null +++ b/doc/models/scheduled-renewal-configuration.md @@ -0,0 +1,34 @@ + +# Scheduled Renewal Configuration + +## Structure + +`ScheduledRenewalConfiguration` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Optional | ID of the renewal. | +| `site_id` | `int` | Optional | ID of the site to which the renewal belongs. | +| `subscription_id` | `int` | Optional | The id of the subscription. | +| `starts_at` | `datetime` | Optional | - | +| `ends_at` | `datetime` | Optional | - | +| `lock_in_at` | `datetime` | Optional | - | +| `created_at` | `datetime` | Optional | - | +| `status` | `str` | Optional | - | +| `scheduled_renewal_configuration_items` | [`List[ScheduledRenewalConfigurationItem]`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | +| `contract` | [`Contract`](../../doc/models/contract.md) | Optional | Contract linked to the scheduled renewal configuration. | + +## Example (as JSON) + +```json +{ + "id": 152, + "site_id": 78, + "subscription_id": 6, + "starts_at": "2016-03-13T12:52:32.123Z", + "ends_at": "2016-03-13T12:52:32.123Z" +} +``` + diff --git a/doc/models/scheduled-renewal-configurations-response.md b/doc/models/scheduled-renewal-configurations-response.md new file mode 100644 index 00000000..2f494fe5 --- /dev/null +++ b/doc/models/scheduled-renewal-configurations-response.md @@ -0,0 +1,43 @@ + +# Scheduled Renewal Configurations Response + +## Structure + +`ScheduledRenewalConfigurationsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `scheduled_renewal_configurations` | [`List[ScheduledRenewalConfiguration]`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "scheduled_renewal_configurations": [ + { + "id": 122, + "site_id": 48, + "subscription_id": 232, + "starts_at": "2016-03-13T12:52:32.123Z", + "ends_at": "2016-03-13T12:52:32.123Z" + }, + { + "id": 122, + "site_id": 48, + "subscription_id": 232, + "starts_at": "2016-03-13T12:52:32.123Z", + "ends_at": "2016-03-13T12:52:32.123Z" + }, + { + "id": 122, + "site_id": 48, + "subscription_id": 232, + "starts_at": "2016-03-13T12:52:32.123Z", + "ends_at": "2016-03-13T12:52:32.123Z" + } + ] +} +``` + diff --git a/doc/models/scheduled-renewal-item-request-body-component.md b/doc/models/scheduled-renewal-item-request-body-component.md new file mode 100644 index 00000000..d6c97f80 --- /dev/null +++ b/doc/models/scheduled-renewal-item-request-body-component.md @@ -0,0 +1,44 @@ + +# Scheduled Renewal Item Request Body Component + +## Structure + +`ScheduledRenewalItemRequestBodyComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `item_type` | `str` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `"Component"` | +| `item_id` | `int` | Required | Product or component identifier. | +| `price_point_id` | `int` | Optional | Price point identifier. | +| `quantity` | `int` | Optional | Optional quantity for the item. | +| `custom_price` | [`ScheduledRenewalComponentCustomPrice`](../../doc/models/scheduled-renewal-component-custom-price.md) | Optional | Custom pricing for a component within a scheduled renewal. | + +## Example (as JSON) + +```json +{ + "item_type": "Component", + "item_id": 108, + "price_point_id": 122, + "quantity": 212, + "custom_price": { + "tax_included": false, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + }, + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ] + } +} +``` + diff --git a/doc/models/scheduled-renewal-item-request-body-product.md b/doc/models/scheduled-renewal-item-request-body-product.md new file mode 100644 index 00000000..d644f2c5 --- /dev/null +++ b/doc/models/scheduled-renewal-item-request-body-product.md @@ -0,0 +1,38 @@ + +# Scheduled Renewal Item Request Body Product + +## Structure + +`ScheduledRenewalItemRequestBodyProduct` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `item_type` | `str` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `"Product"` | +| `item_id` | `int` | Required | Product or component identifier. | +| `price_point_id` | `int` | Optional | Price point identifier. | +| `quantity` | `int` | Optional | Optional quantity for the item. | +| `custom_price` | [`ScheduledRenewalProductPricePoint`](../../doc/models/scheduled-renewal-product-price-point.md) | Optional | Custom pricing for a product within a scheduled renewal. | + +## Example (as JSON) + +```json +{ + "item_type": "Product", + "item_id": 32, + "price_point_id": 18, + "quantity": 96, + "custom_price": { + "name": "name4", + "handle": "handle0", + "price_in_cents": "String3", + "interval": "String3", + "interval_unit": "day", + "tax_included": false, + "initial_charge_in_cents": 30, + "expiration_interval": 52 + } +} +``` + diff --git a/doc/models/scheduled-renewal-lock-in-request.md b/doc/models/scheduled-renewal-lock-in-request.md new file mode 100644 index 00000000..7c2c804f --- /dev/null +++ b/doc/models/scheduled-renewal-lock-in-request.md @@ -0,0 +1,21 @@ + +# Scheduled Renewal Lock in Request + +## Structure + +`ScheduledRenewalLockInRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `lock_in_at` | `date` | Required | Date to lock in the renewal. | + +## Example (as JSON) + +```json +{ + "lock_in_at": "2016-03-13" +} +``` + diff --git a/doc/models/scheduled-renewal-product-price-point.md b/doc/models/scheduled-renewal-product-price-point.md new file mode 100644 index 00000000..2c266437 --- /dev/null +++ b/doc/models/scheduled-renewal-product-price-point.md @@ -0,0 +1,38 @@ + +# Scheduled Renewal Product Price Point + +Custom pricing for a product within a scheduled renewal. + +## Structure + +`ScheduledRenewalProductPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Optional | (Optional) | +| `handle` | `str` | Optional | (Optional) | +| `price_in_cents` | str \| int | Required | This is a container for one-of cases. | +| `interval` | str \| int | Required | This is a container for one-of cases. | +| `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | Required if using `custom_price` attribute. | +| `tax_included` | `bool` | Optional | (Optional) | +| `initial_charge_in_cents` | `int` | Optional | The product price point initial charge, in integer cents. | +| `expiration_interval` | `int` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | +| `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | + +## Example (as JSON) + +```json +{ + "name": "name4", + "handle": "handle0", + "price_in_cents": "String3", + "interval": "String9", + "interval_unit": "day", + "tax_included": false, + "initial_charge_in_cents": 86, + "expiration_interval": 108 +} +``` + diff --git a/doc/models/scheduled-renewal-update-request.md b/doc/models/scheduled-renewal-update-request.md new file mode 100644 index 00000000..01fa85c0 --- /dev/null +++ b/doc/models/scheduled-renewal-update-request.md @@ -0,0 +1,42 @@ + +# Scheduled Renewal Update Request + +## Structure + +`ScheduledRenewalUpdateRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `renewal_configuration_item` | [Scheduled Renewal Item Request Body Component](../../doc/models/scheduled-renewal-item-request-body-component.md) \| [Scheduled Renewal Item Request Body Product](../../doc/models/scheduled-renewal-item-request-body-product.md) | Required | This is a container for one-of cases. | + +## Example (as JSON) + +```json +{ + "renewal_configuration_item": { + "item_type": "Component", + "item_id": 108, + "price_point_id": 122, + "quantity": 212, + "custom_price": { + "tax_included": false, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + }, + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ] + } + } +} +``` + diff --git a/doc/models/send-email.md b/doc/models/send-email.md new file mode 100644 index 00000000..2f7d1371 --- /dev/null +++ b/doc/models/send-email.md @@ -0,0 +1,23 @@ + +# Send Email + +## Structure + +`SendEmail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `can_execute` | `bool` | Required | - | +| `url` | `str` | Required | - | + +## Example (as JSON) + +```json +{ + "can_execute": false, + "url": "url2" +} +``` + diff --git a/doc/models/send-invoice-request.md b/doc/models/send-invoice-request.md index ca30104b..a0659fe3 100644 --- a/doc/models/send-invoice-request.md +++ b/doc/models/send-invoice-request.md @@ -12,6 +12,7 @@ | `recipient_emails` | `List[str]` | Optional | **Constraints**: *Maximum Items*: `5` | | `cc_recipient_emails` | `List[str]` | Optional | **Constraints**: *Maximum Items*: `5` | | `bcc_recipient_emails` | `List[str]` | Optional | **Constraints**: *Maximum Items*: `5` | +| `attachment_urls` | `List[str]` | Optional | Array of URLs to files to attach to the invoice email. Max 10 files, 10MB each.

**Constraints**: *Maximum Items*: `10` | ## Example (as JSON) @@ -27,6 +28,10 @@ ], "bcc_recipient_emails": [ "bcc_recipient_emails6" + ], + "attachment_urls": [ + "attachment_urls0", + "attachment_urls1" ] } ``` diff --git a/doc/models/status.md b/doc/models/status.md new file mode 100644 index 00000000..3531d2ce --- /dev/null +++ b/doc/models/status.md @@ -0,0 +1,18 @@ + +# Status + +## Enumeration + +`Status` + +## Fields + +| Name | +| --- | +| `DRAFT` | +| `SCHEDULED` | +| `PENDING` | +| `CANCELED` | +| `ACTIVE` | +| `FULFILLED` | + diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 4bb95044..c6f56e85 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -22,8 +22,8 @@ | `component_handle` | `str` | Optional | - | | `subscription_id` | `int` | Optional | - | | `recurring` | `bool` | Optional | - | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `archived_at` | `datetime` | Optional | - | | `price_point_id` | `int` | Optional | - | | `price_point_handle` | `str` | Optional | - | diff --git a/doc/models/subscription-custom-price.md b/doc/models/subscription-custom-price.md index 2229e58d..5655f26a 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -1,7 +1,7 @@ # Subscription Custom Price -(Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription +(Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. ## Structure diff --git a/doc/models/subscription-group-component-custom-price.md b/doc/models/subscription-group-component-custom-price.md index 644c5a56..90bdedde 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -33,14 +33,14 @@ Used in place of `price_point_id` to define a custom price point unique to the s "pricing_scheme": "stairstep", "interval": 230, "interval_unit": "day", + "list_price_point_id": 10, "prices": [ { "starting_quantity": 242, "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] } ] } diff --git a/doc/models/subscription-group-response.md b/doc/models/subscription-group-response.md index 7a1b1923..34401973 100644 --- a/doc/models/subscription-group-response.md +++ b/doc/models/subscription-group-response.md @@ -16,6 +16,7 @@ ```json { "subscription_group": { + "uid": "uid8", "customer_id": 220, "payment_profile": { "id": 44, @@ -27,8 +28,7 @@ "subscription_ids": [ 74, 75 - ], - "created_at": "2016-03-13T12:52:32.123Z" + ] } } ``` diff --git a/doc/models/subscription-group-signup-component.md b/doc/models/subscription-group-signup-component.md index 2c6068c4..2ae41906 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -43,42 +43,42 @@ "pricing_scheme": "stairstep", "interval": 230, "interval_unit": "day", + "list_price_point_id": 10, "prices": [ { "starting_quantity": 242, "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] }, { "tax_included": false, "pricing_scheme": "stairstep", "interval": 230, "interval_unit": "day", + "list_price_point_id": 10, "prices": [ { "starting_quantity": 242, "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] }, { "tax_included": false, "pricing_scheme": "stairstep", "interval": 230, "interval_unit": "day", + "list_price_point_id": 10, "prices": [ { "starting_quantity": 242, "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] } ] } diff --git a/doc/models/subscription-group-signup-item.md b/doc/models/subscription-group-signup-item.md index 54462f8e..f1d30ca1 100644 --- a/doc/models/subscription-group-signup-item.md +++ b/doc/models/subscription-group-signup-item.md @@ -19,7 +19,7 @@ | `currency` | `str` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | | `coupon_codes` | `List[str]` | Optional | An array for all the coupons attached to the subscription. | | `components` | [`List[SubscriptionGroupSignupComponent]`](../../doc/models/subscription-group-signup-component.md) | Optional | - | -| `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription | +| `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. | | `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | | `metafields` | `Dict[str, str]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | diff --git a/doc/models/subscription-group.md b/doc/models/subscription-group.md index 17331bfb..5cb5c28f 100644 --- a/doc/models/subscription-group.md +++ b/doc/models/subscription-group.md @@ -9,6 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | +| `uid` | `str` | Optional | - | | `customer_id` | `int` | Optional | - | | `payment_profile` | [`SubscriptionGroupPaymentProfile`](../../doc/models/subscription-group-payment-profile.md) | Optional | - | | `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | @@ -19,6 +20,7 @@ ```json { + "uid": "uid4", "customer_id": 36, "payment_profile": { "id": 44, @@ -31,8 +33,7 @@ 146, 147, 148 - ], - "created_at": "2016-03-13T12:52:32.123Z" + ] } ``` diff --git a/doc/models/subscription-sort.md b/doc/models/subscription-sort.md index 8ccb033b..b07e8ee0 100644 --- a/doc/models/subscription-sort.md +++ b/doc/models/subscription-sort.md @@ -15,4 +15,8 @@ | `NEXT_ASSESSMENT` | | `UPDATED_AT` | | `CREATED_AT` | +| `TOTAL_PAYMENTS` | +| `ID` | +| `OPEN_BALANCE` | +| `EXPIRES_AT` | diff --git a/doc/models/subscription.md b/doc/models/subscription.md index 863b8df4..199821b7 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -46,7 +46,7 @@ | `next_product_handle` | `str` | Optional | If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. | | `coupon_use_count` | `int` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | | `coupon_uses_allowed` | `int` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | -| `reason_code` | `str` | Optional | If the subscription is canceled, this is their churn code. | +| `reason_code` | `str` | Optional | The churn reason code associated to a cancelled subscription. | | `automatically_resume_at` | `datetime` | Optional | The date the subscription is scheduled to automatically resume from the on_hold state. | | `coupon_codes` | `List[str]` | Optional | An array for all the coupons attached to the subscription. | | `offer_id` | `int` | Optional | The ID of the offer associated with the subscription. | @@ -57,7 +57,7 @@ | `next_product_price_point_id` | `int` | Optional | If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal. | | `net_terms` | `int` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | | `stored_credential_transaction_id` | `int` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | -| `reference` | `str` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `reference` | `str` | Optional | The reference value (provided by your app) for the subscription istelf. | | `on_hold_at` | `datetime` | Optional | The timestamp of the most recent on hold action. | | `prepaid_dunning` | `bool` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | | `coupons` | [`List[SubscriptionIncludedCoupon]`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`.
Only in Read Subscription Endpoint. | diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index f37917f3..0321d5cc 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `kind` | [`TaxConfigurationKind`](../../doc/models/tax-configuration-kind.md) | Optional | **Default**: `'custom'` | +| `kind` | [`TaxConfigurationKind`](../../doc/models/tax-configuration-kind.md) | Optional | **Default**: `"custom"` | | `destination_address` | [`TaxDestinationAddress`](../../doc/models/tax-destination-address.md) | Optional | - | | `fully_configured` | `bool` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview

**Default**: `False` | diff --git a/doc/models/update-component.md b/doc/models/update-component.md index bc079e1d..5e5feb57 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -17,7 +17,7 @@ | `tax_code` | `str` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | | `item_category` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `display_on_hosted_page` | `bool` | Optional | - | -| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | ## Example (as JSON) diff --git a/doc/models/update-subscription-component.md b/doc/models/update-subscription-component.md index d07141da..a6d57d84 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -22,6 +22,7 @@ "pricing_scheme": "stairstep", "interval": 66, "interval_unit": "day", + "list_price_point_id": 174, "prices": [ { "starting_quantity": 242, @@ -33,8 +34,7 @@ "ending_quantity": 40, "unit_price": 23.26 } - ], - "renew_prepaid_allocation": false + ] } } ``` diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index 4067a5f8..863b2dfa 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -25,7 +25,7 @@ | `net_terms` | str \| int \| None | Optional | This is a container for one-of cases. | | `stored_credential_transaction_id` | `int` | Optional | - | | `reference` | `str` | Optional | - | -| `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription | +| `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. | | `components` | [`List[UpdateSubscriptionComponent]`](../../doc/models/update-subscription-component.md) | Optional | (Optional) An array of component ids and custom prices to be added to the subscription. | | `dunning_communication_delay_enabled` | `bool` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. | | `dunning_communication_delay_time_zone` | `str` | Optional | Time zone for the Dunning Communication Delay feature. | diff --git a/doc/models/upgrade-charge-credit-type.md b/doc/models/upgrade-charge-credit-type.md new file mode 100644 index 00000000..3bc95abc --- /dev/null +++ b/doc/models/upgrade-charge-credit-type.md @@ -0,0 +1,23 @@ + +# Upgrade Charge Credit Type + +The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Values are: + +`full` - A charge is added for the full price of the component. + +`prorated` - A charge is added for the prorated price of the component change. + +`none` - No charge is added. + +## Enumeration + +`UpgradeChargeCreditType` + +## Fields + +| Name | +| --- | +| `FULL` | +| `PRORATED` | +| `NONE` | + diff --git a/doc/models/void-invoice-event.md b/doc/models/void-invoice-event.md index 8296d93f..6b9dd513 100644 --- a/doc/models/void-invoice-event.md +++ b/doc/models/void-invoice-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'void_invoice'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"void_invoice"` | | `event_data` | [`VoidInvoiceEventData`](../../doc/models/void-invoice-event-data.md) | Required | Example schema for an `void_invoice` event | ## Example (as JSON) diff --git a/doc/models/void-remainder-event.md b/doc/models/void-remainder-event.md index 2d4d838f..746f3464 100644 --- a/doc/models/void-remainder-event.md +++ b/doc/models/void-remainder-event.md @@ -12,7 +12,7 @@ | `id` | `int` | Required | - | | `timestamp` | `datetime` | Required | - | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `'void_remainder'` | +| `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"void_remainder"` | | `event_data` | [`VoidRemainderEventData`](../../doc/models/void-remainder-event-data.md) | Required | Example schema for an `void_remainder` event | ## Example (as JSON) diff --git a/pyproject.toml b/pyproject.toml index a4f195f4..8dff6ed1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "maxio-advanced-billing-sdk" description = "Ultimate billing and pricing flexibility for B2B SaaS.\nMaxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments." -version = "8.0.0" +version = "9.0.0" readme = "README.md" keywords = ["Maxio", "Advaced Billing", "Payments", "Subscription"] dependencies = ["apimatic-core~=0.2.0, >= 0.2.24", "apimatic-core-interfaces~=0.1.0, >= 0.1.8", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.10", "python-dotenv>=0.21, <2.0", "deprecation~=2.1"] diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000..e151085b --- /dev/null +++ b/ruff.toml @@ -0,0 +1,109 @@ +# Enable all Ruff rules (including flake8-bugbear `B`) + +select = ["ALL"] +ignore = [ + # Conflicting or Redundant Rules + "D203", # or "D211", not both + "D213", # or "D212", not both + + # Complexity / Performance Issues + "C901", # `__init__` is too complex (21 > 10) + "PLR0912", # Too many branches (14 > 12) + "PLR0913", # Too many arguments in function definition (11 > 5) + "PLR0915", # Too many statements (128 > 50) + "PERF401", # Use a list comprehension to create a transformed list + "TC002", # Move third-party import `` into a type-checking block + + # Typing Issues + "ANN001", # Missing type annotation for function argument `` + "ANN003", # Missing type annotation for `**overrides` + "ANN201", # Missing return type annotation for public function `` + "ANN202", # Missing return type annotation for private function `_apply_on_token_update_callback` + "ANN204", # Missing return type annotation for special method `` + "ANN205", # Missing return type annotation for staticmethod + "ANN206", # Missing return type annotation for classmethod `` + "ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `obj` + "FBT002", # Boolean default positional argument in function definition + "FBT003", # Boolean positional value in function call + "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` + "UP004", # Class `` inherits from `object` + "UP006", # Use `list` instead of `List` for type annotation + "UP007", # Use `X | Y` for type annotations + "UP035", # Import from `collections.abc` instead: `Callable` + "UP045", # Use `X | None` for type annotations + + # Docstrings / Style + "D101", # Missing docstring in public class + "D104", # Missing docstring in public package + "D200", # One-line docstring should fit on one line + "D205", # 1 blank line required between summary line and description + "D207", # Docstring is under-indented + "D208", # Docstring is over-indented + "D212", # Multi-line docstring summary should start at the first line + "D301", # Use `r"""` if any backslashes in a docstring + "D400", # First line should end with a period + "D404", # First word of the docstring should not be "This" + "D405", # Section name should be properly capitalized ("TODO") + "D411", # [*] Missing blank line before section ("Note") + "D414", # Section has no content ("TODO") + "D415", # First line should end with a period, question mark, or exclamation point + "D416", # Section name should end with a colon ("TODO") + "D417", # Missing argument description in the docstring for `start_site_packet_capture`: `body` + "RUF001", # String contains ambiguous `’` + "RUF002", # Docstring contains ambiguous ` ` (NO-BREAK SPACE). Did you mean ` ` (SPACE)? + "RUF100", # Unused `noqa` directive + "PLC0415", # `import` should be at the top-level of a file + "W605", # [*] Invalid escape sequence: `\_` + + # Exceptions / Error Handling + "BLE001", # Do not catch blind exception: `Exception` + "E741", # Ambiguous variable name: `O` + "E722", # Do not use bare `except` + "EM101", # Exception must not use a string literal, assign to variable first + "N818", # Exception name `APIException` should be named with an Error suffix + "S110", # `try`-`except`-`pass` detected, consider logging the exception + "SIM103", # Return the condition `isinstance(dictionary, dict)` directly + "SIM101", # Multiple `isinstance` calls for `event`, merge into a single call + "SIM118", # Use `key in dict` instead of `key in dict.keys()` + "TRY003", # Avoid specifying long messages outside the exception class + "TRY300", # Consider moving this statement to an `else` block + + # Security / Hardcoded values + "B006", # Do not use mutable data structures for argument defaults + "S101", # Use of `assert` detected + "S105", # Possible hardcoded password assigned to: "SECRET_KEY" + "S106", # Possible hardcoded password assigned to argument: "o_auth_client_secret" + "S107", # Possible hardcoded password assigned to function default: "token" + + # Imports / Modules + "TC001", # Move application import into a type-checking block + "TC002", # Move third-party import into a type-checking block + + # Shadowing / Builtins + "A001", # Variable `id` is shadowing a Python builtin + "A002", # Function argument `input` is shadowing a Python builtin + "A004", # Import `AttributeError` is shadowing a Python builtin + + # Miscellaneous + "ARG002", # Unused method argument: `content_type` + "C408", # Unnecessary `dict()` call (rewrite as a literal) + "F601", # Dictionary key literal `"Empl"` repeated + "F821", # Undefined name `number1` + "PERF401", # Use a list comprehension to create a transformed list + "PLE2515", # Invalid unescaped character zero-width-space, use "\u200B" instead + "PLW1508", # Invalid type for environment variable default; expected `str` or `None` + "PT009", # Use a regular `assert` instead of unittest-style `assertEqual` + "PT018", # Assertion should be broken down into multiple parts + "PT027", # Use `pytest.raises` instead of unittest-style `assertRaises` + "Q003", # Change outer quotes to avoid escaping inner quotes + "T201", # `print` found + "TD002", # Missing author in TODO; try: `# TODO(): ...` + "TD003", # Missing issue link for this TODO + "FIX002", # Line contains TODO, consider resolving the issue + "ERA001", # Found commented-out code + "BLE001", # Do not catch blind exception + "UP008", # Use `super()` instead of `super(__class__, self)` + "SLF001", # Private member accessed: `_optionals` + "PLR200", # 4 Magic value used in comparison, consider replacing `200` with a constant variable + "PIE794", # Class field `ENUM_TYPE` is defined multiple times +] \ No newline at end of file